diff --git a/azure-keyvault/azure/keyvault/key_vault_client.py b/azure-keyvault/azure/keyvault/key_vault_client.py index 53d415b8dc3d..532f28af4fd6 100644 --- a/azure-keyvault/azure/keyvault/key_vault_client.py +++ b/azure-keyvault/azure/keyvault/key_vault_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -37,13 +37,13 @@ def __init__( super(KeyVaultClientConfiguration, self).__init__(base_url) - self.add_user_agent('azure-keyvault,/{}'.format(VERSION)) + self.add_user_agent('azure-keyvault/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials -class KeyVaultClient(object): +class KeyVaultClient(SDKClient): """The key vault client performs cryptographic key operations and vault operations against the Key Vault service. :ivar config: Configuration for client. @@ -58,7 +58,7 @@ def __init__( self, credentials): self.config = KeyVaultClientConfiguration(credentials) - self._client = ServiceClient(self.config.credentials, self.config) + super(KeyVaultClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '7.0-preview' @@ -85,7 +85,7 @@ def create_key( JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' :type kty: str or ~azure.keyvault.models.JsonWebKeyType - :param key_size: The key size in bytes. For example, 1024 or 2048. + :param key_size: The key size in bits. For example, 1024 or 2048. :type key_size: int :param key_ops: :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] @@ -3934,6 +3934,141 @@ def merge_certificate( return deserialized merge_certificate.metadata = {'url': '/certificates/{certificate-name}/pending/merge'} + def backup_certificate( + self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Backs up the specified certificate. + + Requests that a backup of the specified certificate be downloaded to + the client. All versions of the certificate will be downloaded. This + operation requires the certificates/backup permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackupCertificateResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.BackupCertificateResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.backup_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackupCertificateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + backup_certificate.metadata = {'url': '/certificates/{certificate-name}/backup'} + + def restore_certificate( + self, vault_base_url, certificate_bundle_backup, custom_headers=None, raw=False, **operation_config): + """Restores a backed up certificate to a vault. + + Restores a backed up certificate, and all its versions, to a vault. + This operation requires the certificates/restore permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_bundle_backup: The backup blob associated with a + certificate bundle. + :type certificate_bundle_backup: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.CertificateRestoreParameters(certificate_bundle_backup=certificate_bundle_backup) + + # Construct URL + url = self.restore_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CertificateRestoreParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + restore_certificate.metadata = {'url': '/certificates/restore'} + def get_deleted_certificates( self, vault_base_url, maxresults=None, include_pending=None, custom_headers=None, raw=False, **operation_config): """Lists the deleted certificates in the specified vault currently @@ -4424,7 +4559,7 @@ def get_deleted_storage_account( return deserialized get_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} - def purge_deleted_storge_account( + def purge_deleted_storage_account( self, vault_base_url, storage_account_name, custom_headers=None, raw=False, **operation_config): """Permanently deletes the specified storage account. @@ -4449,7 +4584,7 @@ def purge_deleted_storge_account( :class:`KeyVaultErrorException` """ # Construct URL - url = self.purge_deleted_storge_account.metadata['url'] + url = self.purge_deleted_storage_account.metadata['url'] path_format_arguments = { 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') @@ -4480,7 +4615,7 @@ def purge_deleted_storge_account( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - purge_deleted_storge_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} + purge_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} def recover_deleted_storage_account( self, vault_base_url, storage_account_name, custom_headers=None, raw=False, **operation_config): diff --git a/azure-keyvault/azure/keyvault/models/__init__.py b/azure-keyvault/azure/keyvault/models/__init__.py index 8488560f2b83..70233748f308 100644 --- a/azure-keyvault/azure/keyvault/models/__init__.py +++ b/azure-keyvault/azure/keyvault/models/__init__.py @@ -9,82 +9,164 @@ # regenerated. # -------------------------------------------------------------------------- -from .attributes import Attributes -from .json_web_key import JsonWebKey -from .key_attributes import KeyAttributes -from .key_bundle import KeyBundle -from .key_item import KeyItem -from .deleted_key_bundle import DeletedKeyBundle -from .deleted_key_item import DeletedKeyItem -from .secret_attributes import SecretAttributes -from .secret_bundle import SecretBundle -from .secret_item import SecretItem -from .deleted_secret_bundle import DeletedSecretBundle -from .deleted_secret_item import DeletedSecretItem -from .secret_restore_parameters import SecretRestoreParameters -from .storage_restore_parameters import StorageRestoreParameters -from .certificate_attributes import CertificateAttributes -from .certificate_item import CertificateItem -from .certificate_issuer_item import CertificateIssuerItem -from .key_properties import KeyProperties -from .secret_properties import SecretProperties -from .subject_alternative_names import SubjectAlternativeNames -from .x509_certificate_properties import X509CertificateProperties -from .trigger import Trigger -from .action import Action -from .lifetime_action import LifetimeAction -from .issuer_parameters import IssuerParameters -from .certificate_policy import CertificatePolicy -from .certificate_bundle import CertificateBundle -from .deleted_certificate_bundle import DeletedCertificateBundle -from .deleted_certificate_item import DeletedCertificateItem -from .error import Error -from .certificate_operation import CertificateOperation -from .issuer_credentials import IssuerCredentials -from .administrator_details import AdministratorDetails -from .organization_details import OrganizationDetails -from .issuer_attributes import IssuerAttributes -from .issuer_bundle import IssuerBundle -from .contact import Contact -from .contacts import Contacts -from .key_create_parameters import KeyCreateParameters -from .key_import_parameters import KeyImportParameters -from .key_operations_parameters import KeyOperationsParameters -from .key_sign_parameters import KeySignParameters -from .key_verify_parameters import KeyVerifyParameters -from .key_update_parameters import KeyUpdateParameters -from .key_restore_parameters import KeyRestoreParameters -from .secret_set_parameters import SecretSetParameters -from .secret_update_parameters import SecretUpdateParameters -from .certificate_create_parameters import CertificateCreateParameters -from .certificate_import_parameters import CertificateImportParameters -from .certificate_update_parameters import CertificateUpdateParameters -from .certificate_merge_parameters import CertificateMergeParameters -from .certificate_issuer_set_parameters import CertificateIssuerSetParameters -from .certificate_issuer_update_parameters import CertificateIssuerUpdateParameters -from .certificate_operation_update_parameter import CertificateOperationUpdateParameter -from .key_operation_result import KeyOperationResult -from .key_verify_result import KeyVerifyResult -from .backup_key_result import BackupKeyResult -from .backup_secret_result import BackupSecretResult -from .backup_storage_result import BackupStorageResult -from .pending_certificate_signing_request_result import PendingCertificateSigningRequestResult -from .storage_account_attributes import StorageAccountAttributes -from .storage_bundle import StorageBundle -from .deleted_storage_bundle import DeletedStorageBundle -from .storage_account_create_parameters import StorageAccountCreateParameters -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .storage_account_regenerte_key_parameters import StorageAccountRegenerteKeyParameters -from .storage_account_item import StorageAccountItem -from .deleted_storage_account_item import DeletedStorageAccountItem -from .sas_definition_attributes import SasDefinitionAttributes -from .sas_definition_bundle import SasDefinitionBundle -from .deleted_sas_definition_bundle import DeletedSasDefinitionBundle -from .sas_definition_item import SasDefinitionItem -from .deleted_sas_definition_item import DeletedSasDefinitionItem -from .sas_definition_create_parameters import SasDefinitionCreateParameters -from .sas_definition_update_parameters import SasDefinitionUpdateParameters -from .key_vault_error import KeyVaultError, KeyVaultErrorException +try: + from .attributes_py3 import Attributes + from .json_web_key_py3 import JsonWebKey + from .key_attributes_py3 import KeyAttributes + from .key_bundle_py3 import KeyBundle + from .key_item_py3 import KeyItem + from .deleted_key_bundle_py3 import DeletedKeyBundle + from .deleted_key_item_py3 import DeletedKeyItem + from .secret_attributes_py3 import SecretAttributes + from .secret_bundle_py3 import SecretBundle + from .secret_item_py3 import SecretItem + from .deleted_secret_bundle_py3 import DeletedSecretBundle + from .deleted_secret_item_py3 import DeletedSecretItem + from .secret_restore_parameters_py3 import SecretRestoreParameters + from .storage_restore_parameters_py3 import StorageRestoreParameters + from .certificate_attributes_py3 import CertificateAttributes + from .certificate_item_py3 import CertificateItem + from .certificate_issuer_item_py3 import CertificateIssuerItem + from .key_properties_py3 import KeyProperties + from .secret_properties_py3 import SecretProperties + from .subject_alternative_names_py3 import SubjectAlternativeNames + from .x509_certificate_properties_py3 import X509CertificateProperties + from .trigger_py3 import Trigger + from .action_py3 import Action + from .lifetime_action_py3 import LifetimeAction + from .issuer_parameters_py3 import IssuerParameters + from .certificate_policy_py3 import CertificatePolicy + from .certificate_bundle_py3 import CertificateBundle + from .deleted_certificate_bundle_py3 import DeletedCertificateBundle + from .deleted_certificate_item_py3 import DeletedCertificateItem + from .error_py3 import Error + from .certificate_operation_py3 import CertificateOperation + from .issuer_credentials_py3 import IssuerCredentials + from .administrator_details_py3 import AdministratorDetails + from .organization_details_py3 import OrganizationDetails + from .issuer_attributes_py3 import IssuerAttributes + from .issuer_bundle_py3 import IssuerBundle + from .contact_py3 import Contact + from .contacts_py3 import Contacts + from .key_create_parameters_py3 import KeyCreateParameters + from .key_import_parameters_py3 import KeyImportParameters + from .key_operations_parameters_py3 import KeyOperationsParameters + from .key_sign_parameters_py3 import KeySignParameters + from .key_verify_parameters_py3 import KeyVerifyParameters + from .key_update_parameters_py3 import KeyUpdateParameters + from .key_restore_parameters_py3 import KeyRestoreParameters + from .secret_set_parameters_py3 import SecretSetParameters + from .secret_update_parameters_py3 import SecretUpdateParameters + from .certificate_create_parameters_py3 import CertificateCreateParameters + from .certificate_import_parameters_py3 import CertificateImportParameters + from .certificate_update_parameters_py3 import CertificateUpdateParameters + from .certificate_merge_parameters_py3 import CertificateMergeParameters + from .certificate_issuer_set_parameters_py3 import CertificateIssuerSetParameters + from .certificate_issuer_update_parameters_py3 import CertificateIssuerUpdateParameters + from .certificate_operation_update_parameter_py3 import CertificateOperationUpdateParameter + from .key_operation_result_py3 import KeyOperationResult + from .key_verify_result_py3 import KeyVerifyResult + from .backup_key_result_py3 import BackupKeyResult + from .backup_secret_result_py3 import BackupSecretResult + from .backup_storage_result_py3 import BackupStorageResult + from .pending_certificate_signing_request_result_py3 import PendingCertificateSigningRequestResult + from .storage_account_attributes_py3 import StorageAccountAttributes + from .storage_bundle_py3 import StorageBundle + from .deleted_storage_bundle_py3 import DeletedStorageBundle + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .storage_account_regenerte_key_parameters_py3 import StorageAccountRegenerteKeyParameters + from .storage_account_item_py3 import StorageAccountItem + from .deleted_storage_account_item_py3 import DeletedStorageAccountItem + from .sas_definition_attributes_py3 import SasDefinitionAttributes + from .sas_definition_bundle_py3 import SasDefinitionBundle + from .deleted_sas_definition_bundle_py3 import DeletedSasDefinitionBundle + from .sas_definition_item_py3 import SasDefinitionItem + from .deleted_sas_definition_item_py3 import DeletedSasDefinitionItem + from .sas_definition_create_parameters_py3 import SasDefinitionCreateParameters + from .sas_definition_update_parameters_py3 import SasDefinitionUpdateParameters + from .key_vault_error_py3 import KeyVaultError, KeyVaultErrorException + from .certificate_restore_parameters_py3 import CertificateRestoreParameters + from .backup_certificate_result_py3 import BackupCertificateResult +except (SyntaxError, ImportError): + from .attributes import Attributes + from .json_web_key import JsonWebKey + from .key_attributes import KeyAttributes + from .key_bundle import KeyBundle + from .key_item import KeyItem + from .deleted_key_bundle import DeletedKeyBundle + from .deleted_key_item import DeletedKeyItem + from .secret_attributes import SecretAttributes + from .secret_bundle import SecretBundle + from .secret_item import SecretItem + from .deleted_secret_bundle import DeletedSecretBundle + from .deleted_secret_item import DeletedSecretItem + from .secret_restore_parameters import SecretRestoreParameters + from .storage_restore_parameters import StorageRestoreParameters + from .certificate_attributes import CertificateAttributes + from .certificate_item import CertificateItem + from .certificate_issuer_item import CertificateIssuerItem + from .key_properties import KeyProperties + from .secret_properties import SecretProperties + from .subject_alternative_names import SubjectAlternativeNames + from .x509_certificate_properties import X509CertificateProperties + from .trigger import Trigger + from .action import Action + from .lifetime_action import LifetimeAction + from .issuer_parameters import IssuerParameters + from .certificate_policy import CertificatePolicy + from .certificate_bundle import CertificateBundle + from .deleted_certificate_bundle import DeletedCertificateBundle + from .deleted_certificate_item import DeletedCertificateItem + from .error import Error + from .certificate_operation import CertificateOperation + from .issuer_credentials import IssuerCredentials + from .administrator_details import AdministratorDetails + from .organization_details import OrganizationDetails + from .issuer_attributes import IssuerAttributes + from .issuer_bundle import IssuerBundle + from .contact import Contact + from .contacts import Contacts + from .key_create_parameters import KeyCreateParameters + from .key_import_parameters import KeyImportParameters + from .key_operations_parameters import KeyOperationsParameters + from .key_sign_parameters import KeySignParameters + from .key_verify_parameters import KeyVerifyParameters + from .key_update_parameters import KeyUpdateParameters + from .key_restore_parameters import KeyRestoreParameters + from .secret_set_parameters import SecretSetParameters + from .secret_update_parameters import SecretUpdateParameters + from .certificate_create_parameters import CertificateCreateParameters + from .certificate_import_parameters import CertificateImportParameters + from .certificate_update_parameters import CertificateUpdateParameters + from .certificate_merge_parameters import CertificateMergeParameters + from .certificate_issuer_set_parameters import CertificateIssuerSetParameters + from .certificate_issuer_update_parameters import CertificateIssuerUpdateParameters + from .certificate_operation_update_parameter import CertificateOperationUpdateParameter + from .key_operation_result import KeyOperationResult + from .key_verify_result import KeyVerifyResult + from .backup_key_result import BackupKeyResult + from .backup_secret_result import BackupSecretResult + from .backup_storage_result import BackupStorageResult + from .pending_certificate_signing_request_result import PendingCertificateSigningRequestResult + from .storage_account_attributes import StorageAccountAttributes + from .storage_bundle import StorageBundle + from .deleted_storage_bundle import DeletedStorageBundle + from .storage_account_create_parameters import StorageAccountCreateParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .storage_account_regenerte_key_parameters import StorageAccountRegenerteKeyParameters + from .storage_account_item import StorageAccountItem + from .deleted_storage_account_item import DeletedStorageAccountItem + from .sas_definition_attributes import SasDefinitionAttributes + from .sas_definition_bundle import SasDefinitionBundle + from .deleted_sas_definition_bundle import DeletedSasDefinitionBundle + from .sas_definition_item import SasDefinitionItem + from .deleted_sas_definition_item import DeletedSasDefinitionItem + from .sas_definition_create_parameters import SasDefinitionCreateParameters + from .sas_definition_update_parameters import SasDefinitionUpdateParameters + from .key_vault_error import KeyVaultError, KeyVaultErrorException + from .certificate_restore_parameters import CertificateRestoreParameters + from .backup_certificate_result import BackupCertificateResult from .key_item_paged import KeyItemPaged from .deleted_key_item_paged import DeletedKeyItemPaged from .secret_item_paged import SecretItemPaged @@ -185,6 +267,8 @@ 'SasDefinitionCreateParameters', 'SasDefinitionUpdateParameters', 'KeyVaultError', 'KeyVaultErrorException', + 'CertificateRestoreParameters', + 'BackupCertificateResult', 'KeyItemPaged', 'DeletedKeyItemPaged', 'SecretItemPaged', diff --git a/azure-keyvault/azure/keyvault/models/action.py b/azure-keyvault/azure/keyvault/models/action.py index 12e33735ab84..23a4a13670db 100644 --- a/azure-keyvault/azure/keyvault/models/action.py +++ b/azure-keyvault/azure/keyvault/models/action.py @@ -24,6 +24,6 @@ class Action(Model): 'action_type': {'key': 'action_type', 'type': 'ActionType'}, } - def __init__(self, action_type=None): - super(Action, self).__init__() - self.action_type = action_type + def __init__(self, **kwargs): + super(Action, self).__init__(**kwargs) + self.action_type = kwargs.get('action_type', None) diff --git a/azure-keyvault/azure/keyvault/models/action_py3.py b/azure-keyvault/azure/keyvault/models/action_py3.py new file mode 100644 index 000000000000..285ffc71cb57 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/action_py3.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 msrest.serialization import Model + + +class Action(Model): + """The action that will be executed. + + :param action_type: The type of the action. Possible values include: + 'EmailContacts', 'AutoRenew' + :type action_type: str or ~azure.keyvault.models.ActionType + """ + + _attribute_map = { + 'action_type': {'key': 'action_type', 'type': 'ActionType'}, + } + + def __init__(self, *, action_type=None, **kwargs) -> None: + super(Action, self).__init__(**kwargs) + self.action_type = action_type diff --git a/azure-keyvault/azure/keyvault/models/administrator_details.py b/azure-keyvault/azure/keyvault/models/administrator_details.py index 1977d2cf71be..4026a83a5da4 100644 --- a/azure-keyvault/azure/keyvault/models/administrator_details.py +++ b/azure-keyvault/azure/keyvault/models/administrator_details.py @@ -32,9 +32,9 @@ class AdministratorDetails(Model): 'phone': {'key': 'phone', 'type': 'str'}, } - def __init__(self, first_name=None, last_name=None, email_address=None, phone=None): - super(AdministratorDetails, self).__init__() - self.first_name = first_name - self.last_name = last_name - self.email_address = email_address - self.phone = phone + def __init__(self, **kwargs): + super(AdministratorDetails, self).__init__(**kwargs) + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) + self.email_address = kwargs.get('email_address', None) + self.phone = kwargs.get('phone', None) diff --git a/azure-keyvault/azure/keyvault/models/administrator_details_py3.py b/azure-keyvault/azure/keyvault/models/administrator_details_py3.py new file mode 100644 index 000000000000..24a8ef8a3a1b --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/administrator_details_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AdministratorDetails(Model): + """Details of the organization administrator of the certificate issuer. + + :param first_name: First name. + :type first_name: str + :param last_name: Last name. + :type last_name: str + :param email_address: Email addresss. + :type email_address: str + :param phone: Phone number. + :type phone: str + """ + + _attribute_map = { + 'first_name': {'key': 'first_name', 'type': 'str'}, + 'last_name': {'key': 'last_name', 'type': 'str'}, + 'email_address': {'key': 'email', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__(self, *, first_name: str=None, last_name: str=None, email_address: str=None, phone: str=None, **kwargs) -> None: + super(AdministratorDetails, self).__init__(**kwargs) + self.first_name = first_name + self.last_name = last_name + self.email_address = email_address + self.phone = phone diff --git a/azure-keyvault/azure/keyvault/models/attributes.py b/azure-keyvault/azure/keyvault/models/attributes.py index 742f12e1e6e7..5c89678b313f 100644 --- a/azure-keyvault/azure/keyvault/models/attributes.py +++ b/azure-keyvault/azure/keyvault/models/attributes.py @@ -43,10 +43,10 @@ class Attributes(Model): 'updated': {'key': 'updated', 'type': 'unix-time'}, } - def __init__(self, enabled=None, not_before=None, expires=None): - super(Attributes, self).__init__() - self.enabled = enabled - self.not_before = not_before - self.expires = expires + def __init__(self, **kwargs): + super(Attributes, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.not_before = kwargs.get('not_before', None) + self.expires = kwargs.get('expires', None) self.created = None self.updated = None diff --git a/azure-keyvault/azure/keyvault/models/attributes_py3.py b/azure-keyvault/azure/keyvault/models/attributes_py3.py new file mode 100644 index 000000000000..16fe316c84cb --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/attributes_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class Attributes(Model): + """The object attributes managed by the KeyVault service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + } + + def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None: + super(Attributes, self).__init__(**kwargs) + self.enabled = enabled + self.not_before = not_before + self.expires = expires + self.created = None + self.updated = None diff --git a/azure-keyvault/azure/keyvault/models/backup_certificate_result.py b/azure-keyvault/azure/keyvault/models/backup_certificate_result.py new file mode 100644 index 000000000000..670034f28a2a --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/backup_certificate_result.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class BackupCertificateResult(Model): + """The backup certificate result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up certificate. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(BackupCertificateResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-keyvault/azure/keyvault/models/backup_certificate_result_py3.py b/azure-keyvault/azure/keyvault/models/backup_certificate_result_py3.py new file mode 100644 index 000000000000..1d65f5dd8cc9 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/backup_certificate_result_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class BackupCertificateResult(Model): + """The backup certificate result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up certificate. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(BackupCertificateResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-keyvault/azure/keyvault/models/backup_key_result.py b/azure-keyvault/azure/keyvault/models/backup_key_result.py index 95d0e9bfd86f..4aaa5fc2ebe8 100644 --- a/azure-keyvault/azure/keyvault/models/backup_key_result.py +++ b/azure-keyvault/azure/keyvault/models/backup_key_result.py @@ -30,6 +30,6 @@ class BackupKeyResult(Model): 'value': {'key': 'value', 'type': 'base64'}, } - def __init__(self): - super(BackupKeyResult, self).__init__() + def __init__(self, **kwargs): + super(BackupKeyResult, self).__init__(**kwargs) self.value = None diff --git a/azure-keyvault/azure/keyvault/models/backup_key_result_py3.py b/azure-keyvault/azure/keyvault/models/backup_key_result_py3.py new file mode 100644 index 000000000000..7865e8701f76 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/backup_key_result_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class BackupKeyResult(Model): + """The backup key result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up key. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(BackupKeyResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-keyvault/azure/keyvault/models/backup_secret_result.py b/azure-keyvault/azure/keyvault/models/backup_secret_result.py index bd8f520a2598..4f803fc0cefe 100644 --- a/azure-keyvault/azure/keyvault/models/backup_secret_result.py +++ b/azure-keyvault/azure/keyvault/models/backup_secret_result.py @@ -30,6 +30,6 @@ class BackupSecretResult(Model): 'value': {'key': 'value', 'type': 'base64'}, } - def __init__(self): - super(BackupSecretResult, self).__init__() + def __init__(self, **kwargs): + super(BackupSecretResult, self).__init__(**kwargs) self.value = None diff --git a/azure-keyvault/azure/keyvault/models/backup_secret_result_py3.py b/azure-keyvault/azure/keyvault/models/backup_secret_result_py3.py new file mode 100644 index 000000000000..444ba7fe0fb5 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/backup_secret_result_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class BackupSecretResult(Model): + """The backup secret result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up secret. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(BackupSecretResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-keyvault/azure/keyvault/models/backup_storage_result.py b/azure-keyvault/azure/keyvault/models/backup_storage_result.py index d6145e6632ce..0847f47dd5c1 100644 --- a/azure-keyvault/azure/keyvault/models/backup_storage_result.py +++ b/azure-keyvault/azure/keyvault/models/backup_storage_result.py @@ -30,6 +30,6 @@ class BackupStorageResult(Model): 'value': {'key': 'value', 'type': 'base64'}, } - def __init__(self): - super(BackupStorageResult, self).__init__() + def __init__(self, **kwargs): + super(BackupStorageResult, self).__init__(**kwargs) self.value = None diff --git a/azure-keyvault/azure/keyvault/models/backup_storage_result_py3.py b/azure-keyvault/azure/keyvault/models/backup_storage_result_py3.py new file mode 100644 index 000000000000..26b965744a7a --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/backup_storage_result_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class BackupStorageResult(Model): + """The backup storage result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up storage account. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(BackupStorageResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-keyvault/azure/keyvault/models/certificate_attributes.py b/azure-keyvault/azure/keyvault/models/certificate_attributes.py index 29f10a4b15ac..a372c204ff0e 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_attributes.py +++ b/azure-keyvault/azure/keyvault/models/certificate_attributes.py @@ -54,6 +54,6 @@ class CertificateAttributes(Attributes): 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, } - def __init__(self, enabled=None, not_before=None, expires=None): - super(CertificateAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires) + def __init__(self, **kwargs): + super(CertificateAttributes, self).__init__(**kwargs) self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/certificate_attributes_py3.py b/azure-keyvault/azure/keyvault/models/certificate_attributes_py3.py new file mode 100644 index 000000000000..0a977c07a8b0 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_attributes_py3.py @@ -0,0 +1,59 @@ +# 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 .attributes_py3 import Attributes + + +class CertificateAttributes(Attributes): + """The certificate management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for certificates in the current vault. If it contains 'Purgeable', + the certificate can be permanently deleted by a privileged user; + otherwise, only the system can purge the certificate, at the end of the + retention interval. Possible values include: 'Purgeable', + 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None: + super(CertificateAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs) + self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/certificate_bundle.py b/azure-keyvault/azure/keyvault/models/certificate_bundle.py index 8faaf134b500..7e06eccada5d 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_bundle.py +++ b/azure-keyvault/azure/keyvault/models/certificate_bundle.py @@ -58,14 +58,14 @@ class CertificateBundle(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, cer=None, content_type=None, attributes=None, tags=None): - super(CertificateBundle, self).__init__() + def __init__(self, **kwargs): + super(CertificateBundle, self).__init__(**kwargs) self.id = None self.kid = None self.sid = None self.x509_thumbprint = None self.policy = None - self.cer = cer - self.content_type = content_type - self.attributes = attributes - self.tags = tags + self.cer = kwargs.get('cer', None) + self.content_type = kwargs.get('content_type', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_bundle_py3.py b/azure-keyvault/azure/keyvault/models/certificate_bundle_py3.py new file mode 100644 index 000000000000..f1870ec6268a --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_bundle_py3.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 msrest.serialization import Model + + +class CertificateBundle(Model): + """A certificate bundle consists of a certificate (X509) plus its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :ivar kid: The key id. + :vartype kid: str + :ivar sid: The secret id. + :vartype sid: str + :ivar x509_thumbprint: Thumbprint of the certificate. + :vartype x509_thumbprint: bytes + :ivar policy: The management policy. + :vartype policy: ~azure.keyvault.models.CertificatePolicy + :param cer: CER contents of x509 certificate. + :type cer: bytearray + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The certificate attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'kid': {'readonly': True}, + 'sid': {'readonly': True}, + 'x509_thumbprint': {'readonly': True}, + 'policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + 'policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'cer': {'key': 'cer', 'type': 'bytearray'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=None, tags=None, **kwargs) -> None: + super(CertificateBundle, self).__init__(**kwargs) + self.id = None + self.kid = None + self.sid = None + self.x509_thumbprint = None + self.policy = None + self.cer = cer + self.content_type = content_type + self.attributes = attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/certificate_create_parameters.py b/azure-keyvault/azure/keyvault/models/certificate_create_parameters.py index 3565ddd53054..67b72b43f738 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_create_parameters.py +++ b/azure-keyvault/azure/keyvault/models/certificate_create_parameters.py @@ -30,8 +30,8 @@ class CertificateCreateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, certificate_policy=None, certificate_attributes=None, tags=None): - super(CertificateCreateParameters, self).__init__() - self.certificate_policy = certificate_policy - self.certificate_attributes = certificate_attributes - self.tags = tags + def __init__(self, **kwargs): + super(CertificateCreateParameters, self).__init__(**kwargs) + self.certificate_policy = kwargs.get('certificate_policy', None) + self.certificate_attributes = kwargs.get('certificate_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_create_parameters_py3.py b/azure-keyvault/azure/keyvault/models/certificate_create_parameters_py3.py new file mode 100644 index 000000000000..674f3eb0a63c --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_create_parameters_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class CertificateCreateParameters(Model): + """The certificate create parameters. + + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'certificate_policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None: + super(CertificateCreateParameters, self).__init__(**kwargs) + self.certificate_policy = certificate_policy + self.certificate_attributes = certificate_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/certificate_import_parameters.py b/azure-keyvault/azure/keyvault/models/certificate_import_parameters.py index 24d025b0b680..635afbd1361d 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_import_parameters.py +++ b/azure-keyvault/azure/keyvault/models/certificate_import_parameters.py @@ -15,8 +15,10 @@ class CertificateImportParameters(Model): """The certificate import parameters. - :param base64_encoded_certificate: Base64 encoded representation of the - certificate object to import. This certificate needs to contain the + All required parameters must be populated in order to send to Azure. + + :param base64_encoded_certificate: Required. Base64 encoded representation + of the certificate object to import. This certificate needs to contain the private key. :type base64_encoded_certificate: str :param password: If the private key in base64EncodedCertificate is @@ -43,10 +45,10 @@ class CertificateImportParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, base64_encoded_certificate, password=None, certificate_policy=None, certificate_attributes=None, tags=None): - super(CertificateImportParameters, self).__init__() - self.base64_encoded_certificate = base64_encoded_certificate - self.password = password - self.certificate_policy = certificate_policy - self.certificate_attributes = certificate_attributes - self.tags = tags + def __init__(self, **kwargs): + super(CertificateImportParameters, self).__init__(**kwargs) + self.base64_encoded_certificate = kwargs.get('base64_encoded_certificate', None) + self.password = kwargs.get('password', None) + self.certificate_policy = kwargs.get('certificate_policy', None) + self.certificate_attributes = kwargs.get('certificate_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_import_parameters_py3.py b/azure-keyvault/azure/keyvault/models/certificate_import_parameters_py3.py new file mode 100644 index 000000000000..f30ad37e711c --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_import_parameters_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class CertificateImportParameters(Model): + """The certificate import parameters. + + All required parameters must be populated in order to send to Azure. + + :param base64_encoded_certificate: Required. Base64 encoded representation + of the certificate object to import. This certificate needs to contain the + private key. + :type base64_encoded_certificate: str + :param password: If the private key in base64EncodedCertificate is + encrypted, the password used for encryption. + :type password: str + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'base64_encoded_certificate': {'required': True}, + } + + _attribute_map = { + 'base64_encoded_certificate': {'key': 'value', 'type': 'str'}, + 'password': {'key': 'pwd', 'type': 'str'}, + 'certificate_policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, base64_encoded_certificate: str, password: str=None, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None: + super(CertificateImportParameters, self).__init__(**kwargs) + self.base64_encoded_certificate = base64_encoded_certificate + self.password = password + self.certificate_policy = certificate_policy + self.certificate_attributes = certificate_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/certificate_issuer_item.py b/azure-keyvault/azure/keyvault/models/certificate_issuer_item.py index 75c06f67df49..98713b2ab4c1 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_issuer_item.py +++ b/azure-keyvault/azure/keyvault/models/certificate_issuer_item.py @@ -26,7 +26,7 @@ class CertificateIssuerItem(Model): 'provider': {'key': 'provider', 'type': 'str'}, } - def __init__(self, id=None, provider=None): - super(CertificateIssuerItem, self).__init__() - self.id = id - self.provider = provider + def __init__(self, **kwargs): + super(CertificateIssuerItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.provider = kwargs.get('provider', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_issuer_item_py3.py b/azure-keyvault/azure/keyvault/models/certificate_issuer_item_py3.py new file mode 100644 index 000000000000..f11aa78f8cdd --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_issuer_item_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class CertificateIssuerItem(Model): + """The certificate issuer item containing certificate issuer metadata. + + :param id: Certificate Identifier. + :type id: str + :param provider: The issuer provider. + :type provider: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provider: str=None, **kwargs) -> None: + super(CertificateIssuerItem, self).__init__(**kwargs) + self.id = id + self.provider = provider diff --git a/azure-keyvault/azure/keyvault/models/certificate_issuer_set_parameters.py b/azure-keyvault/azure/keyvault/models/certificate_issuer_set_parameters.py index 9d16a5bec245..733740938202 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_issuer_set_parameters.py +++ b/azure-keyvault/azure/keyvault/models/certificate_issuer_set_parameters.py @@ -15,7 +15,9 @@ class CertificateIssuerSetParameters(Model): """The certificate issuer set parameters. - :param provider: The issuer provider. + All required parameters must be populated in order to send to Azure. + + :param provider: Required. The issuer provider. :type provider: str :param credentials: The credentials to be used for the issuer. :type credentials: ~azure.keyvault.models.IssuerCredentials @@ -37,9 +39,9 @@ class CertificateIssuerSetParameters(Model): 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, } - def __init__(self, provider, credentials=None, organization_details=None, attributes=None): - super(CertificateIssuerSetParameters, self).__init__() - self.provider = provider - self.credentials = credentials - self.organization_details = organization_details - self.attributes = attributes + def __init__(self, **kwargs): + super(CertificateIssuerSetParameters, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.credentials = kwargs.get('credentials', None) + self.organization_details = kwargs.get('organization_details', None) + self.attributes = kwargs.get('attributes', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_issuer_set_parameters_py3.py b/azure-keyvault/azure/keyvault/models/certificate_issuer_set_parameters_py3.py new file mode 100644 index 000000000000..6a36eaef3ae9 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_issuer_set_parameters_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class CertificateIssuerSetParameters(Model): + """The certificate issuer set parameters. + + All required parameters must be populated in order to send to Azure. + + :param provider: Required. The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided to + the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + """ + + _validation = { + 'provider': {'required': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, + 'organization_details': {'key': 'org_details', 'type': 'OrganizationDetails'}, + 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, + } + + def __init__(self, *, provider: str, credentials=None, organization_details=None, attributes=None, **kwargs) -> None: + super(CertificateIssuerSetParameters, self).__init__(**kwargs) + self.provider = provider + self.credentials = credentials + self.organization_details = organization_details + self.attributes = attributes diff --git a/azure-keyvault/azure/keyvault/models/certificate_issuer_update_parameters.py b/azure-keyvault/azure/keyvault/models/certificate_issuer_update_parameters.py index 22b326974681..44347583ed42 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_issuer_update_parameters.py +++ b/azure-keyvault/azure/keyvault/models/certificate_issuer_update_parameters.py @@ -33,9 +33,9 @@ class CertificateIssuerUpdateParameters(Model): 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, } - def __init__(self, provider=None, credentials=None, organization_details=None, attributes=None): - super(CertificateIssuerUpdateParameters, self).__init__() - self.provider = provider - self.credentials = credentials - self.organization_details = organization_details - self.attributes = attributes + def __init__(self, **kwargs): + super(CertificateIssuerUpdateParameters, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.credentials = kwargs.get('credentials', None) + self.organization_details = kwargs.get('organization_details', None) + self.attributes = kwargs.get('attributes', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_issuer_update_parameters_py3.py b/azure-keyvault/azure/keyvault/models/certificate_issuer_update_parameters_py3.py new file mode 100644 index 000000000000..0b06096a438d --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_issuer_update_parameters_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class CertificateIssuerUpdateParameters(Model): + """The certificate issuer update parameters. + + :param provider: The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided to + the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, + 'organization_details': {'key': 'org_details', 'type': 'OrganizationDetails'}, + 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, + } + + def __init__(self, *, provider: str=None, credentials=None, organization_details=None, attributes=None, **kwargs) -> None: + super(CertificateIssuerUpdateParameters, self).__init__(**kwargs) + self.provider = provider + self.credentials = credentials + self.organization_details = organization_details + self.attributes = attributes diff --git a/azure-keyvault/azure/keyvault/models/certificate_item.py b/azure-keyvault/azure/keyvault/models/certificate_item.py index 38161f94b73f..405cc71751a5 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_item.py +++ b/azure-keyvault/azure/keyvault/models/certificate_item.py @@ -32,9 +32,9 @@ class CertificateItem(Model): 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, } - def __init__(self, id=None, attributes=None, tags=None, x509_thumbprint=None): - super(CertificateItem, self).__init__() - self.id = id - self.attributes = attributes - self.tags = tags - self.x509_thumbprint = x509_thumbprint + def __init__(self, **kwargs): + super(CertificateItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) + self.x509_thumbprint = kwargs.get('x509_thumbprint', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_item_py3.py b/azure-keyvault/azure/keyvault/models/certificate_item_py3.py new file mode 100644 index 000000000000..8d27a8cc6246 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_item_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class CertificateItem(Model): + """The certificate item containing certificate metadata. + + :param id: Certificate identifier. + :type id: str + :param attributes: The certificate management attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param x509_thumbprint: Thumbprint of the certificate. + :type x509_thumbprint: bytes + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + } + + def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint: bytes=None, **kwargs) -> None: + super(CertificateItem, self).__init__(**kwargs) + self.id = id + self.attributes = attributes + self.tags = tags + self.x509_thumbprint = x509_thumbprint diff --git a/azure-keyvault/azure/keyvault/models/certificate_merge_parameters.py b/azure-keyvault/azure/keyvault/models/certificate_merge_parameters.py index ebf692df08de..cb4226161fab 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_merge_parameters.py +++ b/azure-keyvault/azure/keyvault/models/certificate_merge_parameters.py @@ -15,8 +15,10 @@ class CertificateMergeParameters(Model): """The certificate merge parameters. - :param x509_certificates: The certificate or the certificate chain to - merge. + All required parameters must be populated in order to send to Azure. + + :param x509_certificates: Required. The certificate or the certificate + chain to merge. :type x509_certificates: list[bytearray] :param certificate_attributes: The attributes of the certificate (optional). @@ -35,8 +37,8 @@ class CertificateMergeParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, x509_certificates, certificate_attributes=None, tags=None): - super(CertificateMergeParameters, self).__init__() - self.x509_certificates = x509_certificates - self.certificate_attributes = certificate_attributes - self.tags = tags + def __init__(self, **kwargs): + super(CertificateMergeParameters, self).__init__(**kwargs) + self.x509_certificates = kwargs.get('x509_certificates', None) + self.certificate_attributes = kwargs.get('certificate_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_merge_parameters_py3.py b/azure-keyvault/azure/keyvault/models/certificate_merge_parameters_py3.py new file mode 100644 index 000000000000..375dfc9bf8e9 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_merge_parameters_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class CertificateMergeParameters(Model): + """The certificate merge parameters. + + All required parameters must be populated in order to send to Azure. + + :param x509_certificates: Required. The certificate or the certificate + chain to merge. + :type x509_certificates: list[bytearray] + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'x509_certificates': {'required': True}, + } + + _attribute_map = { + 'x509_certificates': {'key': 'x5c', 'type': '[bytearray]'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, x509_certificates, certificate_attributes=None, tags=None, **kwargs) -> None: + super(CertificateMergeParameters, self).__init__(**kwargs) + self.x509_certificates = x509_certificates + self.certificate_attributes = certificate_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/certificate_operation.py b/azure-keyvault/azure/keyvault/models/certificate_operation.py index f0bacc90bb2d..d9976856dd6e 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_operation.py +++ b/azure-keyvault/azure/keyvault/models/certificate_operation.py @@ -58,14 +58,14 @@ class CertificateOperation(Model): 'request_id': {'key': 'request_id', 'type': 'str'}, } - def __init__(self, issuer_parameters=None, csr=None, cancellation_requested=None, status=None, status_details=None, error=None, target=None, request_id=None): - super(CertificateOperation, self).__init__() + def __init__(self, **kwargs): + super(CertificateOperation, self).__init__(**kwargs) self.id = None - self.issuer_parameters = issuer_parameters - self.csr = csr - self.cancellation_requested = cancellation_requested - self.status = status - self.status_details = status_details - self.error = error - self.target = target - self.request_id = request_id + self.issuer_parameters = kwargs.get('issuer_parameters', None) + self.csr = kwargs.get('csr', None) + self.cancellation_requested = kwargs.get('cancellation_requested', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.error = kwargs.get('error', None) + self.target = kwargs.get('target', None) + self.request_id = kwargs.get('request_id', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_operation_py3.py b/azure-keyvault/azure/keyvault/models/certificate_operation_py3.py new file mode 100644 index 000000000000..674fa5e0414a --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_operation_py3.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 msrest.serialization import Model + + +class CertificateOperation(Model): + """A certificate operation is returned in case of asynchronous requests. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :param issuer_parameters: Parameters for the issuer of the X509 component + of a certificate. + :type issuer_parameters: ~azure.keyvault.models.IssuerParameters + :param csr: The certificate signing request (CSR) that is being used in + the certificate operation. + :type csr: bytearray + :param cancellation_requested: Indicates if cancellation was requested on + the certificate operation. + :type cancellation_requested: bool + :param status: Status of the certificate operation. + :type status: str + :param status_details: The status details of the certificate operation. + :type status_details: str + :param error: Error encountered, if any, during the certificate operation. + :type error: ~azure.keyvault.models.Error + :param target: Location which contains the result of the certificate + operation. + :type target: str + :param request_id: Identifier for the certificate operation. + :type request_id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'issuer_parameters': {'key': 'issuer', 'type': 'IssuerParameters'}, + 'csr': {'key': 'csr', 'type': 'bytearray'}, + 'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_details': {'key': 'status_details', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'target': {'key': 'target', 'type': 'str'}, + 'request_id': {'key': 'request_id', 'type': 'str'}, + } + + def __init__(self, *, issuer_parameters=None, csr: bytearray=None, cancellation_requested: bool=None, status: str=None, status_details: str=None, error=None, target: str=None, request_id: str=None, **kwargs) -> None: + super(CertificateOperation, self).__init__(**kwargs) + self.id = None + self.issuer_parameters = issuer_parameters + self.csr = csr + self.cancellation_requested = cancellation_requested + self.status = status + self.status_details = status_details + self.error = error + self.target = target + self.request_id = request_id diff --git a/azure-keyvault/azure/keyvault/models/certificate_operation_update_parameter.py b/azure-keyvault/azure/keyvault/models/certificate_operation_update_parameter.py index d318fa3e2d81..fadc2e3ea734 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_operation_update_parameter.py +++ b/azure-keyvault/azure/keyvault/models/certificate_operation_update_parameter.py @@ -15,8 +15,10 @@ class CertificateOperationUpdateParameter(Model): """The certificate operation update parameters. - :param cancellation_requested: Indicates if cancellation was requested on - the certificate operation. + All required parameters must be populated in order to send to Azure. + + :param cancellation_requested: Required. Indicates if cancellation was + requested on the certificate operation. :type cancellation_requested: bool """ @@ -28,6 +30,6 @@ class CertificateOperationUpdateParameter(Model): 'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'}, } - def __init__(self, cancellation_requested): - super(CertificateOperationUpdateParameter, self).__init__() - self.cancellation_requested = cancellation_requested + def __init__(self, **kwargs): + super(CertificateOperationUpdateParameter, self).__init__(**kwargs) + self.cancellation_requested = kwargs.get('cancellation_requested', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_operation_update_parameter_py3.py b/azure-keyvault/azure/keyvault/models/certificate_operation_update_parameter_py3.py new file mode 100644 index 000000000000..c9fea79090ee --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_operation_update_parameter_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class CertificateOperationUpdateParameter(Model): + """The certificate operation update parameters. + + All required parameters must be populated in order to send to Azure. + + :param cancellation_requested: Required. Indicates if cancellation was + requested on the certificate operation. + :type cancellation_requested: bool + """ + + _validation = { + 'cancellation_requested': {'required': True}, + } + + _attribute_map = { + 'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'}, + } + + def __init__(self, *, cancellation_requested: bool, **kwargs) -> None: + super(CertificateOperationUpdateParameter, self).__init__(**kwargs) + self.cancellation_requested = cancellation_requested diff --git a/azure-keyvault/azure/keyvault/models/certificate_policy.py b/azure-keyvault/azure/keyvault/models/certificate_policy.py index b91a0a1ea6e0..cbf8823076ea 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_policy.py +++ b/azure-keyvault/azure/keyvault/models/certificate_policy.py @@ -52,12 +52,12 @@ class CertificatePolicy(Model): 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, } - def __init__(self, key_properties=None, secret_properties=None, x509_certificate_properties=None, lifetime_actions=None, issuer_parameters=None, attributes=None): - super(CertificatePolicy, self).__init__() + def __init__(self, **kwargs): + super(CertificatePolicy, self).__init__(**kwargs) self.id = None - self.key_properties = key_properties - self.secret_properties = secret_properties - self.x509_certificate_properties = x509_certificate_properties - self.lifetime_actions = lifetime_actions - self.issuer_parameters = issuer_parameters - self.attributes = attributes + self.key_properties = kwargs.get('key_properties', None) + self.secret_properties = kwargs.get('secret_properties', None) + self.x509_certificate_properties = kwargs.get('x509_certificate_properties', None) + self.lifetime_actions = kwargs.get('lifetime_actions', None) + self.issuer_parameters = kwargs.get('issuer_parameters', None) + self.attributes = kwargs.get('attributes', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_policy_py3.py b/azure-keyvault/azure/keyvault/models/certificate_policy_py3.py new file mode 100644 index 000000000000..d338af8a0044 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_policy_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class CertificatePolicy(Model): + """Management policy for a certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :param key_properties: Properties of the key backing a certificate. + :type key_properties: ~azure.keyvault.models.KeyProperties + :param secret_properties: Properties of the secret backing a certificate. + :type secret_properties: ~azure.keyvault.models.SecretProperties + :param x509_certificate_properties: Properties of the X509 component of a + certificate. + :type x509_certificate_properties: + ~azure.keyvault.models.X509CertificateProperties + :param lifetime_actions: Actions that will be performed by Key Vault over + the lifetime of a certificate. + :type lifetime_actions: list[~azure.keyvault.models.LifetimeAction] + :param issuer_parameters: Parameters for the issuer of the X509 component + of a certificate. + :type issuer_parameters: ~azure.keyvault.models.IssuerParameters + :param attributes: The certificate attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'key_properties': {'key': 'key_props', 'type': 'KeyProperties'}, + 'secret_properties': {'key': 'secret_props', 'type': 'SecretProperties'}, + 'x509_certificate_properties': {'key': 'x509_props', 'type': 'X509CertificateProperties'}, + 'lifetime_actions': {'key': 'lifetime_actions', 'type': '[LifetimeAction]'}, + 'issuer_parameters': {'key': 'issuer', 'type': 'IssuerParameters'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + } + + def __init__(self, *, key_properties=None, secret_properties=None, x509_certificate_properties=None, lifetime_actions=None, issuer_parameters=None, attributes=None, **kwargs) -> None: + super(CertificatePolicy, self).__init__(**kwargs) + self.id = None + self.key_properties = key_properties + self.secret_properties = secret_properties + self.x509_certificate_properties = x509_certificate_properties + self.lifetime_actions = lifetime_actions + self.issuer_parameters = issuer_parameters + self.attributes = attributes diff --git a/azure-keyvault/azure/keyvault/models/certificate_restore_parameters.py b/azure-keyvault/azure/keyvault/models/certificate_restore_parameters.py new file mode 100644 index 000000000000..2a03516d6356 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_restore_parameters.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class CertificateRestoreParameters(Model): + """The certificate restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param certificate_bundle_backup: Required. The backup blob associated + with a certificate bundle. + :type certificate_bundle_backup: bytes + """ + + _validation = { + 'certificate_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'certificate_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(CertificateRestoreParameters, self).__init__(**kwargs) + self.certificate_bundle_backup = kwargs.get('certificate_bundle_backup', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_restore_parameters_py3.py b/azure-keyvault/azure/keyvault/models/certificate_restore_parameters_py3.py new file mode 100644 index 000000000000..674a1294fed1 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_restore_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class CertificateRestoreParameters(Model): + """The certificate restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param certificate_bundle_backup: Required. The backup blob associated + with a certificate bundle. + :type certificate_bundle_backup: bytes + """ + + _validation = { + 'certificate_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'certificate_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, certificate_bundle_backup: bytes, **kwargs) -> None: + super(CertificateRestoreParameters, self).__init__(**kwargs) + self.certificate_bundle_backup = certificate_bundle_backup diff --git a/azure-keyvault/azure/keyvault/models/certificate_update_parameters.py b/azure-keyvault/azure/keyvault/models/certificate_update_parameters.py index cd0f711d1cad..9407d23b28ec 100644 --- a/azure-keyvault/azure/keyvault/models/certificate_update_parameters.py +++ b/azure-keyvault/azure/keyvault/models/certificate_update_parameters.py @@ -30,8 +30,8 @@ class CertificateUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, certificate_policy=None, certificate_attributes=None, tags=None): - super(CertificateUpdateParameters, self).__init__() - self.certificate_policy = certificate_policy - self.certificate_attributes = certificate_attributes - self.tags = tags + def __init__(self, **kwargs): + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.certificate_policy = kwargs.get('certificate_policy', None) + self.certificate_attributes = kwargs.get('certificate_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/certificate_update_parameters_py3.py b/azure-keyvault/azure/keyvault/models/certificate_update_parameters_py3.py new file mode 100644 index 000000000000..cddbe4ea6cee --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/certificate_update_parameters_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class CertificateUpdateParameters(Model): + """The certificate update parameters. + + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'certificate_policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None: + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.certificate_policy = certificate_policy + self.certificate_attributes = certificate_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/contact.py b/azure-keyvault/azure/keyvault/models/contact.py index b82f4b760823..217a04fb85d0 100644 --- a/azure-keyvault/azure/keyvault/models/contact.py +++ b/azure-keyvault/azure/keyvault/models/contact.py @@ -29,8 +29,8 @@ class Contact(Model): 'phone': {'key': 'phone', 'type': 'str'}, } - def __init__(self, email_address=None, name=None, phone=None): - super(Contact, self).__init__() - self.email_address = email_address - self.name = name - self.phone = phone + def __init__(self, **kwargs): + super(Contact, self).__init__(**kwargs) + self.email_address = kwargs.get('email_address', None) + self.name = kwargs.get('name', None) + self.phone = kwargs.get('phone', None) diff --git a/azure-keyvault/azure/keyvault/models/contact_py3.py b/azure-keyvault/azure/keyvault/models/contact_py3.py new file mode 100644 index 000000000000..56569b0d9912 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/contact_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class Contact(Model): + """The contact information for the vault certificates. + + :param email_address: Email addresss. + :type email_address: str + :param name: Name. + :type name: str + :param phone: Phone number. + :type phone: str + """ + + _attribute_map = { + 'email_address': {'key': 'email', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__(self, *, email_address: str=None, name: str=None, phone: str=None, **kwargs) -> None: + super(Contact, self).__init__(**kwargs) + self.email_address = email_address + self.name = name + self.phone = phone diff --git a/azure-keyvault/azure/keyvault/models/contacts.py b/azure-keyvault/azure/keyvault/models/contacts.py index f6f18131c365..4efc32f9b5be 100644 --- a/azure-keyvault/azure/keyvault/models/contacts.py +++ b/azure-keyvault/azure/keyvault/models/contacts.py @@ -33,7 +33,7 @@ class Contacts(Model): 'contact_list': {'key': 'contacts', 'type': '[Contact]'}, } - def __init__(self, contact_list=None): - super(Contacts, self).__init__() + def __init__(self, **kwargs): + super(Contacts, self).__init__(**kwargs) self.id = None - self.contact_list = contact_list + self.contact_list = kwargs.get('contact_list', None) diff --git a/azure-keyvault/azure/keyvault/models/contacts_py3.py b/azure-keyvault/azure/keyvault/models/contacts_py3.py new file mode 100644 index 000000000000..c2539d8e6de3 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/contacts_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class Contacts(Model): + """The contacts for the vault certificates. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Identifier for the contacts collection. + :vartype id: str + :param contact_list: The contact list for the vault certificates. + :type contact_list: list[~azure.keyvault.models.Contact] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'contact_list': {'key': 'contacts', 'type': '[Contact]'}, + } + + def __init__(self, *, contact_list=None, **kwargs) -> None: + super(Contacts, self).__init__(**kwargs) + self.id = None + self.contact_list = contact_list diff --git a/azure-keyvault/azure/keyvault/models/deleted_certificate_bundle.py b/azure-keyvault/azure/keyvault/models/deleted_certificate_bundle.py index 1c28a8cf4233..b3fac86a9805 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_certificate_bundle.py +++ b/azure-keyvault/azure/keyvault/models/deleted_certificate_bundle.py @@ -72,8 +72,8 @@ class DeletedCertificateBundle(CertificateBundle): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, cer=None, content_type=None, attributes=None, tags=None, recovery_id=None): - super(DeletedCertificateBundle, self).__init__(cer=cer, content_type=content_type, attributes=attributes, tags=tags) - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedCertificateBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_certificate_bundle_py3.py b/azure-keyvault/azure/keyvault/models/deleted_certificate_bundle_py3.py new file mode 100644 index 000000000000..c028d1db6740 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_certificate_bundle_py3.py @@ -0,0 +1,79 @@ +# 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 .certificate_bundle_py3 import CertificateBundle + + +class DeletedCertificateBundle(CertificateBundle): + """A Deleted Certificate consisting of its previous id, attributes and its + tags, as well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :ivar kid: The key id. + :vartype kid: str + :ivar sid: The secret id. + :vartype sid: str + :ivar x509_thumbprint: Thumbprint of the certificate. + :vartype x509_thumbprint: bytes + :ivar policy: The management policy. + :vartype policy: ~azure.keyvault.models.CertificatePolicy + :param cer: CER contents of x509 certificate. + :type cer: bytearray + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The certificate attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs + :type tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted certificate. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the certificate is scheduled to + be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the certificate was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'kid': {'readonly': True}, + 'sid': {'readonly': True}, + 'x509_thumbprint': {'readonly': True}, + 'policy': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + 'policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'cer': {'key': 'cer', 'type': 'bytearray'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedCertificateBundle, self).__init__(cer=cer, content_type=content_type, attributes=attributes, tags=tags, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_certificate_item.py b/azure-keyvault/azure/keyvault/models/deleted_certificate_item.py index 02d21daee438..e6fa2963cc09 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_certificate_item.py +++ b/azure-keyvault/azure/keyvault/models/deleted_certificate_item.py @@ -52,8 +52,8 @@ class DeletedCertificateItem(CertificateItem): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, id=None, attributes=None, tags=None, x509_thumbprint=None, recovery_id=None): - super(DeletedCertificateItem, self).__init__(id=id, attributes=attributes, tags=tags, x509_thumbprint=x509_thumbprint) - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedCertificateItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_certificate_item_py3.py b/azure-keyvault/azure/keyvault/models/deleted_certificate_item_py3.py new file mode 100644 index 000000000000..eb9c4c941c7c --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_certificate_item_py3.py @@ -0,0 +1,59 @@ +# 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 .certificate_item_py3 import CertificateItem + + +class DeletedCertificateItem(CertificateItem): + """The deleted certificate item containing metadata about the deleted + certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Certificate identifier. + :type id: str + :param attributes: The certificate management attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param x509_thumbprint: Thumbprint of the certificate. + :type x509_thumbprint: bytes + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted certificate. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the certificate is scheduled to + be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the certificate was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint: bytes=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedCertificateItem, self).__init__(id=id, attributes=attributes, tags=tags, x509_thumbprint=x509_thumbprint, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_key_bundle.py b/azure-keyvault/azure/keyvault/models/deleted_key_bundle.py index 215e0b7d231d..4da00938813b 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_key_bundle.py +++ b/azure-keyvault/azure/keyvault/models/deleted_key_bundle.py @@ -54,8 +54,8 @@ class DeletedKeyBundle(KeyBundle): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, key=None, attributes=None, tags=None, recovery_id=None): - super(DeletedKeyBundle, self).__init__(key=key, attributes=attributes, tags=tags) - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedKeyBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_key_bundle_py3.py b/azure-keyvault/azure/keyvault/models/deleted_key_bundle_py3.py new file mode 100644 index 000000000000..f36d9a0028b1 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_key_bundle_py3.py @@ -0,0 +1,61 @@ +# 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 .key_bundle_py3 import KeyBundle + + +class DeletedKeyBundle(KeyBundle): + """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion + info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param key: The Json web key. + :type key: ~azure.keyvault.models.JsonWebKey + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted key. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the key is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the key was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'JsonWebKey'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, key=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedKeyBundle, self).__init__(key=key, attributes=attributes, tags=tags, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_key_item.py b/azure-keyvault/azure/keyvault/models/deleted_key_item.py index 0542c513baf8..a3ed56f9a99e 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_key_item.py +++ b/azure-keyvault/azure/keyvault/models/deleted_key_item.py @@ -54,8 +54,8 @@ class DeletedKeyItem(KeyItem): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, kid=None, attributes=None, tags=None, recovery_id=None): - super(DeletedKeyItem, self).__init__(kid=kid, attributes=attributes, tags=tags) - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedKeyItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_key_item_py3.py b/azure-keyvault/azure/keyvault/models/deleted_key_item_py3.py new file mode 100644 index 000000000000..f891deac56a0 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_key_item_py3.py @@ -0,0 +1,61 @@ +# 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 .key_item_py3 import KeyItem + + +class DeletedKeyItem(KeyItem): + """The deleted key item containing the deleted key metadata and information + about deletion. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kid: Key identifier. + :type kid: str + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted key. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the key is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the key was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, kid: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedKeyItem, self).__init__(kid=kid, attributes=attributes, tags=tags, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_sas_definition_bundle.py b/azure-keyvault/azure/keyvault/models/deleted_sas_definition_bundle.py index 6a3707f7d5c0..7400534281f5 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_sas_definition_bundle.py +++ b/azure-keyvault/azure/keyvault/models/deleted_sas_definition_bundle.py @@ -72,8 +72,8 @@ class DeletedSasDefinitionBundle(SasDefinitionBundle): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, recovery_id=None): - super(DeletedSasDefinitionBundle, self).__init__() - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedSasDefinitionBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_sas_definition_bundle_py3.py b/azure-keyvault/azure/keyvault/models/deleted_sas_definition_bundle_py3.py new file mode 100644 index 000000000000..ae5d90cd389a --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_sas_definition_bundle_py3.py @@ -0,0 +1,79 @@ +# 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 .sas_definition_bundle_py3 import SasDefinitionBundle + + +class DeletedSasDefinitionBundle(SasDefinitionBundle): + """A deleted SAS definition bundle consisting of its previous id, attributes + and its tags, as well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The SAS definition id. + :vartype id: str + :ivar secret_id: Storage account SAS definition secret id. + :vartype secret_id: str + :ivar template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will have + the same properties as the template. + :vartype template_uri: str + :ivar sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :vartype sas_type: str or ~azure.keyvault.models.SasTokenType + :ivar validity_period: The validity period of SAS tokens created according + to the SAS definition. + :vartype validity_period: str + :ivar attributes: The SAS definition attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted SAS definition. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the SAS definition is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the SAS definition was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'template_uri': {'readonly': True}, + 'sas_type': {'readonly': True}, + 'validity_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, recovery_id: str=None, **kwargs) -> None: + super(DeletedSasDefinitionBundle, self).__init__(**kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_sas_definition_item.py b/azure-keyvault/azure/keyvault/models/deleted_sas_definition_item.py index 754c376b3ec5..dd50187b3752 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_sas_definition_item.py +++ b/azure-keyvault/azure/keyvault/models/deleted_sas_definition_item.py @@ -56,8 +56,8 @@ class DeletedSasDefinitionItem(SasDefinitionItem): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, recovery_id=None): - super(DeletedSasDefinitionItem, self).__init__() - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedSasDefinitionItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_sas_definition_item_py3.py b/azure-keyvault/azure/keyvault/models/deleted_sas_definition_item_py3.py new file mode 100644 index 000000000000..9b689c4a7949 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_sas_definition_item_py3.py @@ -0,0 +1,63 @@ +# 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 .sas_definition_item_py3 import SasDefinitionItem + + +class DeletedSasDefinitionItem(SasDefinitionItem): + """The deleted SAS definition item containing metadata about the deleted SAS + definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage SAS identifier. + :vartype id: str + :ivar secret_id: The storage account SAS definition secret id. + :vartype secret_id: str + :ivar attributes: The SAS definition management attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted SAS definition. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the SAS definition is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the SAS definition was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, recovery_id: str=None, **kwargs) -> None: + super(DeletedSasDefinitionItem, self).__init__(**kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_secret_bundle.py b/azure-keyvault/azure/keyvault/models/deleted_secret_bundle.py index 2f85f5c01801..f88eb1fb02c2 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_secret_bundle.py +++ b/azure-keyvault/azure/keyvault/models/deleted_secret_bundle.py @@ -65,8 +65,8 @@ class DeletedSecretBundle(SecretBundle): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, value=None, id=None, content_type=None, attributes=None, tags=None, recovery_id=None): - super(DeletedSecretBundle, self).__init__(value=value, id=id, content_type=content_type, attributes=attributes, tags=tags) - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedSecretBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_secret_bundle_py3.py b/azure-keyvault/azure/keyvault/models/deleted_secret_bundle_py3.py new file mode 100644 index 000000000000..d6f4032cd614 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_secret_bundle_py3.py @@ -0,0 +1,72 @@ +# 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 .secret_bundle_py3 import SecretBundle + + +class DeletedSecretBundle(SecretBundle): + """A Deleted Secret consisting of its previous id, attributes and its tags, as + well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: The secret value. + :type value: str + :param id: The secret id. + :type id: str + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar kid: If this is a secret backing a KV certificate, then this field + specifies the corresponding key backing the KV certificate. + :vartype kid: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a secret backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted secret. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the secret is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the secret was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'kid': {'readonly': True}, + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, value: str=None, id: str=None, content_type: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedSecretBundle, self).__init__(value=value, id=id, content_type=content_type, attributes=attributes, tags=tags, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_secret_item.py b/azure-keyvault/azure/keyvault/models/deleted_secret_item.py index 68b59f59546e..6faa18b080df 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_secret_item.py +++ b/azure-keyvault/azure/keyvault/models/deleted_secret_item.py @@ -56,8 +56,8 @@ class DeletedSecretItem(SecretItem): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, id=None, attributes=None, tags=None, content_type=None, recovery_id=None): - super(DeletedSecretItem, self).__init__(id=id, attributes=attributes, tags=tags, content_type=content_type) - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedSecretItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_secret_item_py3.py b/azure-keyvault/azure/keyvault/models/deleted_secret_item_py3.py new file mode 100644 index 000000000000..45a05db4b63e --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_secret_item_py3.py @@ -0,0 +1,63 @@ +# 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 .secret_item_py3 import SecretItem + + +class DeletedSecretItem(SecretItem): + """The deleted secret item containing metadata about the deleted secret. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Secret identifier. + :type id: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a key backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted secret. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the secret is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the secret was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: str=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedSecretItem, self).__init__(id=id, attributes=attributes, tags=tags, content_type=content_type, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_storage_account_item.py b/azure-keyvault/azure/keyvault/models/deleted_storage_account_item.py index 52ec98c77aec..15d0f15bef06 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_storage_account_item.py +++ b/azure-keyvault/azure/keyvault/models/deleted_storage_account_item.py @@ -56,8 +56,8 @@ class DeletedStorageAccountItem(StorageAccountItem): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, recovery_id=None): - super(DeletedStorageAccountItem, self).__init__() - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedStorageAccountItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_storage_account_item_py3.py b/azure-keyvault/azure/keyvault/models/deleted_storage_account_item_py3.py new file mode 100644 index 000000000000..cc0ed4ab734d --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_storage_account_item_py3.py @@ -0,0 +1,63 @@ +# 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_account_item_py3 import StorageAccountItem + + +class DeletedStorageAccountItem(StorageAccountItem): + """The deleted storage account item containing metadata about the deleted + storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Storage identifier. + :vartype id: str + :ivar resource_id: Storage account resource Id. + :vartype resource_id: str + :ivar attributes: The storage account management attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted storage account. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the storage account is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the storage account was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, recovery_id: str=None, **kwargs) -> None: + super(DeletedStorageAccountItem, self).__init__(**kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_storage_bundle.py b/azure-keyvault/azure/keyvault/models/deleted_storage_bundle.py index aa3fe67ecb71..f9281dc9b3dd 100644 --- a/azure-keyvault/azure/keyvault/models/deleted_storage_bundle.py +++ b/azure-keyvault/azure/keyvault/models/deleted_storage_bundle.py @@ -70,8 +70,8 @@ class DeletedStorageBundle(StorageBundle): 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, } - def __init__(self, recovery_id=None): - super(DeletedStorageBundle, self).__init__() - self.recovery_id = recovery_id + def __init__(self, **kwargs): + super(DeletedStorageBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) self.scheduled_purge_date = None self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/deleted_storage_bundle_py3.py b/azure-keyvault/azure/keyvault/models/deleted_storage_bundle_py3.py new file mode 100644 index 000000000000..1e94dca3fc1d --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/deleted_storage_bundle_py3.py @@ -0,0 +1,77 @@ +# 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_bundle_py3 import StorageBundle + + +class DeletedStorageBundle(StorageBundle): + """A deleted storage account bundle consisting of its previous id, attributes + and its tags, as well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage account id. + :vartype id: str + :ivar resource_id: The storage account resource id. + :vartype resource_id: str + :ivar active_key_name: The current active storage account key name. + :vartype active_key_name: str + :ivar auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :vartype auto_regenerate_key: bool + :ivar regeneration_period: The key regeneration time duration specified in + ISO-8601 format. + :vartype regeneration_period: str + :ivar attributes: The storage account attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted storage account. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the storage account is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the storage account was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'active_key_name': {'readonly': True}, + 'auto_regenerate_key': {'readonly': True}, + 'regeneration_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, recovery_id: str=None, **kwargs) -> None: + super(DeletedStorageBundle, self).__init__(**kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/azure-keyvault/azure/keyvault/models/error.py b/azure-keyvault/azure/keyvault/models/error.py index 35c231305790..9dbe09fa48fc 100644 --- a/azure-keyvault/azure/keyvault/models/error.py +++ b/azure-keyvault/azure/keyvault/models/error.py @@ -38,8 +38,8 @@ class Error(Model): 'inner_error': {'key': 'innererror', 'type': 'Error'}, } - def __init__(self): - super(Error, self).__init__() + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) self.code = None self.message = None self.inner_error = None diff --git a/azure-keyvault/azure/keyvault/models/error_py3.py b/azure-keyvault/azure/keyvault/models/error_py3.py new file mode 100644 index 000000000000..660e077d36db --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/error_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Error(Model): + """The key vault server error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar inner_error: + :vartype inner_error: ~azure.keyvault.models.Error + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'inner_error': {'key': 'innererror', 'type': 'Error'}, + } + + def __init__(self, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = None + self.message = None + self.inner_error = None diff --git a/azure-keyvault/azure/keyvault/models/issuer_attributes.py b/azure-keyvault/azure/keyvault/models/issuer_attributes.py index bcc3fd0d2e2e..c10a16642899 100644 --- a/azure-keyvault/azure/keyvault/models/issuer_attributes.py +++ b/azure-keyvault/azure/keyvault/models/issuer_attributes.py @@ -37,8 +37,8 @@ class IssuerAttributes(Model): 'updated': {'key': 'updated', 'type': 'unix-time'}, } - def __init__(self, enabled=None): - super(IssuerAttributes, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(IssuerAttributes, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.created = None self.updated = None diff --git a/azure-keyvault/azure/keyvault/models/issuer_attributes_py3.py b/azure-keyvault/azure/keyvault/models/issuer_attributes_py3.py new file mode 100644 index 000000000000..d52ad4e0fc20 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/issuer_attributes_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class IssuerAttributes(Model): + """The attributes of an issuer managed by the Key Vault service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the issuer is enabled. + :type enabled: bool + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(IssuerAttributes, self).__init__(**kwargs) + self.enabled = enabled + self.created = None + self.updated = None diff --git a/azure-keyvault/azure/keyvault/models/issuer_bundle.py b/azure-keyvault/azure/keyvault/models/issuer_bundle.py index 4043d7ab89c2..778b64ada702 100644 --- a/azure-keyvault/azure/keyvault/models/issuer_bundle.py +++ b/azure-keyvault/azure/keyvault/models/issuer_bundle.py @@ -43,10 +43,10 @@ class IssuerBundle(Model): 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, } - def __init__(self, provider=None, credentials=None, organization_details=None, attributes=None): - super(IssuerBundle, self).__init__() + def __init__(self, **kwargs): + super(IssuerBundle, self).__init__(**kwargs) self.id = None - self.provider = provider - self.credentials = credentials - self.organization_details = organization_details - self.attributes = attributes + self.provider = kwargs.get('provider', None) + self.credentials = kwargs.get('credentials', None) + self.organization_details = kwargs.get('organization_details', None) + self.attributes = kwargs.get('attributes', None) diff --git a/azure-keyvault/azure/keyvault/models/issuer_bundle_py3.py b/azure-keyvault/azure/keyvault/models/issuer_bundle_py3.py new file mode 100644 index 000000000000..c8a3dc83178a --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/issuer_bundle_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class IssuerBundle(Model): + """The issuer for Key Vault certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Identifier for the issuer object. + :vartype id: str + :param provider: The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided to + the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, + 'organization_details': {'key': 'org_details', 'type': 'OrganizationDetails'}, + 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, + } + + def __init__(self, *, provider: str=None, credentials=None, organization_details=None, attributes=None, **kwargs) -> None: + super(IssuerBundle, self).__init__(**kwargs) + self.id = None + self.provider = provider + self.credentials = credentials + self.organization_details = organization_details + self.attributes = attributes diff --git a/azure-keyvault/azure/keyvault/models/issuer_credentials.py b/azure-keyvault/azure/keyvault/models/issuer_credentials.py index fdc0282c534d..2f86d863239d 100644 --- a/azure-keyvault/azure/keyvault/models/issuer_credentials.py +++ b/azure-keyvault/azure/keyvault/models/issuer_credentials.py @@ -26,7 +26,7 @@ class IssuerCredentials(Model): 'password': {'key': 'pwd', 'type': 'str'}, } - def __init__(self, account_id=None, password=None): - super(IssuerCredentials, self).__init__() - self.account_id = account_id - self.password = password + def __init__(self, **kwargs): + super(IssuerCredentials, self).__init__(**kwargs) + self.account_id = kwargs.get('account_id', None) + self.password = kwargs.get('password', None) diff --git a/azure-keyvault/azure/keyvault/models/issuer_credentials_py3.py b/azure-keyvault/azure/keyvault/models/issuer_credentials_py3.py new file mode 100644 index 000000000000..2882bad875d0 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/issuer_credentials_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class IssuerCredentials(Model): + """The credentials to be used for the certificate issuer. + + :param account_id: The user name/account name/account id. + :type account_id: str + :param password: The password/secret/account key. + :type password: str + """ + + _attribute_map = { + 'account_id': {'key': 'account_id', 'type': 'str'}, + 'password': {'key': 'pwd', 'type': 'str'}, + } + + def __init__(self, *, account_id: str=None, password: str=None, **kwargs) -> None: + super(IssuerCredentials, self).__init__(**kwargs) + self.account_id = account_id + self.password = password diff --git a/azure-keyvault/azure/keyvault/models/issuer_parameters.py b/azure-keyvault/azure/keyvault/models/issuer_parameters.py index 258124c9191c..36f15dae7887 100644 --- a/azure-keyvault/azure/keyvault/models/issuer_parameters.py +++ b/azure-keyvault/azure/keyvault/models/issuer_parameters.py @@ -21,14 +21,19 @@ class IssuerParameters(Model): :param certificate_type: Type of certificate to be requested from the issuer provider. :type certificate_type: str + :param certificate_transparency: Indicates if the certificates generated + under this policy should be published to certificate transparency logs. + :type certificate_transparency: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'certificate_type': {'key': 'cty', 'type': 'str'}, + 'certificate_transparency': {'key': 'cert_transparency', 'type': 'bool'}, } - def __init__(self, name=None, certificate_type=None): - super(IssuerParameters, self).__init__() - self.name = name - self.certificate_type = certificate_type + def __init__(self, **kwargs): + super(IssuerParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.certificate_type = kwargs.get('certificate_type', None) + self.certificate_transparency = kwargs.get('certificate_transparency', None) diff --git a/azure-keyvault/azure/keyvault/models/issuer_parameters_py3.py b/azure-keyvault/azure/keyvault/models/issuer_parameters_py3.py new file mode 100644 index 000000000000..b178321725fd --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/issuer_parameters_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class IssuerParameters(Model): + """Parameters for the issuer of the X509 component of a certificate. + + :param name: Name of the referenced issuer object or reserved names; for + example, 'Self' or 'Unknown'. + :type name: str + :param certificate_type: Type of certificate to be requested from the + issuer provider. + :type certificate_type: str + :param certificate_transparency: Indicates if the certificates generated + under this policy should be published to certificate transparency logs. + :type certificate_transparency: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'certificate_type': {'key': 'cty', 'type': 'str'}, + 'certificate_transparency': {'key': 'cert_transparency', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, certificate_type: str=None, certificate_transparency: bool=None, **kwargs) -> None: + super(IssuerParameters, self).__init__(**kwargs) + self.name = name + self.certificate_type = certificate_type + self.certificate_transparency = certificate_transparency diff --git a/azure-keyvault/azure/keyvault/models/json_web_key.py b/azure-keyvault/azure/keyvault/models/json_web_key.py index 881f20bf2cc0..033416b2b1d3 100644 --- a/azure-keyvault/azure/keyvault/models/json_web_key.py +++ b/azure-keyvault/azure/keyvault/models/json_web_key.py @@ -71,21 +71,21 @@ class JsonWebKey(Model): 'y': {'key': 'y', 'type': 'base64'}, } - def __init__(self, kid=None, kty=None, key_ops=None, n=None, e=None, d=None, dp=None, dq=None, qi=None, p=None, q=None, k=None, t=None, crv=None, x=None, y=None): - super(JsonWebKey, self).__init__() - self.kid = kid - self.kty = kty - self.key_ops = key_ops - self.n = n - self.e = e - self.d = d - self.dp = dp - self.dq = dq - self.qi = qi - self.p = p - self.q = q - self.k = k - self.t = t - self.crv = crv - self.x = x - self.y = y + def __init__(self, **kwargs): + super(JsonWebKey, self).__init__(**kwargs) + self.kid = kwargs.get('kid', None) + self.kty = kwargs.get('kty', None) + self.key_ops = kwargs.get('key_ops', None) + self.n = kwargs.get('n', None) + self.e = kwargs.get('e', None) + self.d = kwargs.get('d', None) + self.dp = kwargs.get('dp', None) + self.dq = kwargs.get('dq', None) + self.qi = kwargs.get('qi', None) + self.p = kwargs.get('p', None) + self.q = kwargs.get('q', None) + self.k = kwargs.get('k', None) + self.t = kwargs.get('t', None) + self.crv = kwargs.get('crv', None) + self.x = kwargs.get('x', None) + self.y = kwargs.get('y', None) diff --git a/azure-keyvault/azure/keyvault/models/json_web_key_py3.py b/azure-keyvault/azure/keyvault/models/json_web_key_py3.py new file mode 100644 index 000000000000..c5e1252f9783 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/json_web_key_py3.py @@ -0,0 +1,91 @@ +# 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 msrest.serialization import Model + + +class JsonWebKey(Model): + """As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18. + + :param kid: Key identifier. + :type kid: str + :param kty: JsonWebKey key type (kty). Possible values include: 'EC', + 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + :type kty: str or ~azure.keyvault.models.JsonWebKeyType + :param key_ops: + :type key_ops: list[str] + :param n: RSA modulus. + :type n: bytes + :param e: RSA public exponent. + :type e: bytes + :param d: RSA private exponent, or the D component of an EC private key. + :type d: bytes + :param dp: RSA private key parameter. + :type dp: bytes + :param dq: RSA private key parameter. + :type dq: bytes + :param qi: RSA private key parameter. + :type qi: bytes + :param p: RSA secret prime. + :type p: bytes + :param q: RSA secret prime, with p < q. + :type q: bytes + :param k: Symmetric key. + :type k: bytes + :param t: HSM Token, used with 'Bring Your Own Key'. + :type t: bytes + :param crv: Elliptic curve name. For valid values, see + JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + 'SECP256K1' + :type crv: str or ~azure.keyvault.models.JsonWebKeyCurveName + :param x: X component of an EC public key. + :type x: bytes + :param y: Y component of an EC public key. + :type y: bytes + """ + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'kty': {'key': 'kty', 'type': 'str'}, + 'key_ops': {'key': 'key_ops', 'type': '[str]'}, + 'n': {'key': 'n', 'type': 'base64'}, + 'e': {'key': 'e', 'type': 'base64'}, + 'd': {'key': 'd', 'type': 'base64'}, + 'dp': {'key': 'dp', 'type': 'base64'}, + 'dq': {'key': 'dq', 'type': 'base64'}, + 'qi': {'key': 'qi', 'type': 'base64'}, + 'p': {'key': 'p', 'type': 'base64'}, + 'q': {'key': 'q', 'type': 'base64'}, + 'k': {'key': 'k', 'type': 'base64'}, + 't': {'key': 'key_hsm', 'type': 'base64'}, + 'crv': {'key': 'crv', 'type': 'str'}, + 'x': {'key': 'x', 'type': 'base64'}, + 'y': {'key': 'y', 'type': 'base64'}, + } + + def __init__(self, *, kid: str=None, kty=None, key_ops=None, n: bytes=None, e: bytes=None, d: bytes=None, dp: bytes=None, dq: bytes=None, qi: bytes=None, p: bytes=None, q: bytes=None, k: bytes=None, t: bytes=None, crv=None, x: bytes=None, y: bytes=None, **kwargs) -> None: + super(JsonWebKey, self).__init__(**kwargs) + self.kid = kid + self.kty = kty + self.key_ops = key_ops + self.n = n + self.e = e + self.d = d + self.dp = dp + self.dq = dq + self.qi = qi + self.p = p + self.q = q + self.k = k + self.t = t + self.crv = crv + self.x = x + self.y = y diff --git a/azure-keyvault/azure/keyvault/models/key_attributes.py b/azure-keyvault/azure/keyvault/models/key_attributes.py index 2e0e98ac6e36..d1fb33f64a64 100644 --- a/azure-keyvault/azure/keyvault/models/key_attributes.py +++ b/azure-keyvault/azure/keyvault/models/key_attributes.py @@ -53,6 +53,6 @@ class KeyAttributes(Attributes): 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, } - def __init__(self, enabled=None, not_before=None, expires=None): - super(KeyAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires) + def __init__(self, **kwargs): + super(KeyAttributes, self).__init__(**kwargs) self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/key_attributes_py3.py b/azure-keyvault/azure/keyvault/models/key_attributes_py3.py new file mode 100644 index 000000000000..ee606fe0f5f4 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_attributes_py3.py @@ -0,0 +1,58 @@ +# 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 .attributes_py3 import Attributes + + +class KeyAttributes(Attributes): + """The attributes of a key managed by the key vault service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for keys in the current vault. If it contains 'Purgeable' the key + can be permanently deleted by a privileged user; otherwise, only the + system can purge the key, at the end of the retention interval. Possible + values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None: + super(KeyAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs) + self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/key_bundle.py b/azure-keyvault/azure/keyvault/models/key_bundle.py index 4c81811f3fd3..0dd494c6de1d 100644 --- a/azure-keyvault/azure/keyvault/models/key_bundle.py +++ b/azure-keyvault/azure/keyvault/models/key_bundle.py @@ -40,9 +40,9 @@ class KeyBundle(Model): 'managed': {'key': 'managed', 'type': 'bool'}, } - def __init__(self, key=None, attributes=None, tags=None): - super(KeyBundle, self).__init__() - self.key = key - self.attributes = attributes - self.tags = tags + def __init__(self, **kwargs): + super(KeyBundle, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) self.managed = None diff --git a/azure-keyvault/azure/keyvault/models/key_bundle_py3.py b/azure-keyvault/azure/keyvault/models/key_bundle_py3.py new file mode 100644 index 000000000000..53e3abc61095 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_bundle_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class KeyBundle(Model): + """A KeyBundle consisting of a WebKey plus its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param key: The Json web key. + :type key: ~azure.keyvault.models.JsonWebKey + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'JsonWebKey'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, *, key=None, attributes=None, tags=None, **kwargs) -> None: + super(KeyBundle, self).__init__(**kwargs) + self.key = key + self.attributes = attributes + self.tags = tags + self.managed = None diff --git a/azure-keyvault/azure/keyvault/models/key_create_parameters.py b/azure-keyvault/azure/keyvault/models/key_create_parameters.py index 0cf298d86ced..463cad9d73dd 100644 --- a/azure-keyvault/azure/keyvault/models/key_create_parameters.py +++ b/azure-keyvault/azure/keyvault/models/key_create_parameters.py @@ -15,11 +15,13 @@ class KeyCreateParameters(Model): """The key create parameters. - :param kty: The type of key to create. For valid values, see + All required parameters must be populated in order to send to Azure. + + :param kty: Required. The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' :type kty: str or ~azure.keyvault.models.JsonWebKeyType - :param key_size: The key size in bytes. For example, 1024 or 2048. + :param key_size: The key size in bits. For example, 1024 or 2048. :type key_size: int :param key_ops: :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] @@ -46,11 +48,11 @@ class KeyCreateParameters(Model): 'curve': {'key': 'crv', 'type': 'str'}, } - def __init__(self, kty, key_size=None, key_ops=None, key_attributes=None, tags=None, curve=None): - super(KeyCreateParameters, self).__init__() - self.kty = kty - self.key_size = key_size - self.key_ops = key_ops - self.key_attributes = key_attributes - self.tags = tags - self.curve = curve + def __init__(self, **kwargs): + super(KeyCreateParameters, self).__init__(**kwargs) + self.kty = kwargs.get('kty', None) + self.key_size = kwargs.get('key_size', None) + self.key_ops = kwargs.get('key_ops', None) + self.key_attributes = kwargs.get('key_attributes', None) + self.tags = kwargs.get('tags', None) + self.curve = kwargs.get('curve', None) diff --git a/azure-keyvault/azure/keyvault/models/key_create_parameters_py3.py b/azure-keyvault/azure/keyvault/models/key_create_parameters_py3.py new file mode 100644 index 000000000000..7c9ba2dfc85e --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_create_parameters_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class KeyCreateParameters(Model): + """The key create parameters. + + All required parameters must be populated in order to send to Azure. + + :param kty: Required. The type of key to create. For valid values, see + JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + 'oct' + :type kty: str or ~azure.keyvault.models.JsonWebKeyType + :param key_size: The key size in bits. For example, 1024 or 2048. + :type key_size: int + :param key_ops: + :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] + :param key_attributes: + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param curve: Elliptic curve name. For valid values, see + JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + 'SECP256K1' + :type curve: str or ~azure.keyvault.models.JsonWebKeyCurveName + """ + + _validation = { + 'kty': {'required': True, 'min_length': 1}, + } + + _attribute_map = { + 'kty': {'key': 'kty', 'type': 'str'}, + 'key_size': {'key': 'key_size', 'type': 'int'}, + 'key_ops': {'key': 'key_ops', 'type': '[str]'}, + 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'curve': {'key': 'crv', 'type': 'str'}, + } + + def __init__(self, *, kty, key_size: int=None, key_ops=None, key_attributes=None, tags=None, curve=None, **kwargs) -> None: + super(KeyCreateParameters, self).__init__(**kwargs) + self.kty = kty + self.key_size = key_size + self.key_ops = key_ops + self.key_attributes = key_attributes + self.tags = tags + self.curve = curve diff --git a/azure-keyvault/azure/keyvault/models/key_import_parameters.py b/azure-keyvault/azure/keyvault/models/key_import_parameters.py index 804bbcf5f629..f309aad29ea8 100644 --- a/azure-keyvault/azure/keyvault/models/key_import_parameters.py +++ b/azure-keyvault/azure/keyvault/models/key_import_parameters.py @@ -15,9 +15,11 @@ class KeyImportParameters(Model): """The key import parameters. + All required parameters must be populated in order to send to Azure. + :param hsm: Whether to import as a hardware key (HSM) or software key. :type hsm: bool - :param key: The Json web key + :param key: Required. The Json web key :type key: ~azure.keyvault.models.JsonWebKey :param key_attributes: The key management attributes. :type key_attributes: ~azure.keyvault.models.KeyAttributes @@ -36,9 +38,9 @@ class KeyImportParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, key, hsm=None, key_attributes=None, tags=None): - super(KeyImportParameters, self).__init__() - self.hsm = hsm - self.key = key - self.key_attributes = key_attributes - self.tags = tags + def __init__(self, **kwargs): + super(KeyImportParameters, self).__init__(**kwargs) + self.hsm = kwargs.get('hsm', None) + self.key = kwargs.get('key', None) + self.key_attributes = kwargs.get('key_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/key_import_parameters_py3.py b/azure-keyvault/azure/keyvault/models/key_import_parameters_py3.py new file mode 100644 index 000000000000..6808d2290484 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_import_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class KeyImportParameters(Model): + """The key import parameters. + + All required parameters must be populated in order to send to Azure. + + :param hsm: Whether to import as a hardware key (HSM) or software key. + :type hsm: bool + :param key: Required. The Json web key + :type key: ~azure.keyvault.models.JsonWebKey + :param key_attributes: The key management attributes. + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'key': {'required': True}, + } + + _attribute_map = { + 'hsm': {'key': 'Hsm', 'type': 'bool'}, + 'key': {'key': 'key', 'type': 'JsonWebKey'}, + 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, key, hsm: bool=None, key_attributes=None, tags=None, **kwargs) -> None: + super(KeyImportParameters, self).__init__(**kwargs) + self.hsm = hsm + self.key = key + self.key_attributes = key_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/key_item.py b/azure-keyvault/azure/keyvault/models/key_item.py index d6a5bd35dc49..6a4697b9a54d 100644 --- a/azure-keyvault/azure/keyvault/models/key_item.py +++ b/azure-keyvault/azure/keyvault/models/key_item.py @@ -40,9 +40,9 @@ class KeyItem(Model): 'managed': {'key': 'managed', 'type': 'bool'}, } - def __init__(self, kid=None, attributes=None, tags=None): - super(KeyItem, self).__init__() - self.kid = kid - self.attributes = attributes - self.tags = tags + def __init__(self, **kwargs): + super(KeyItem, self).__init__(**kwargs) + self.kid = kwargs.get('kid', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) self.managed = None diff --git a/azure-keyvault/azure/keyvault/models/key_item_py3.py b/azure-keyvault/azure/keyvault/models/key_item_py3.py new file mode 100644 index 000000000000..cc00bce8ee47 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_item_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class KeyItem(Model): + """The key item containing key metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kid: Key identifier. + :type kid: str + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, *, kid: str=None, attributes=None, tags=None, **kwargs) -> None: + super(KeyItem, self).__init__(**kwargs) + self.kid = kid + self.attributes = attributes + self.tags = tags + self.managed = None diff --git a/azure-keyvault/azure/keyvault/models/key_operation_result.py b/azure-keyvault/azure/keyvault/models/key_operation_result.py index d63166298177..577326dcf54c 100644 --- a/azure-keyvault/azure/keyvault/models/key_operation_result.py +++ b/azure-keyvault/azure/keyvault/models/key_operation_result.py @@ -34,7 +34,7 @@ class KeyOperationResult(Model): 'result': {'key': 'value', 'type': 'base64'}, } - def __init__(self): - super(KeyOperationResult, self).__init__() + def __init__(self, **kwargs): + super(KeyOperationResult, self).__init__(**kwargs) self.kid = None self.result = None diff --git a/azure-keyvault/azure/keyvault/models/key_operation_result_py3.py b/azure-keyvault/azure/keyvault/models/key_operation_result_py3.py new file mode 100644 index 000000000000..82cd8de63331 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_operation_result_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class KeyOperationResult(Model): + """The key operation result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar kid: Key identifier + :vartype kid: str + :ivar result: + :vartype result: bytes + """ + + _validation = { + 'kid': {'readonly': True}, + 'result': {'readonly': True}, + } + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'result': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyOperationResult, self).__init__(**kwargs) + self.kid = None + self.result = None diff --git a/azure-keyvault/azure/keyvault/models/key_operations_parameters.py b/azure-keyvault/azure/keyvault/models/key_operations_parameters.py index 6b50e0512336..76c19c93e69c 100644 --- a/azure-keyvault/azure/keyvault/models/key_operations_parameters.py +++ b/azure-keyvault/azure/keyvault/models/key_operations_parameters.py @@ -15,11 +15,13 @@ class KeyOperationsParameters(Model): """The key operations parameters. - :param algorithm: algorithm identifier. Possible values include: + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' :type algorithm: str or ~azure.keyvault.models.JsonWebKeyEncryptionAlgorithm - :param value: + :param value: Required. :type value: bytes """ @@ -33,7 +35,7 @@ class KeyOperationsParameters(Model): 'value': {'key': 'value', 'type': 'base64'}, } - def __init__(self, algorithm, value): - super(KeyOperationsParameters, self).__init__() - self.algorithm = algorithm - self.value = value + def __init__(self, **kwargs): + super(KeyOperationsParameters, self).__init__(**kwargs) + self.algorithm = kwargs.get('algorithm', None) + self.value = kwargs.get('value', None) diff --git a/azure-keyvault/azure/keyvault/models/key_operations_parameters_py3.py b/azure-keyvault/azure/keyvault/models/key_operations_parameters_py3.py new file mode 100644 index 000000000000..95908ea94bf7 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_operations_parameters_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class KeyOperationsParameters(Model): + """The key operations parameters. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. algorithm identifier. Possible values include: + 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeyEncryptionAlgorithm + :param value: Required. + :type value: bytes + """ + + _validation = { + 'algorithm': {'required': True, 'min_length': 1}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'alg', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, algorithm, value: bytes, **kwargs) -> None: + super(KeyOperationsParameters, self).__init__(**kwargs) + self.algorithm = algorithm + self.value = value diff --git a/azure-keyvault/azure/keyvault/models/key_properties.py b/azure-keyvault/azure/keyvault/models/key_properties.py index e3721bb2162e..2dcf4684674b 100644 --- a/azure-keyvault/azure/keyvault/models/key_properties.py +++ b/azure-keyvault/azure/keyvault/models/key_properties.py @@ -19,7 +19,7 @@ class KeyProperties(Model): :type exportable: bool :param key_type: The key type. :type key_type: str - :param key_size: The key size in bytes. For example; 1024 or 2048. + :param key_size: The key size in bits. For example; 1024 or 2048. :type key_size: int :param reuse_key: Indicates if the same key pair will be used on certificate renewal. @@ -33,9 +33,9 @@ class KeyProperties(Model): 'reuse_key': {'key': 'reuse_key', 'type': 'bool'}, } - def __init__(self, exportable=None, key_type=None, key_size=None, reuse_key=None): - super(KeyProperties, self).__init__() - self.exportable = exportable - self.key_type = key_type - self.key_size = key_size - self.reuse_key = reuse_key + def __init__(self, **kwargs): + super(KeyProperties, self).__init__(**kwargs) + self.exportable = kwargs.get('exportable', None) + self.key_type = kwargs.get('key_type', None) + self.key_size = kwargs.get('key_size', None) + self.reuse_key = kwargs.get('reuse_key', None) diff --git a/azure-keyvault/azure/keyvault/models/key_properties_py3.py b/azure-keyvault/azure/keyvault/models/key_properties_py3.py new file mode 100644 index 000000000000..1d8e1a89edd2 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_properties_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class KeyProperties(Model): + """Properties of the key pair backing a certificate. + + :param exportable: Indicates if the private key can be exported. + :type exportable: bool + :param key_type: The key type. + :type key_type: str + :param key_size: The key size in bits. For example; 1024 or 2048. + :type key_size: int + :param reuse_key: Indicates if the same key pair will be used on + certificate renewal. + :type reuse_key: bool + """ + + _attribute_map = { + 'exportable': {'key': 'exportable', 'type': 'bool'}, + 'key_type': {'key': 'kty', 'type': 'str'}, + 'key_size': {'key': 'key_size', 'type': 'int'}, + 'reuse_key': {'key': 'reuse_key', 'type': 'bool'}, + } + + def __init__(self, *, exportable: bool=None, key_type: str=None, key_size: int=None, reuse_key: bool=None, **kwargs) -> None: + super(KeyProperties, self).__init__(**kwargs) + self.exportable = exportable + self.key_type = key_type + self.key_size = key_size + self.reuse_key = reuse_key diff --git a/azure-keyvault/azure/keyvault/models/key_restore_parameters.py b/azure-keyvault/azure/keyvault/models/key_restore_parameters.py index 934235cc9db9..7594a7af2833 100644 --- a/azure-keyvault/azure/keyvault/models/key_restore_parameters.py +++ b/azure-keyvault/azure/keyvault/models/key_restore_parameters.py @@ -15,7 +15,10 @@ class KeyRestoreParameters(Model): """The key restore parameters. - :param key_bundle_backup: The backup blob associated with a key bundle. + All required parameters must be populated in order to send to Azure. + + :param key_bundle_backup: Required. The backup blob associated with a key + bundle. :type key_bundle_backup: bytes """ @@ -27,6 +30,6 @@ class KeyRestoreParameters(Model): 'key_bundle_backup': {'key': 'value', 'type': 'base64'}, } - def __init__(self, key_bundle_backup): - super(KeyRestoreParameters, self).__init__() - self.key_bundle_backup = key_bundle_backup + def __init__(self, **kwargs): + super(KeyRestoreParameters, self).__init__(**kwargs) + self.key_bundle_backup = kwargs.get('key_bundle_backup', None) diff --git a/azure-keyvault/azure/keyvault/models/key_restore_parameters_py3.py b/azure-keyvault/azure/keyvault/models/key_restore_parameters_py3.py new file mode 100644 index 000000000000..cf74e5904178 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_restore_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class KeyRestoreParameters(Model): + """The key restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param key_bundle_backup: Required. The backup blob associated with a key + bundle. + :type key_bundle_backup: bytes + """ + + _validation = { + 'key_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'key_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, key_bundle_backup: bytes, **kwargs) -> None: + super(KeyRestoreParameters, self).__init__(**kwargs) + self.key_bundle_backup = key_bundle_backup diff --git a/azure-keyvault/azure/keyvault/models/key_sign_parameters.py b/azure-keyvault/azure/keyvault/models/key_sign_parameters.py index 5ae6ef0c5b95..2bb4c401dd10 100644 --- a/azure-keyvault/azure/keyvault/models/key_sign_parameters.py +++ b/azure-keyvault/azure/keyvault/models/key_sign_parameters.py @@ -15,13 +15,16 @@ class KeySignParameters(Model): """The key operations parameters. - :param algorithm: The signing/verification algorithm identifier. For more - information on possible algorithm types, see JsonWebKeySignatureAlgorithm. - Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', - 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. The signing/verification algorithm identifier. + For more information on possible algorithm types, see + JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + 'ECDSA256' :type algorithm: str or ~azure.keyvault.models.JsonWebKeySignatureAlgorithm - :param value: + :param value: Required. :type value: bytes """ @@ -35,7 +38,7 @@ class KeySignParameters(Model): 'value': {'key': 'value', 'type': 'base64'}, } - def __init__(self, algorithm, value): - super(KeySignParameters, self).__init__() - self.algorithm = algorithm - self.value = value + def __init__(self, **kwargs): + super(KeySignParameters, self).__init__(**kwargs) + self.algorithm = kwargs.get('algorithm', None) + self.value = kwargs.get('value', None) diff --git a/azure-keyvault/azure/keyvault/models/key_sign_parameters_py3.py b/azure-keyvault/azure/keyvault/models/key_sign_parameters_py3.py new file mode 100644 index 000000000000..9287a24a6d09 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_sign_parameters_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class KeySignParameters(Model): + """The key operations parameters. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. The signing/verification algorithm identifier. + For more information on possible algorithm types, see + JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + 'ECDSA256' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeySignatureAlgorithm + :param value: Required. + :type value: bytes + """ + + _validation = { + 'algorithm': {'required': True, 'min_length': 1}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'alg', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, algorithm, value: bytes, **kwargs) -> None: + super(KeySignParameters, self).__init__(**kwargs) + self.algorithm = algorithm + self.value = value diff --git a/azure-keyvault/azure/keyvault/models/key_update_parameters.py b/azure-keyvault/azure/keyvault/models/key_update_parameters.py index f4bbcebff988..976411447e50 100644 --- a/azure-keyvault/azure/keyvault/models/key_update_parameters.py +++ b/azure-keyvault/azure/keyvault/models/key_update_parameters.py @@ -30,8 +30,8 @@ class KeyUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, key_ops=None, key_attributes=None, tags=None): - super(KeyUpdateParameters, self).__init__() - self.key_ops = key_ops - self.key_attributes = key_attributes - self.tags = tags + def __init__(self, **kwargs): + super(KeyUpdateParameters, self).__init__(**kwargs) + self.key_ops = kwargs.get('key_ops', None) + self.key_attributes = kwargs.get('key_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/key_update_parameters_py3.py b/azure-keyvault/azure/keyvault/models/key_update_parameters_py3.py new file mode 100644 index 000000000000..0a6f96024f97 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_update_parameters_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class KeyUpdateParameters(Model): + """The key update parameters. + + :param key_ops: Json web key operations. For more information on possible + key operations, see JsonWebKeyOperation. + :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] + :param key_attributes: + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'key_ops': {'key': 'key_ops', 'type': '[str]'}, + 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, key_ops=None, key_attributes=None, tags=None, **kwargs) -> None: + super(KeyUpdateParameters, self).__init__(**kwargs) + self.key_ops = key_ops + self.key_attributes = key_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/key_vault_client_enums.py b/azure-keyvault/azure/keyvault/models/key_vault_client_enums.py index 7eae18700aac..2c2dd32621be 100644 --- a/azure-keyvault/azure/keyvault/models/key_vault_client_enums.py +++ b/azure-keyvault/azure/keyvault/models/key_vault_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class JsonWebKeyType(Enum): +class JsonWebKeyType(str, Enum): ec = "EC" ec_hsm = "EC-HSM" @@ -21,7 +21,7 @@ class JsonWebKeyType(Enum): oct = "oct" -class JsonWebKeyCurveName(Enum): +class JsonWebKeyCurveName(str, Enum): p_256 = "P-256" p_384 = "P-384" @@ -29,7 +29,7 @@ class JsonWebKeyCurveName(Enum): secp256_k1 = "SECP256K1" -class DeletionRecoveryLevel(Enum): +class DeletionRecoveryLevel(str, Enum): purgeable = "Purgeable" recoverable_purgeable = "Recoverable+Purgeable" @@ -37,7 +37,7 @@ class DeletionRecoveryLevel(Enum): recoverable_protected_subscription = "Recoverable+ProtectedSubscription" -class KeyUsageType(Enum): +class KeyUsageType(str, Enum): digital_signature = "digitalSignature" non_repudiation = "nonRepudiation" @@ -50,13 +50,13 @@ class KeyUsageType(Enum): decipher_only = "decipherOnly" -class ActionType(Enum): +class ActionType(str, Enum): email_contacts = "EmailContacts" auto_renew = "AutoRenew" -class JsonWebKeyOperation(Enum): +class JsonWebKeyOperation(str, Enum): encrypt = "encrypt" decrypt = "decrypt" @@ -66,14 +66,14 @@ class JsonWebKeyOperation(Enum): unwrap_key = "unwrapKey" -class JsonWebKeyEncryptionAlgorithm(Enum): +class JsonWebKeyEncryptionAlgorithm(str, Enum): rsa_oaep = "RSA-OAEP" rsa_oaep_256 = "RSA-OAEP-256" rsa1_5 = "RSA1_5" -class JsonWebKeySignatureAlgorithm(Enum): +class JsonWebKeySignatureAlgorithm(str, Enum): ps256 = "PS256" ps384 = "PS384" @@ -88,7 +88,7 @@ class JsonWebKeySignatureAlgorithm(Enum): ecdsa256 = "ECDSA256" -class SasTokenType(Enum): +class SasTokenType(str, Enum): account = "account" service = "service" diff --git a/azure-keyvault/azure/keyvault/models/key_vault_error.py b/azure-keyvault/azure/keyvault/models/key_vault_error.py index df445a39f4b5..91500f293c84 100644 --- a/azure-keyvault/azure/keyvault/models/key_vault_error.py +++ b/azure-keyvault/azure/keyvault/models/key_vault_error.py @@ -31,8 +31,8 @@ class KeyVaultError(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self): - super(KeyVaultError, self).__init__() + def __init__(self, **kwargs): + super(KeyVaultError, self).__init__(**kwargs) self.error = None diff --git a/azure-keyvault/azure/keyvault/models/key_vault_error_py3.py b/azure-keyvault/azure/keyvault/models/key_vault_error_py3.py new file mode 100644 index 000000000000..288f1d24494c --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_vault_error_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class KeyVaultError(Model): + """The key vault error exception. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: + :vartype error: ~azure.keyvault.models.Error + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyVaultError, self).__init__(**kwargs) + self.error = None + + +class KeyVaultErrorException(HttpOperationError): + """Server responsed with exception of type: 'KeyVaultError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(KeyVaultErrorException, self).__init__(deserialize, response, 'KeyVaultError', *args) diff --git a/azure-keyvault/azure/keyvault/models/key_verify_parameters.py b/azure-keyvault/azure/keyvault/models/key_verify_parameters.py index 5f9d2b4b95e4..524c6be9f9cb 100644 --- a/azure-keyvault/azure/keyvault/models/key_verify_parameters.py +++ b/azure-keyvault/azure/keyvault/models/key_verify_parameters.py @@ -15,15 +15,17 @@ class KeyVerifyParameters(Model): """The key verify parameters. - :param algorithm: The signing/verification algorithm. For more information - on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible - values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', - 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. The signing/verification algorithm. For more + information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' :type algorithm: str or ~azure.keyvault.models.JsonWebKeySignatureAlgorithm - :param digest: The digest used for signing. + :param digest: Required. The digest used for signing. :type digest: bytes - :param signature: The signature to be verified. + :param signature: Required. The signature to be verified. :type signature: bytes """ @@ -39,8 +41,8 @@ class KeyVerifyParameters(Model): 'signature': {'key': 'value', 'type': 'base64'}, } - def __init__(self, algorithm, digest, signature): - super(KeyVerifyParameters, self).__init__() - self.algorithm = algorithm - self.digest = digest - self.signature = signature + def __init__(self, **kwargs): + super(KeyVerifyParameters, self).__init__(**kwargs) + self.algorithm = kwargs.get('algorithm', None) + self.digest = kwargs.get('digest', None) + self.signature = kwargs.get('signature', None) diff --git a/azure-keyvault/azure/keyvault/models/key_verify_parameters_py3.py b/azure-keyvault/azure/keyvault/models/key_verify_parameters_py3.py new file mode 100644 index 000000000000..c5dd9819f053 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_verify_parameters_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class KeyVerifyParameters(Model): + """The key verify parameters. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. The signing/verification algorithm. For more + information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeySignatureAlgorithm + :param digest: Required. The digest used for signing. + :type digest: bytes + :param signature: Required. The signature to be verified. + :type signature: bytes + """ + + _validation = { + 'algorithm': {'required': True, 'min_length': 1}, + 'digest': {'required': True}, + 'signature': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'alg', 'type': 'str'}, + 'digest': {'key': 'digest', 'type': 'base64'}, + 'signature': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, algorithm, digest: bytes, signature: bytes, **kwargs) -> None: + super(KeyVerifyParameters, self).__init__(**kwargs) + self.algorithm = algorithm + self.digest = digest + self.signature = signature diff --git a/azure-keyvault/azure/keyvault/models/key_verify_result.py b/azure-keyvault/azure/keyvault/models/key_verify_result.py index 57afe6324211..baffb85589cc 100644 --- a/azure-keyvault/azure/keyvault/models/key_verify_result.py +++ b/azure-keyvault/azure/keyvault/models/key_verify_result.py @@ -30,6 +30,6 @@ class KeyVerifyResult(Model): 'value': {'key': 'value', 'type': 'bool'}, } - def __init__(self): - super(KeyVerifyResult, self).__init__() + def __init__(self, **kwargs): + super(KeyVerifyResult, self).__init__(**kwargs) self.value = None diff --git a/azure-keyvault/azure/keyvault/models/key_verify_result_py3.py b/azure-keyvault/azure/keyvault/models/key_verify_result_py3.py new file mode 100644 index 000000000000..33a7a7ebaefa --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/key_verify_result_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class KeyVerifyResult(Model): + """The key verify result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: True if the signature is verified, otherwise false. + :vartype value: bool + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyVerifyResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-keyvault/azure/keyvault/models/lifetime_action.py b/azure-keyvault/azure/keyvault/models/lifetime_action.py index dd2a895d6ab0..c7470e260f30 100644 --- a/azure-keyvault/azure/keyvault/models/lifetime_action.py +++ b/azure-keyvault/azure/keyvault/models/lifetime_action.py @@ -27,7 +27,7 @@ class LifetimeAction(Model): 'action': {'key': 'action', 'type': 'Action'}, } - def __init__(self, trigger=None, action=None): - super(LifetimeAction, self).__init__() - self.trigger = trigger - self.action = action + def __init__(self, **kwargs): + super(LifetimeAction, self).__init__(**kwargs) + self.trigger = kwargs.get('trigger', None) + self.action = kwargs.get('action', None) diff --git a/azure-keyvault/azure/keyvault/models/lifetime_action_py3.py b/azure-keyvault/azure/keyvault/models/lifetime_action_py3.py new file mode 100644 index 000000000000..a63470077a56 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/lifetime_action_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class LifetimeAction(Model): + """Action and its trigger that will be performed by Key Vault over the + lifetime of a certificate. + + :param trigger: The condition that will execute the action. + :type trigger: ~azure.keyvault.models.Trigger + :param action: The action that will be executed. + :type action: ~azure.keyvault.models.Action + """ + + _attribute_map = { + 'trigger': {'key': 'trigger', 'type': 'Trigger'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, trigger=None, action=None, **kwargs) -> None: + super(LifetimeAction, self).__init__(**kwargs) + self.trigger = trigger + self.action = action diff --git a/azure-keyvault/azure/keyvault/models/organization_details.py b/azure-keyvault/azure/keyvault/models/organization_details.py index 93c739d31afe..c9275d5e9727 100644 --- a/azure-keyvault/azure/keyvault/models/organization_details.py +++ b/azure-keyvault/azure/keyvault/models/organization_details.py @@ -26,7 +26,7 @@ class OrganizationDetails(Model): 'admin_details': {'key': 'admin_details', 'type': '[AdministratorDetails]'}, } - def __init__(self, id=None, admin_details=None): - super(OrganizationDetails, self).__init__() - self.id = id - self.admin_details = admin_details + def __init__(self, **kwargs): + super(OrganizationDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.admin_details = kwargs.get('admin_details', None) diff --git a/azure-keyvault/azure/keyvault/models/organization_details_py3.py b/azure-keyvault/azure/keyvault/models/organization_details_py3.py new file mode 100644 index 000000000000..46772a5c718d --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/organization_details_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class OrganizationDetails(Model): + """Details of the organization of the certificate issuer. + + :param id: Id of the organization. + :type id: str + :param admin_details: Details of the organization administrator. + :type admin_details: list[~azure.keyvault.models.AdministratorDetails] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'admin_details': {'key': 'admin_details', 'type': '[AdministratorDetails]'}, + } + + def __init__(self, *, id: str=None, admin_details=None, **kwargs) -> None: + super(OrganizationDetails, self).__init__(**kwargs) + self.id = id + self.admin_details = admin_details diff --git a/azure-keyvault/azure/keyvault/models/pending_certificate_signing_request_result.py b/azure-keyvault/azure/keyvault/models/pending_certificate_signing_request_result.py index 4a797469c17a..2bea9bfcdd61 100644 --- a/azure-keyvault/azure/keyvault/models/pending_certificate_signing_request_result.py +++ b/azure-keyvault/azure/keyvault/models/pending_certificate_signing_request_result.py @@ -31,6 +31,6 @@ class PendingCertificateSigningRequestResult(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(PendingCertificateSigningRequestResult, self).__init__() + def __init__(self, **kwargs): + super(PendingCertificateSigningRequestResult, self).__init__(**kwargs) self.value = None diff --git a/azure-keyvault/azure/keyvault/models/pending_certificate_signing_request_result_py3.py b/azure-keyvault/azure/keyvault/models/pending_certificate_signing_request_result_py3.py new file mode 100644 index 000000000000..2895d5a77a03 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/pending_certificate_signing_request_result_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class PendingCertificateSigningRequestResult(Model): + """The pending certificate signing request result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The pending certificate signing request as Base64 encoded + string. + :vartype value: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PendingCertificateSigningRequestResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_attributes.py b/azure-keyvault/azure/keyvault/models/sas_definition_attributes.py index 5f1a07235068..6e7b1edb21c0 100644 --- a/azure-keyvault/azure/keyvault/models/sas_definition_attributes.py +++ b/azure-keyvault/azure/keyvault/models/sas_definition_attributes.py @@ -48,9 +48,9 @@ class SasDefinitionAttributes(Model): 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, } - def __init__(self, enabled=None): - super(SasDefinitionAttributes, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(SasDefinitionAttributes, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.created = None self.updated = None self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_attributes_py3.py b/azure-keyvault/azure/keyvault/models/sas_definition_attributes_py3.py new file mode 100644 index 000000000000..09880b269d0c --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/sas_definition_attributes_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class SasDefinitionAttributes(Model): + """The SAS definition management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: the enabled state of the object. + :type enabled: bool + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for SAS definitions in the current vault. If it contains + 'Purgeable' the SAS definition can be permanently deleted by a privileged + user; otherwise, only the system can purge the SAS definition, at the end + of the retention interval. Possible values include: 'Purgeable', + 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(SasDefinitionAttributes, self).__init__(**kwargs) + self.enabled = enabled + self.created = None + self.updated = None + self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_bundle.py b/azure-keyvault/azure/keyvault/models/sas_definition_bundle.py index 6040e2b3ac46..0d346a2dc449 100644 --- a/azure-keyvault/azure/keyvault/models/sas_definition_bundle.py +++ b/azure-keyvault/azure/keyvault/models/sas_definition_bundle.py @@ -59,8 +59,8 @@ class SasDefinitionBundle(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self): - super(SasDefinitionBundle, self).__init__() + def __init__(self, **kwargs): + super(SasDefinitionBundle, self).__init__(**kwargs) self.id = None self.secret_id = None self.template_uri = None diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_bundle_py3.py b/azure-keyvault/azure/keyvault/models/sas_definition_bundle_py3.py new file mode 100644 index 000000000000..9aa746d4f855 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/sas_definition_bundle_py3.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 msrest.serialization import Model + + +class SasDefinitionBundle(Model): + """A SAS definition bundle consists of key vault SAS definition details plus + its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The SAS definition id. + :vartype id: str + :ivar secret_id: Storage account SAS definition secret id. + :vartype secret_id: str + :ivar template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will have + the same properties as the template. + :vartype template_uri: str + :ivar sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :vartype sas_type: str or ~azure.keyvault.models.SasTokenType + :ivar validity_period: The validity period of SAS tokens created according + to the SAS definition. + :vartype validity_period: str + :ivar attributes: The SAS definition attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'template_uri': {'readonly': True}, + 'sas_type': {'readonly': True}, + 'validity_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(SasDefinitionBundle, self).__init__(**kwargs) + self.id = None + self.secret_id = None + self.template_uri = None + self.sas_type = None + self.validity_period = None + self.attributes = None + self.tags = None diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_create_parameters.py b/azure-keyvault/azure/keyvault/models/sas_definition_create_parameters.py index b9b8feb54279..667ab8f59fa3 100644 --- a/azure-keyvault/azure/keyvault/models/sas_definition_create_parameters.py +++ b/azure-keyvault/azure/keyvault/models/sas_definition_create_parameters.py @@ -15,15 +15,17 @@ class SasDefinitionCreateParameters(Model): """The SAS definition create parameters. - :param template_uri: The SAS definition token template signed with an - arbitrary key. Tokens created according to the SAS definition will have - the same properties as the template. + All required parameters must be populated in order to send to Azure. + + :param template_uri: Required. The SAS definition token template signed + with an arbitrary key. Tokens created according to the SAS definition + will have the same properties as the template. :type template_uri: str - :param sas_type: The type of SAS token the SAS definition will create. - Possible values include: 'account', 'service' + :param sas_type: Required. The type of SAS token the SAS definition will + create. Possible values include: 'account', 'service' :type sas_type: str or ~azure.keyvault.models.SasTokenType - :param validity_period: The validity period of SAS tokens created - according to the SAS definition. + :param validity_period: Required. The validity period of SAS tokens + created according to the SAS definition. :type validity_period: str :param sas_definition_attributes: The attributes of the SAS definition. :type sas_definition_attributes: @@ -46,10 +48,10 @@ class SasDefinitionCreateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, template_uri, sas_type, validity_period, sas_definition_attributes=None, tags=None): - super(SasDefinitionCreateParameters, self).__init__() - self.template_uri = template_uri - self.sas_type = sas_type - self.validity_period = validity_period - self.sas_definition_attributes = sas_definition_attributes - self.tags = tags + def __init__(self, **kwargs): + super(SasDefinitionCreateParameters, self).__init__(**kwargs) + self.template_uri = kwargs.get('template_uri', None) + self.sas_type = kwargs.get('sas_type', None) + self.validity_period = kwargs.get('validity_period', None) + self.sas_definition_attributes = kwargs.get('sas_definition_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_create_parameters_py3.py b/azure-keyvault/azure/keyvault/models/sas_definition_create_parameters_py3.py new file mode 100644 index 000000000000..71bea69977dc --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/sas_definition_create_parameters_py3.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class SasDefinitionCreateParameters(Model): + """The SAS definition create parameters. + + All required parameters must be populated in order to send to Azure. + + :param template_uri: Required. The SAS definition token template signed + with an arbitrary key. Tokens created according to the SAS definition + will have the same properties as the template. + :type template_uri: str + :param sas_type: Required. The type of SAS token the SAS definition will + create. Possible values include: 'account', 'service' + :type sas_type: str or ~azure.keyvault.models.SasTokenType + :param validity_period: Required. The validity period of SAS tokens + created according to the SAS definition. + :type validity_period: str + :param sas_definition_attributes: The attributes of the SAS definition. + :type sas_definition_attributes: + ~azure.keyvault.models.SasDefinitionAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'template_uri': {'required': True}, + 'sas_type': {'required': True}, + 'validity_period': {'required': True}, + } + + _attribute_map = { + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'sas_definition_attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, template_uri: str, sas_type, validity_period: str, sas_definition_attributes=None, tags=None, **kwargs) -> None: + super(SasDefinitionCreateParameters, self).__init__(**kwargs) + self.template_uri = template_uri + self.sas_type = sas_type + self.validity_period = validity_period + self.sas_definition_attributes = sas_definition_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_item.py b/azure-keyvault/azure/keyvault/models/sas_definition_item.py index 872d25a041a7..ad3715ad18dd 100644 --- a/azure-keyvault/azure/keyvault/models/sas_definition_item.py +++ b/azure-keyvault/azure/keyvault/models/sas_definition_item.py @@ -42,8 +42,8 @@ class SasDefinitionItem(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self): - super(SasDefinitionItem, self).__init__() + def __init__(self, **kwargs): + super(SasDefinitionItem, self).__init__(**kwargs) self.id = None self.secret_id = None self.attributes = None diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_item_py3.py b/azure-keyvault/azure/keyvault/models/sas_definition_item_py3.py new file mode 100644 index 000000000000..d4e4ed7ff394 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/sas_definition_item_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class SasDefinitionItem(Model): + """The SAS definition item containing storage SAS definition metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage SAS identifier. + :vartype id: str + :ivar secret_id: The storage account SAS definition secret id. + :vartype secret_id: str + :ivar attributes: The SAS definition management attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(SasDefinitionItem, self).__init__(**kwargs) + self.id = None + self.secret_id = None + self.attributes = None + self.tags = None diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_update_parameters.py b/azure-keyvault/azure/keyvault/models/sas_definition_update_parameters.py index 16735eade36e..5e7c058e9ebf 100644 --- a/azure-keyvault/azure/keyvault/models/sas_definition_update_parameters.py +++ b/azure-keyvault/azure/keyvault/models/sas_definition_update_parameters.py @@ -40,10 +40,10 @@ class SasDefinitionUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, template_uri=None, sas_type=None, validity_period=None, sas_definition_attributes=None, tags=None): - super(SasDefinitionUpdateParameters, self).__init__() - self.template_uri = template_uri - self.sas_type = sas_type - self.validity_period = validity_period - self.sas_definition_attributes = sas_definition_attributes - self.tags = tags + def __init__(self, **kwargs): + super(SasDefinitionUpdateParameters, self).__init__(**kwargs) + self.template_uri = kwargs.get('template_uri', None) + self.sas_type = kwargs.get('sas_type', None) + self.validity_period = kwargs.get('validity_period', None) + self.sas_definition_attributes = kwargs.get('sas_definition_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/sas_definition_update_parameters_py3.py b/azure-keyvault/azure/keyvault/models/sas_definition_update_parameters_py3.py new file mode 100644 index 000000000000..b1b13fda8aac --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/sas_definition_update_parameters_py3.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 msrest.serialization import Model + + +class SasDefinitionUpdateParameters(Model): + """The SAS definition update parameters. + + :param template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will have + the same properties as the template. + :type template_uri: str + :param sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :type sas_type: str or ~azure.keyvault.models.SasTokenType + :param validity_period: The validity period of SAS tokens created + according to the SAS definition. + :type validity_period: str + :param sas_definition_attributes: The attributes of the SAS definition. + :type sas_definition_attributes: + ~azure.keyvault.models.SasDefinitionAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'sas_definition_attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, template_uri: str=None, sas_type=None, validity_period: str=None, sas_definition_attributes=None, tags=None, **kwargs) -> None: + super(SasDefinitionUpdateParameters, self).__init__(**kwargs) + self.template_uri = template_uri + self.sas_type = sas_type + self.validity_period = validity_period + self.sas_definition_attributes = sas_definition_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/secret_attributes.py b/azure-keyvault/azure/keyvault/models/secret_attributes.py index 14f1c75049d4..58d6325b81b0 100644 --- a/azure-keyvault/azure/keyvault/models/secret_attributes.py +++ b/azure-keyvault/azure/keyvault/models/secret_attributes.py @@ -53,6 +53,6 @@ class SecretAttributes(Attributes): 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, } - def __init__(self, enabled=None, not_before=None, expires=None): - super(SecretAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires) + def __init__(self, **kwargs): + super(SecretAttributes, self).__init__(**kwargs) self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/secret_attributes_py3.py b/azure-keyvault/azure/keyvault/models/secret_attributes_py3.py new file mode 100644 index 000000000000..4c81c14e83c6 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/secret_attributes_py3.py @@ -0,0 +1,58 @@ +# 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 .attributes_py3 import Attributes + + +class SecretAttributes(Attributes): + """The secret management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for secrets in the current vault. If it contains 'Purgeable', the + secret can be permanently deleted by a privileged user; otherwise, only + the system can purge the secret, at the end of the retention interval. + Possible values include: 'Purgeable', 'Recoverable+Purgeable', + 'Recoverable', 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None: + super(SecretAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs) + self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/secret_bundle.py b/azure-keyvault/azure/keyvault/models/secret_bundle.py index 4160cbcb01b1..53125d49292f 100644 --- a/azure-keyvault/azure/keyvault/models/secret_bundle.py +++ b/azure-keyvault/azure/keyvault/models/secret_bundle.py @@ -51,12 +51,12 @@ class SecretBundle(Model): 'managed': {'key': 'managed', 'type': 'bool'}, } - def __init__(self, value=None, id=None, content_type=None, attributes=None, tags=None): - super(SecretBundle, self).__init__() - self.value = value - self.id = id - self.content_type = content_type - self.attributes = attributes - self.tags = tags + def __init__(self, **kwargs): + super(SecretBundle, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.id = kwargs.get('id', None) + self.content_type = kwargs.get('content_type', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) self.kid = None self.managed = None diff --git a/azure-keyvault/azure/keyvault/models/secret_bundle_py3.py b/azure-keyvault/azure/keyvault/models/secret_bundle_py3.py new file mode 100644 index 000000000000..63194a95a9b8 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/secret_bundle_py3.py @@ -0,0 +1,62 @@ +# 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 msrest.serialization import Model + + +class SecretBundle(Model): + """A secret consisting of a value, id and its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: The secret value. + :type value: str + :param id: The secret id. + :type id: str + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar kid: If this is a secret backing a KV certificate, then this field + specifies the corresponding key backing the KV certificate. + :vartype kid: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a secret backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'kid': {'readonly': True}, + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, *, value: str=None, id: str=None, content_type: str=None, attributes=None, tags=None, **kwargs) -> None: + super(SecretBundle, self).__init__(**kwargs) + self.value = value + self.id = id + self.content_type = content_type + self.attributes = attributes + self.tags = tags + self.kid = None + self.managed = None diff --git a/azure-keyvault/azure/keyvault/models/secret_item.py b/azure-keyvault/azure/keyvault/models/secret_item.py index 260d7d6bc161..941d1690b793 100644 --- a/azure-keyvault/azure/keyvault/models/secret_item.py +++ b/azure-keyvault/azure/keyvault/models/secret_item.py @@ -43,10 +43,10 @@ class SecretItem(Model): 'managed': {'key': 'managed', 'type': 'bool'}, } - def __init__(self, id=None, attributes=None, tags=None, content_type=None): - super(SecretItem, self).__init__() - self.id = id - self.attributes = attributes - self.tags = tags - self.content_type = content_type + def __init__(self, **kwargs): + super(SecretItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) + self.content_type = kwargs.get('content_type', None) self.managed = None diff --git a/azure-keyvault/azure/keyvault/models/secret_item_py3.py b/azure-keyvault/azure/keyvault/models/secret_item_py3.py new file mode 100644 index 000000000000..3f5f08581326 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/secret_item_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class SecretItem(Model): + """The secret item containing secret metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Secret identifier. + :type id: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a key backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: str=None, **kwargs) -> None: + super(SecretItem, self).__init__(**kwargs) + self.id = id + self.attributes = attributes + self.tags = tags + self.content_type = content_type + self.managed = None diff --git a/azure-keyvault/azure/keyvault/models/secret_properties.py b/azure-keyvault/azure/keyvault/models/secret_properties.py index b4a722dd25e9..03794579e47c 100644 --- a/azure-keyvault/azure/keyvault/models/secret_properties.py +++ b/azure-keyvault/azure/keyvault/models/secret_properties.py @@ -23,6 +23,6 @@ class SecretProperties(Model): 'content_type': {'key': 'contentType', 'type': 'str'}, } - def __init__(self, content_type=None): - super(SecretProperties, self).__init__() - self.content_type = content_type + def __init__(self, **kwargs): + super(SecretProperties, self).__init__(**kwargs) + self.content_type = kwargs.get('content_type', None) diff --git a/azure-keyvault/azure/keyvault/models/secret_properties_py3.py b/azure-keyvault/azure/keyvault/models/secret_properties_py3.py new file mode 100644 index 000000000000..f071d84220b8 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/secret_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SecretProperties(Model): + """Properties of the key backing a certificate. + + :param content_type: The media type (MIME type). + :type content_type: str + """ + + _attribute_map = { + 'content_type': {'key': 'contentType', 'type': 'str'}, + } + + def __init__(self, *, content_type: str=None, **kwargs) -> None: + super(SecretProperties, self).__init__(**kwargs) + self.content_type = content_type diff --git a/azure-keyvault/azure/keyvault/models/secret_restore_parameters.py b/azure-keyvault/azure/keyvault/models/secret_restore_parameters.py index 59c52a7c66b1..9e34c4259edc 100644 --- a/azure-keyvault/azure/keyvault/models/secret_restore_parameters.py +++ b/azure-keyvault/azure/keyvault/models/secret_restore_parameters.py @@ -15,8 +15,10 @@ class SecretRestoreParameters(Model): """The secret restore parameters. - :param secret_bundle_backup: The backup blob associated with a secret - bundle. + All required parameters must be populated in order to send to Azure. + + :param secret_bundle_backup: Required. The backup blob associated with a + secret bundle. :type secret_bundle_backup: bytes """ @@ -28,6 +30,6 @@ class SecretRestoreParameters(Model): 'secret_bundle_backup': {'key': 'value', 'type': 'base64'}, } - def __init__(self, secret_bundle_backup): - super(SecretRestoreParameters, self).__init__() - self.secret_bundle_backup = secret_bundle_backup + def __init__(self, **kwargs): + super(SecretRestoreParameters, self).__init__(**kwargs) + self.secret_bundle_backup = kwargs.get('secret_bundle_backup', None) diff --git a/azure-keyvault/azure/keyvault/models/secret_restore_parameters_py3.py b/azure-keyvault/azure/keyvault/models/secret_restore_parameters_py3.py new file mode 100644 index 000000000000..0c81a9b890aa --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/secret_restore_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class SecretRestoreParameters(Model): + """The secret restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param secret_bundle_backup: Required. The backup blob associated with a + secret bundle. + :type secret_bundle_backup: bytes + """ + + _validation = { + 'secret_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'secret_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, secret_bundle_backup: bytes, **kwargs) -> None: + super(SecretRestoreParameters, self).__init__(**kwargs) + self.secret_bundle_backup = secret_bundle_backup diff --git a/azure-keyvault/azure/keyvault/models/secret_set_parameters.py b/azure-keyvault/azure/keyvault/models/secret_set_parameters.py index 0f78377e3d67..39ae435e2bd5 100644 --- a/azure-keyvault/azure/keyvault/models/secret_set_parameters.py +++ b/azure-keyvault/azure/keyvault/models/secret_set_parameters.py @@ -15,7 +15,9 @@ class SecretSetParameters(Model): """The secret set parameters. - :param value: The value of the secret. + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. :type value: str :param tags: Application specific metadata in the form of key-value pairs. :type tags: dict[str, str] @@ -36,9 +38,9 @@ class SecretSetParameters(Model): 'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, } - def __init__(self, value, tags=None, content_type=None, secret_attributes=None): - super(SecretSetParameters, self).__init__() - self.value = value - self.tags = tags - self.content_type = content_type - self.secret_attributes = secret_attributes + def __init__(self, **kwargs): + super(SecretSetParameters, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.tags = kwargs.get('tags', None) + self.content_type = kwargs.get('content_type', None) + self.secret_attributes = kwargs.get('secret_attributes', None) diff --git a/azure-keyvault/azure/keyvault/models/secret_set_parameters_py3.py b/azure-keyvault/azure/keyvault/models/secret_set_parameters_py3.py new file mode 100644 index 000000000000..81a5478776ef --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/secret_set_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class SecretSetParameters(Model): + """The secret set parameters. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :param secret_attributes: The secret management attributes. + :type secret_attributes: ~azure.keyvault.models.SecretAttributes + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + } + + def __init__(self, *, value: str, tags=None, content_type: str=None, secret_attributes=None, **kwargs) -> None: + super(SecretSetParameters, self).__init__(**kwargs) + self.value = value + self.tags = tags + self.content_type = content_type + self.secret_attributes = secret_attributes diff --git a/azure-keyvault/azure/keyvault/models/secret_update_parameters.py b/azure-keyvault/azure/keyvault/models/secret_update_parameters.py index 550c1276aa86..c4935f4899ea 100644 --- a/azure-keyvault/azure/keyvault/models/secret_update_parameters.py +++ b/azure-keyvault/azure/keyvault/models/secret_update_parameters.py @@ -29,8 +29,8 @@ class SecretUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, content_type=None, secret_attributes=None, tags=None): - super(SecretUpdateParameters, self).__init__() - self.content_type = content_type - self.secret_attributes = secret_attributes - self.tags = tags + def __init__(self, **kwargs): + super(SecretUpdateParameters, self).__init__(**kwargs) + self.content_type = kwargs.get('content_type', None) + self.secret_attributes = kwargs.get('secret_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/secret_update_parameters_py3.py b/azure-keyvault/azure/keyvault/models/secret_update_parameters_py3.py new file mode 100644 index 000000000000..dfe4a1028627 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/secret_update_parameters_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class SecretUpdateParameters(Model): + """The secret update parameters. + + :param content_type: Type of the secret value such as a password. + :type content_type: str + :param secret_attributes: The secret management attributes. + :type secret_attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, content_type: str=None, secret_attributes=None, tags=None, **kwargs) -> None: + super(SecretUpdateParameters, self).__init__(**kwargs) + self.content_type = content_type + self.secret_attributes = secret_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/storage_account_attributes.py b/azure-keyvault/azure/keyvault/models/storage_account_attributes.py index bfaf2f5ef738..f8ba9114a0ef 100644 --- a/azure-keyvault/azure/keyvault/models/storage_account_attributes.py +++ b/azure-keyvault/azure/keyvault/models/storage_account_attributes.py @@ -48,9 +48,9 @@ class StorageAccountAttributes(Model): 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, } - def __init__(self, enabled=None): - super(StorageAccountAttributes, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(StorageAccountAttributes, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.created = None self.updated = None self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/storage_account_attributes_py3.py b/azure-keyvault/azure/keyvault/models/storage_account_attributes_py3.py new file mode 100644 index 000000000000..54110fc8b91b --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/storage_account_attributes_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class StorageAccountAttributes(Model): + """The storage account management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: the enabled state of the object. + :type enabled: bool + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for storage accounts in the current vault. If it contains + 'Purgeable' the storage account can be permanently deleted by a privileged + user; otherwise, only the system can purge the storage account, at the end + of the retention interval. Possible values include: 'Purgeable', + 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(StorageAccountAttributes, self).__init__(**kwargs) + self.enabled = enabled + self.created = None + self.updated = None + self.recovery_level = None diff --git a/azure-keyvault/azure/keyvault/models/storage_account_create_parameters.py b/azure-keyvault/azure/keyvault/models/storage_account_create_parameters.py index e8cd1543fd2b..bed4c83a744a 100644 --- a/azure-keyvault/azure/keyvault/models/storage_account_create_parameters.py +++ b/azure-keyvault/azure/keyvault/models/storage_account_create_parameters.py @@ -15,12 +15,14 @@ class StorageAccountCreateParameters(Model): """The storage account create parameters. - :param resource_id: Storage account resource id. + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. Storage account resource id. :type resource_id: str - :param active_key_name: Current active storage account key name. + :param active_key_name: Required. Current active storage account key name. :type active_key_name: str - :param auto_regenerate_key: whether keyvault should manage the storage - account for the user. + :param auto_regenerate_key: Required. whether keyvault should manage the + storage account for the user. :type auto_regenerate_key: bool :param regeneration_period: The key regeneration time duration specified in ISO-8601 format. @@ -47,11 +49,11 @@ class StorageAccountCreateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, resource_id, active_key_name, auto_regenerate_key, regeneration_period=None, storage_account_attributes=None, tags=None): - super(StorageAccountCreateParameters, self).__init__() - self.resource_id = resource_id - self.active_key_name = active_key_name - self.auto_regenerate_key = auto_regenerate_key - self.regeneration_period = regeneration_period - self.storage_account_attributes = storage_account_attributes - self.tags = tags + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.active_key_name = kwargs.get('active_key_name', None) + self.auto_regenerate_key = kwargs.get('auto_regenerate_key', None) + self.regeneration_period = kwargs.get('regeneration_period', None) + self.storage_account_attributes = kwargs.get('storage_account_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/storage_account_create_parameters_py3.py b/azure-keyvault/azure/keyvault/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..eb75276dc5d5 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/storage_account_create_parameters_py3.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The storage account create parameters. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. Storage account resource id. + :type resource_id: str + :param active_key_name: Required. Current active storage account key name. + :type active_key_name: str + :param auto_regenerate_key: Required. whether keyvault should manage the + storage account for the user. + :type auto_regenerate_key: bool + :param regeneration_period: The key regeneration time duration specified + in ISO-8601 format. + :type regeneration_period: str + :param storage_account_attributes: The attributes of the storage account. + :type storage_account_attributes: + ~azure.keyvault.models.StorageAccountAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'resource_id': {'required': True}, + 'active_key_name': {'required': True}, + 'auto_regenerate_key': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'storage_account_attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, resource_id: str, active_key_name: str, auto_regenerate_key: bool, regeneration_period: str=None, storage_account_attributes=None, tags=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.resource_id = resource_id + self.active_key_name = active_key_name + self.auto_regenerate_key = auto_regenerate_key + self.regeneration_period = regeneration_period + self.storage_account_attributes = storage_account_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/storage_account_item.py b/azure-keyvault/azure/keyvault/models/storage_account_item.py index 9191fdc4ed3b..1a3057e7bf17 100644 --- a/azure-keyvault/azure/keyvault/models/storage_account_item.py +++ b/azure-keyvault/azure/keyvault/models/storage_account_item.py @@ -42,8 +42,8 @@ class StorageAccountItem(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self): - super(StorageAccountItem, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountItem, self).__init__(**kwargs) self.id = None self.resource_id = None self.attributes = None diff --git a/azure-keyvault/azure/keyvault/models/storage_account_item_py3.py b/azure-keyvault/azure/keyvault/models/storage_account_item_py3.py new file mode 100644 index 000000000000..0dbd0edd7687 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/storage_account_item_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class StorageAccountItem(Model): + """The storage account item containing storage account metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Storage identifier. + :vartype id: str + :ivar resource_id: Storage account resource Id. + :vartype resource_id: str + :ivar attributes: The storage account management attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountItem, self).__init__(**kwargs) + self.id = None + self.resource_id = None + self.attributes = None + self.tags = None diff --git a/azure-keyvault/azure/keyvault/models/storage_account_regenerte_key_parameters.py b/azure-keyvault/azure/keyvault/models/storage_account_regenerte_key_parameters.py index 58fdec2c4a41..459103c575aa 100644 --- a/azure-keyvault/azure/keyvault/models/storage_account_regenerte_key_parameters.py +++ b/azure-keyvault/azure/keyvault/models/storage_account_regenerte_key_parameters.py @@ -15,7 +15,9 @@ class StorageAccountRegenerteKeyParameters(Model): """The storage account key regenerate parameters. - :param key_name: The storage account key name. + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The storage account key name. :type key_name: str """ @@ -27,6 +29,6 @@ class StorageAccountRegenerteKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerteKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerteKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-keyvault/azure/keyvault/models/storage_account_regenerte_key_parameters_py3.py b/azure-keyvault/azure/keyvault/models/storage_account_regenerte_key_parameters_py3.py new file mode 100644 index 000000000000..1403108fbac0 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/storage_account_regenerte_key_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class StorageAccountRegenerteKeyParameters(Model): + """The storage account key regenerate parameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The storage account key name. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerteKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-keyvault/azure/keyvault/models/storage_account_update_parameters.py b/azure-keyvault/azure/keyvault/models/storage_account_update_parameters.py index e592d220b495..8b9b5ecb907f 100644 --- a/azure-keyvault/azure/keyvault/models/storage_account_update_parameters.py +++ b/azure-keyvault/azure/keyvault/models/storage_account_update_parameters.py @@ -38,10 +38,10 @@ class StorageAccountUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, active_key_name=None, auto_regenerate_key=None, regeneration_period=None, storage_account_attributes=None, tags=None): - super(StorageAccountUpdateParameters, self).__init__() - self.active_key_name = active_key_name - self.auto_regenerate_key = auto_regenerate_key - self.regeneration_period = regeneration_period - self.storage_account_attributes = storage_account_attributes - self.tags = tags + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.active_key_name = kwargs.get('active_key_name', None) + self.auto_regenerate_key = kwargs.get('auto_regenerate_key', None) + self.regeneration_period = kwargs.get('regeneration_period', None) + self.storage_account_attributes = kwargs.get('storage_account_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-keyvault/azure/keyvault/models/storage_account_update_parameters_py3.py b/azure-keyvault/azure/keyvault/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..c6e860fbb526 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/storage_account_update_parameters_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The storage account update parameters. + + :param active_key_name: The current active storage account key name. + :type active_key_name: str + :param auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :type auto_regenerate_key: bool + :param regeneration_period: The key regeneration time duration specified + in ISO-8601 format. + :type regeneration_period: str + :param storage_account_attributes: The attributes of the storage account. + :type storage_account_attributes: + ~azure.keyvault.models.StorageAccountAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'storage_account_attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, active_key_name: str=None, auto_regenerate_key: bool=None, regeneration_period: str=None, storage_account_attributes=None, tags=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.active_key_name = active_key_name + self.auto_regenerate_key = auto_regenerate_key + self.regeneration_period = regeneration_period + self.storage_account_attributes = storage_account_attributes + self.tags = tags diff --git a/azure-keyvault/azure/keyvault/models/storage_bundle.py b/azure-keyvault/azure/keyvault/models/storage_bundle.py index de4658a99097..cf5d645ba4a8 100644 --- a/azure-keyvault/azure/keyvault/models/storage_bundle.py +++ b/azure-keyvault/azure/keyvault/models/storage_bundle.py @@ -57,8 +57,8 @@ class StorageBundle(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self): - super(StorageBundle, self).__init__() + def __init__(self, **kwargs): + super(StorageBundle, self).__init__(**kwargs) self.id = None self.resource_id = None self.active_key_name = None diff --git a/azure-keyvault/azure/keyvault/models/storage_bundle_py3.py b/azure-keyvault/azure/keyvault/models/storage_bundle_py3.py new file mode 100644 index 000000000000..1b54975ba292 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/storage_bundle_py3.py @@ -0,0 +1,68 @@ +# 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 msrest.serialization import Model + + +class StorageBundle(Model): + """A Storage account bundle consists of key vault storage account details plus + its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage account id. + :vartype id: str + :ivar resource_id: The storage account resource id. + :vartype resource_id: str + :ivar active_key_name: The current active storage account key name. + :vartype active_key_name: str + :ivar auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :vartype auto_regenerate_key: bool + :ivar regeneration_period: The key regeneration time duration specified in + ISO-8601 format. + :vartype regeneration_period: str + :ivar attributes: The storage account attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'active_key_name': {'readonly': True}, + 'auto_regenerate_key': {'readonly': True}, + 'regeneration_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageBundle, self).__init__(**kwargs) + self.id = None + self.resource_id = None + self.active_key_name = None + self.auto_regenerate_key = None + self.regeneration_period = None + self.attributes = None + self.tags = None diff --git a/azure-keyvault/azure/keyvault/models/storage_restore_parameters.py b/azure-keyvault/azure/keyvault/models/storage_restore_parameters.py index cf60aaaa785a..add6f3cd22fd 100644 --- a/azure-keyvault/azure/keyvault/models/storage_restore_parameters.py +++ b/azure-keyvault/azure/keyvault/models/storage_restore_parameters.py @@ -15,8 +15,10 @@ class StorageRestoreParameters(Model): """The secret restore parameters. - :param storage_bundle_backup: The backup blob associated with a storage - account. + All required parameters must be populated in order to send to Azure. + + :param storage_bundle_backup: Required. The backup blob associated with a + storage account. :type storage_bundle_backup: bytes """ @@ -28,6 +30,6 @@ class StorageRestoreParameters(Model): 'storage_bundle_backup': {'key': 'value', 'type': 'base64'}, } - def __init__(self, storage_bundle_backup): - super(StorageRestoreParameters, self).__init__() - self.storage_bundle_backup = storage_bundle_backup + def __init__(self, **kwargs): + super(StorageRestoreParameters, self).__init__(**kwargs) + self.storage_bundle_backup = kwargs.get('storage_bundle_backup', None) diff --git a/azure-keyvault/azure/keyvault/models/storage_restore_parameters_py3.py b/azure-keyvault/azure/keyvault/models/storage_restore_parameters_py3.py new file mode 100644 index 000000000000..0496d15ba4ae --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/storage_restore_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class StorageRestoreParameters(Model): + """The secret restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param storage_bundle_backup: Required. The backup blob associated with a + storage account. + :type storage_bundle_backup: bytes + """ + + _validation = { + 'storage_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'storage_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, storage_bundle_backup: bytes, **kwargs) -> None: + super(StorageRestoreParameters, self).__init__(**kwargs) + self.storage_bundle_backup = storage_bundle_backup diff --git a/azure-keyvault/azure/keyvault/models/subject_alternative_names.py b/azure-keyvault/azure/keyvault/models/subject_alternative_names.py index b803580810b7..0ff2911550df 100644 --- a/azure-keyvault/azure/keyvault/models/subject_alternative_names.py +++ b/azure-keyvault/azure/keyvault/models/subject_alternative_names.py @@ -29,8 +29,8 @@ class SubjectAlternativeNames(Model): 'upns': {'key': 'upns', 'type': '[str]'}, } - def __init__(self, emails=None, dns_names=None, upns=None): - super(SubjectAlternativeNames, self).__init__() - self.emails = emails - self.dns_names = dns_names - self.upns = upns + def __init__(self, **kwargs): + super(SubjectAlternativeNames, self).__init__(**kwargs) + self.emails = kwargs.get('emails', None) + self.dns_names = kwargs.get('dns_names', None) + self.upns = kwargs.get('upns', None) diff --git a/azure-keyvault/azure/keyvault/models/subject_alternative_names_py3.py b/azure-keyvault/azure/keyvault/models/subject_alternative_names_py3.py new file mode 100644 index 000000000000..a2870854d559 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/subject_alternative_names_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class SubjectAlternativeNames(Model): + """The subject alternate names of a X509 object. + + :param emails: Email addresses. + :type emails: list[str] + :param dns_names: Domain names. + :type dns_names: list[str] + :param upns: User principal names. + :type upns: list[str] + """ + + _attribute_map = { + 'emails': {'key': 'emails', 'type': '[str]'}, + 'dns_names': {'key': 'dns_names', 'type': '[str]'}, + 'upns': {'key': 'upns', 'type': '[str]'}, + } + + def __init__(self, *, emails=None, dns_names=None, upns=None, **kwargs) -> None: + super(SubjectAlternativeNames, self).__init__(**kwargs) + self.emails = emails + self.dns_names = dns_names + self.upns = upns diff --git a/azure-keyvault/azure/keyvault/models/trigger.py b/azure-keyvault/azure/keyvault/models/trigger.py index a6b535df2278..a68686f8303e 100644 --- a/azure-keyvault/azure/keyvault/models/trigger.py +++ b/azure-keyvault/azure/keyvault/models/trigger.py @@ -34,7 +34,7 @@ class Trigger(Model): 'days_before_expiry': {'key': 'days_before_expiry', 'type': 'int'}, } - def __init__(self, lifetime_percentage=None, days_before_expiry=None): - super(Trigger, self).__init__() - self.lifetime_percentage = lifetime_percentage - self.days_before_expiry = days_before_expiry + def __init__(self, **kwargs): + super(Trigger, self).__init__(**kwargs) + self.lifetime_percentage = kwargs.get('lifetime_percentage', None) + self.days_before_expiry = kwargs.get('days_before_expiry', None) diff --git a/azure-keyvault/azure/keyvault/models/trigger_py3.py b/azure-keyvault/azure/keyvault/models/trigger_py3.py new file mode 100644 index 000000000000..38faa3471773 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/trigger_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class Trigger(Model): + """A condition to be satisfied for an action to be executed. + + :param lifetime_percentage: Percentage of lifetime at which to trigger. + Value should be between 1 and 99. + :type lifetime_percentage: int + :param days_before_expiry: Days before expiry to attempt renewal. Value + should be between 1 and validity_in_months multiplied by 27. If + validity_in_months is 36, then value should be between 1 and 972 (36 * + 27). + :type days_before_expiry: int + """ + + _validation = { + 'lifetime_percentage': {'maximum': 99, 'minimum': 1}, + } + + _attribute_map = { + 'lifetime_percentage': {'key': 'lifetime_percentage', 'type': 'int'}, + 'days_before_expiry': {'key': 'days_before_expiry', 'type': 'int'}, + } + + def __init__(self, *, lifetime_percentage: int=None, days_before_expiry: int=None, **kwargs) -> None: + super(Trigger, self).__init__(**kwargs) + self.lifetime_percentage = lifetime_percentage + self.days_before_expiry = days_before_expiry diff --git a/azure-keyvault/azure/keyvault/models/x509_certificate_properties.py b/azure-keyvault/azure/keyvault/models/x509_certificate_properties.py index f6ca67ff08e6..c8370d3817f0 100644 --- a/azure-keyvault/azure/keyvault/models/x509_certificate_properties.py +++ b/azure-keyvault/azure/keyvault/models/x509_certificate_properties.py @@ -28,9 +28,6 @@ class X509CertificateProperties(Model): :param validity_in_months: The duration that the ceritifcate is valid in months. :type validity_in_months: int - :param certificate_transparency: Indicates if the certificates generated - under this policy should be published to certificate transparency logs. - :type certificate_transparency: bool """ _validation = { @@ -43,14 +40,12 @@ class X509CertificateProperties(Model): 'subject_alternative_names': {'key': 'sans', 'type': 'SubjectAlternativeNames'}, 'key_usage': {'key': 'key_usage', 'type': '[str]'}, 'validity_in_months': {'key': 'validity_months', 'type': 'int'}, - 'certificate_transparency': {'key': 'cert_transparency', 'type': 'bool'}, } - def __init__(self, subject=None, ekus=None, subject_alternative_names=None, key_usage=None, validity_in_months=None, certificate_transparency=None): - super(X509CertificateProperties, self).__init__() - self.subject = subject - self.ekus = ekus - self.subject_alternative_names = subject_alternative_names - self.key_usage = key_usage - self.validity_in_months = validity_in_months - self.certificate_transparency = certificate_transparency + def __init__(self, **kwargs): + super(X509CertificateProperties, self).__init__(**kwargs) + self.subject = kwargs.get('subject', None) + self.ekus = kwargs.get('ekus', None) + self.subject_alternative_names = kwargs.get('subject_alternative_names', None) + self.key_usage = kwargs.get('key_usage', None) + self.validity_in_months = kwargs.get('validity_in_months', None) diff --git a/azure-keyvault/azure/keyvault/models/x509_certificate_properties_py3.py b/azure-keyvault/azure/keyvault/models/x509_certificate_properties_py3.py new file mode 100644 index 000000000000..d3337a152955 --- /dev/null +++ b/azure-keyvault/azure/keyvault/models/x509_certificate_properties_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class X509CertificateProperties(Model): + """Properties of the X509 component of a certificate. + + :param subject: The subject name. Should be a valid X509 distinguished + Name. + :type subject: str + :param ekus: The enhanced key usage. + :type ekus: list[str] + :param subject_alternative_names: The subject alternative names. + :type subject_alternative_names: + ~azure.keyvault.models.SubjectAlternativeNames + :param key_usage: List of key usages. + :type key_usage: list[str or ~azure.keyvault.models.KeyUsageType] + :param validity_in_months: The duration that the ceritifcate is valid in + months. + :type validity_in_months: int + """ + + _validation = { + 'validity_in_months': {'minimum': 0}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'ekus': {'key': 'ekus', 'type': '[str]'}, + 'subject_alternative_names': {'key': 'sans', 'type': 'SubjectAlternativeNames'}, + 'key_usage': {'key': 'key_usage', 'type': '[str]'}, + 'validity_in_months': {'key': 'validity_months', 'type': 'int'}, + } + + def __init__(self, *, subject: str=None, ekus=None, subject_alternative_names=None, key_usage=None, validity_in_months: int=None, **kwargs) -> None: + super(X509CertificateProperties, self).__init__(**kwargs) + self.subject = subject + self.ekus = ekus + self.subject_alternative_names = subject_alternative_names + self.key_usage = key_usage + self.validity_in_months = validity_in_months diff --git a/azure-keyvault/azure/keyvault/version.py b/azure-keyvault/azure/keyvault/version.py index 132b1eeebbf3..affaef0c987e 100644 --- a/azure-keyvault/azure/keyvault/version.py +++ b/azure-keyvault/azure/keyvault/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0a2," +VERSION = "1.0.0b1" diff --git a/azure-keyvault/build.json b/azure-keyvault/build.json index 801b4569ba59..fc09691e676b 100644 --- a/azure-keyvault/build.json +++ b/azure-keyvault/build.json @@ -4,101 +4,16 @@ "resolvedInfo": null, "packageMetadata": { "name": "@microsoft.azure/autorest-core", - "version": "2.0.4251", + "version": "2.0.4275", "engines": { "node": ">=7.10.0" }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@types/commonmark": "^0.27.0", - "@types/js-yaml": "^3.10.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.53", - "@types/source-map": "0.5.0", - "@types/yargs": "^8.0.2", - "@types/z-schema": "^3.16.31", - "dts-generator": "^2.1.0", - "mocha": "^4.0.1", - "mocha-typescript": "^1.1.7", - "shx": "0.2.2", - "static-link": "^0.2.3", - "vscode-jsonrpc": "^3.3.1" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core", - "_integrity": null, - "_shasum": "09bef8c85929eb24b35771f6c8e7ae7a59b5e761", - "_shrinkwrap": null, - "bin": { - "autorest-core": "./dist/app.js", - "autorest-language-service": "dist/language-service/language-service.js" - }, - "_id": "@microsoft.azure/autorest-core@2.0.4251", - "_from": "file:/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core", - "raw": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core", - "_where": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/tmp/.autorest", - "sharedLock": { - "name": "/tmp/.autorest", - "exclusiveLock": { - "name": "_tmp_.autorest.exclusive-lock", - "options": { - "port": 5245, - "host": "2130716018", - "exclusive": true - }, - "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" - }, - "busyLock": { - "name": "_tmp_.autorest.busy-lock", - "options": { - "port": 46071, - "host": "2130735832", - "exclusive": true - }, - "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" - }, - "personalLock": { - "name": "_tmp_.autorest.4023.0923679230714.personal-lock", - "options": { - "port": 45556, - "host": "2130737852", - "exclusive": true - }, - "pipe": "/tmp/pipe__tmp_.autorest.4023.0923679230714.personal-lock:45556" - }, - "file": "/tmp/_tmp_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/tmp/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4254", - "engines": { - "node": ">=7.10.0" + "dependencies": { + "typescript": "2.6.2" }, - "dependencies": {}, "optionalDependencies": {}, "devDependencies": { "@types/commonmark": "^0.27.0", - "@types/js-yaml": "^3.10.0", "@types/jsonpath": "^0.1.29", "@types/node": "^8.0.53", "@types/source-map": "0.5.0", @@ -114,77 +29,78 @@ "bundleDependencies": false, "peerDependencies": {}, "deprecated": false, - "_resolved": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4254/node_modules/@microsoft.azure/autorest-core", + "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4275/node_modules/@microsoft.azure/autorest-core", "_integrity": null, - "_shasum": "415f00de881e2377be59ae87eb91f9aa3ad47e27", + "_shasum": "fdcfc270c8be0ddec8a8996951d975b9c76c333d", "_shrinkwrap": null, "bin": { "autorest-core": "./dist/app.js", "autorest-language-service": "dist/language-service/language-service.js" }, - "_id": "@microsoft.azure/autorest-core@2.0.4254", - "_from": "file:/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4254/node_modules/@microsoft.azure/autorest-core", + "_id": "@microsoft.azure/autorest-core@2.0.4275", + "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4275/node_modules/@microsoft.azure/autorest-core", "_requested": { "type": "directory", - "where": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4254/node_modules/@microsoft.azure/autorest-core", - "raw": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4254/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4254/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4254/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4254/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4254/node_modules/@microsoft.azure/autorest-core", - "_where": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4254/node_modules/@microsoft.azure/autorest-core" + "where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4275/node_modules/@microsoft.azure/autorest-core", + "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4275/node_modules/@microsoft.azure/autorest-core", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4275/node_modules/@microsoft.azure/autorest-core", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4275/node_modules/@microsoft.azure/autorest-core", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4275/node_modules/@microsoft.azure/autorest-core" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4275/node_modules/@microsoft.azure/autorest-core", + "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4275/node_modules/@microsoft.azure/autorest-core" }, "extensionManager": { - "installationPath": "/tmp/.autorest", + "installationPath": "/root/.autorest", "sharedLock": { - "name": "/tmp/.autorest", + "name": "/root/.autorest", "exclusiveLock": { - "name": "_tmp_.autorest.exclusive-lock", + "name": "_root_.autorest.exclusive-lock", "options": { - "port": 5245, - "host": "2130716018", + "port": 45234, + "host": "2130706813", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" + "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" }, "busyLock": { - "name": "_tmp_.autorest.busy-lock", + "name": "_root_.autorest.busy-lock", "options": { - "port": 46071, - "host": "2130735832", + "port": 37199, + "host": "2130756895", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" + "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" }, "personalLock": { - "name": "_tmp_.autorest.4023.0923679230714.personal-lock", + "name": "_root_.autorest.5377.7884759540775.personal-lock", "options": { - "port": 45556, - "host": "2130737852", + "port": 22884, + "host": "2130723409", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4023.0923679230714.personal-lock:45556" + "pipe": "/tmp/pipe__root_.autorest.5377.7884759540775.personal-lock:22884" }, - "file": "/tmp/_tmp_.autorest.lock" + "file": "/tmp/_root_.autorest.lock" }, "dotnetPath": "/root/.dotnet" }, - "installationPath": "/tmp/.autorest" + "installationPath": "/root/.autorest" }, { "resolvedInfo": null, "packageMetadata": { "name": "@microsoft.azure/autorest-core", - "version": "2.0.4255", + "version": "2.0.4278", "engines": { "node": ">=7.10.0" }, - "dependencies": {}, + "dependencies": { + "typescript": "2.6.2" + }, "optionalDependencies": {}, "devDependencies": { "@types/commonmark": "^0.27.0", - "@types/js-yaml": "^3.10.0", "@types/jsonpath": "^0.1.29", "@types/node": "^8.0.53", "@types/source-map": "0.5.0", @@ -200,63 +116,63 @@ "bundleDependencies": false, "peerDependencies": {}, "deprecated": false, - "_resolved": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4255/node_modules/@microsoft.azure/autorest-core", + "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4278/node_modules/@microsoft.azure/autorest-core", "_integrity": null, - "_shasum": "fefc7a80d07418f6feb6e686932021d0615e5033", + "_shasum": "4832bd936bb0844ed6a5fea202575fb4adb5c249", "_shrinkwrap": null, "bin": { "autorest-core": "./dist/app.js", "autorest-language-service": "dist/language-service/language-service.js" }, - "_id": "@microsoft.azure/autorest-core@2.0.4255", - "_from": "file:/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4255/node_modules/@microsoft.azure/autorest-core", + "_id": "@microsoft.azure/autorest-core@2.0.4278", + "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4278/node_modules/@microsoft.azure/autorest-core", "_requested": { "type": "directory", - "where": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4255/node_modules/@microsoft.azure/autorest-core", - "raw": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4255/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4255/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4255/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4255/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4255/node_modules/@microsoft.azure/autorest-core", - "_where": "/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4255/node_modules/@microsoft.azure/autorest-core" + "where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4278/node_modules/@microsoft.azure/autorest-core", + "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4278/node_modules/@microsoft.azure/autorest-core", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4278/node_modules/@microsoft.azure/autorest-core", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4278/node_modules/@microsoft.azure/autorest-core", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4278/node_modules/@microsoft.azure/autorest-core" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4278/node_modules/@microsoft.azure/autorest-core", + "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4278/node_modules/@microsoft.azure/autorest-core" }, "extensionManager": { - "installationPath": "/tmp/.autorest", + "installationPath": "/root/.autorest", "sharedLock": { - "name": "/tmp/.autorest", + "name": "/root/.autorest", "exclusiveLock": { - "name": "_tmp_.autorest.exclusive-lock", + "name": "_root_.autorest.exclusive-lock", "options": { - "port": 5245, - "host": "2130716018", + "port": 45234, + "host": "2130706813", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" + "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" }, "busyLock": { - "name": "_tmp_.autorest.busy-lock", + "name": "_root_.autorest.busy-lock", "options": { - "port": 46071, - "host": "2130735832", + "port": 37199, + "host": "2130756895", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" + "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" }, "personalLock": { - "name": "_tmp_.autorest.4023.0923679230714.personal-lock", + "name": "_root_.autorest.5377.7884759540775.personal-lock", "options": { - "port": 45556, - "host": "2130737852", + "port": 22884, + "host": "2130723409", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4023.0923679230714.personal-lock:45556" + "pipe": "/tmp/pipe__root_.autorest.5377.7884759540775.personal-lock:22884" }, - "file": "/tmp/_tmp_.autorest.lock" + "file": "/tmp/_root_.autorest.lock" }, "dotnetPath": "/root/.dotnet" }, - "installationPath": "/tmp/.autorest" + "installationPath": "/root/.autorest" }, { "resolvedInfo": null, @@ -286,73 +202,73 @@ "bundleDependencies": false, "peerDependencies": {}, "deprecated": false, - "_resolved": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", "_integrity": null, "_shasum": "3ce7d3939124b31830be15e5de99b9b7768afb90", "_shrinkwrap": null, "bin": null, "_id": "@microsoft.azure/autorest.modeler@2.0.21", - "_from": "file:/tmp/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", "_requested": { "type": "directory", - "where": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "raw": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/tmp/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" + "where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" }, "extensionManager": { - "installationPath": "/tmp/.autorest", + "installationPath": "/root/.autorest", "sharedLock": { - "name": "/tmp/.autorest", + "name": "/root/.autorest", "exclusiveLock": { - "name": "_tmp_.autorest.exclusive-lock", + "name": "_root_.autorest.exclusive-lock", "options": { - "port": 5245, - "host": "2130716018", + "port": 45234, + "host": "2130706813", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" + "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" }, "busyLock": { - "name": "_tmp_.autorest.busy-lock", + "name": "_root_.autorest.busy-lock", "options": { - "port": 46071, - "host": "2130735832", + "port": 37199, + "host": "2130756895", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" + "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" }, "personalLock": { - "name": "_tmp_.autorest.4023.0923679230714.personal-lock", + "name": "_root_.autorest.5377.7884759540775.personal-lock", "options": { - "port": 45556, - "host": "2130737852", + "port": 22884, + "host": "2130723409", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4023.0923679230714.personal-lock:45556" + "pipe": "/tmp/pipe__root_.autorest.5377.7884759540775.personal-lock:22884" }, - "file": "/tmp/_tmp_.autorest.lock" + "file": "/tmp/_root_.autorest.lock" }, "dotnetPath": "/root/.dotnet" }, - "installationPath": "/tmp/.autorest" + "installationPath": "/root/.autorest" }, { "resolvedInfo": null, "packageMetadata": { "name": "@microsoft.azure/autorest.modeler", - "version": "2.3.38", + "version": "2.3.44", "dependencies": { "dotnet-2.0.0": "^1.4.4" }, "optionalDependencies": {}, "devDependencies": { - "@microsoft.azure/autorest.testserver": "2.3.1", - "autorest": "^2.0.4201", + "@microsoft.azure/autorest.testserver": "2.3.17", + "autorest": "^2.0.4225", "coffee-script": "^1.11.1", "dotnet-sdk-2.0.0": "^1.4.4", "gulp": "^3.9.1", @@ -371,72 +287,72 @@ "bundleDependencies": false, "peerDependencies": {}, "deprecated": false, - "_resolved": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", + "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.44/node_modules/@microsoft.azure/autorest.modeler", "_integrity": null, - "_shasum": "903bb77932e4ed1b8bc3b25cc39b167143494f6c", + "_shasum": "9b5a880a77467be33a77f002f03230d3ccc21266", "_shrinkwrap": null, "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.3.38", - "_from": "file:/tmp/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", + "_id": "@microsoft.azure/autorest.modeler@2.3.44", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.3.44/node_modules/@microsoft.azure/autorest.modeler", "_requested": { "type": "directory", - "where": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "raw": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/tmp/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/tmp/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler" + "where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.44/node_modules/@microsoft.azure/autorest.modeler", + "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.44/node_modules/@microsoft.azure/autorest.modeler", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.44/node_modules/@microsoft.azure/autorest.modeler", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.3.44/node_modules/@microsoft.azure/autorest.modeler", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.44/node_modules/@microsoft.azure/autorest.modeler" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.44/node_modules/@microsoft.azure/autorest.modeler", + "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.44/node_modules/@microsoft.azure/autorest.modeler" }, "extensionManager": { - "installationPath": "/tmp/.autorest", + "installationPath": "/root/.autorest", "sharedLock": { - "name": "/tmp/.autorest", + "name": "/root/.autorest", "exclusiveLock": { - "name": "_tmp_.autorest.exclusive-lock", + "name": "_root_.autorest.exclusive-lock", "options": { - "port": 5245, - "host": "2130716018", + "port": 45234, + "host": "2130706813", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" + "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" }, "busyLock": { - "name": "_tmp_.autorest.busy-lock", + "name": "_root_.autorest.busy-lock", "options": { - "port": 46071, - "host": "2130735832", + "port": 37199, + "host": "2130756895", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" + "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" }, "personalLock": { - "name": "_tmp_.autorest.4023.0923679230714.personal-lock", + "name": "_root_.autorest.5377.7884759540775.personal-lock", "options": { - "port": 45556, - "host": "2130737852", + "port": 22884, + "host": "2130723409", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4023.0923679230714.personal-lock:45556" + "pipe": "/tmp/pipe__root_.autorest.5377.7884759540775.personal-lock:22884" }, - "file": "/tmp/_tmp_.autorest.lock" + "file": "/tmp/_root_.autorest.lock" }, "dotnetPath": "/root/.dotnet" }, - "installationPath": "/tmp/.autorest" + "installationPath": "/root/.autorest" }, { "resolvedInfo": null, "packageMetadata": { "name": "@microsoft.azure/autorest.python", - "version": "2.1.38", + "version": "2.1.40", "dependencies": { "dotnet-2.0.0": "^1.4.4" }, "optionalDependencies": {}, "devDependencies": { - "@microsoft.azure/autorest.testserver": "^2.3.13", + "@microsoft.azure/autorest.testserver": "^2.4.0", "autorest": "^2.0.4203", "coffee-script": "^1.11.1", "dotnet-sdk-2.0.0": "^1.4.4", @@ -456,72 +372,72 @@ "bundleDependencies": false, "peerDependencies": {}, "deprecated": false, - "_resolved": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.38/node_modules/@microsoft.azure/autorest.python", + "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@2.1.40/node_modules/@microsoft.azure/autorest.python", "_integrity": null, - "_shasum": "efedbbb4c508ff08b3c83a5e9e2020598cae97b4", + "_shasum": "9b3f08c892d725ac571b3a7dc8f781d76da64397", "_shrinkwrap": null, "bin": null, - "_id": "@microsoft.azure/autorest.python@2.1.38", - "_from": "file:/tmp/.autorest/@microsoft.azure_autorest.python@2.1.38/node_modules/@microsoft.azure/autorest.python", + "_id": "@microsoft.azure/autorest.python@2.1.40", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@2.1.40/node_modules/@microsoft.azure/autorest.python", "_requested": { "type": "directory", - "where": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.38/node_modules/@microsoft.azure/autorest.python", - "raw": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.38/node_modules/@microsoft.azure/autorest.python", - "rawSpec": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.38/node_modules/@microsoft.azure/autorest.python", - "saveSpec": "file:/tmp/.autorest/@microsoft.azure_autorest.python@2.1.38/node_modules/@microsoft.azure/autorest.python", - "fetchSpec": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.38/node_modules/@microsoft.azure/autorest.python" - }, - "_spec": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.38/node_modules/@microsoft.azure/autorest.python", - "_where": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.38/node_modules/@microsoft.azure/autorest.python" + "where": "/root/.autorest/@microsoft.azure_autorest.python@2.1.40/node_modules/@microsoft.azure/autorest.python", + "raw": "/root/.autorest/@microsoft.azure_autorest.python@2.1.40/node_modules/@microsoft.azure/autorest.python", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.1.40/node_modules/@microsoft.azure/autorest.python", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@2.1.40/node_modules/@microsoft.azure/autorest.python", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.1.40/node_modules/@microsoft.azure/autorest.python" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.python@2.1.40/node_modules/@microsoft.azure/autorest.python", + "_where": "/root/.autorest/@microsoft.azure_autorest.python@2.1.40/node_modules/@microsoft.azure/autorest.python" }, "extensionManager": { - "installationPath": "/tmp/.autorest", + "installationPath": "/root/.autorest", "sharedLock": { - "name": "/tmp/.autorest", + "name": "/root/.autorest", "exclusiveLock": { - "name": "_tmp_.autorest.exclusive-lock", + "name": "_root_.autorest.exclusive-lock", "options": { - "port": 5245, - "host": "2130716018", + "port": 45234, + "host": "2130706813", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" + "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" }, "busyLock": { - "name": "_tmp_.autorest.busy-lock", + "name": "_root_.autorest.busy-lock", "options": { - "port": 46071, - "host": "2130735832", + "port": 37199, + "host": "2130756895", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" + "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" }, "personalLock": { - "name": "_tmp_.autorest.4023.0923679230714.personal-lock", + "name": "_root_.autorest.5377.7884759540775.personal-lock", "options": { - "port": 45556, - "host": "2130737852", + "port": 22884, + "host": "2130723409", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4023.0923679230714.personal-lock:45556" + "pipe": "/tmp/pipe__root_.autorest.5377.7884759540775.personal-lock:22884" }, - "file": "/tmp/_tmp_.autorest.lock" + "file": "/tmp/_root_.autorest.lock" }, "dotnetPath": "/root/.dotnet" }, - "installationPath": "/tmp/.autorest" + "installationPath": "/root/.autorest" }, { "resolvedInfo": null, "packageMetadata": { "name": "@microsoft.azure/autorest.python", - "version": "2.1.39", + "version": "3.0.51", "dependencies": { "dotnet-2.0.0": "^1.4.4" }, "optionalDependencies": {}, "devDependencies": { - "@microsoft.azure/autorest.testserver": "2.3.25", + "@microsoft.azure/autorest.testserver": "^2.5.6", "autorest": "^2.0.4203", "coffee-script": "^1.11.1", "dotnet-sdk-2.0.0": "^1.4.4", @@ -541,213 +457,60 @@ "bundleDependencies": false, "peerDependencies": {}, "deprecated": false, - "_resolved": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.39/node_modules/@microsoft.azure/autorest.python", + "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@3.0.51/node_modules/@microsoft.azure/autorest.python", "_integrity": null, - "_shasum": "44036c8f89647897798cea05f5502d1b75b5b949", + "_shasum": "edbae1c0462026e20a8efafd3b4b6cd9e3d111ac", "_shrinkwrap": null, "bin": null, - "_id": "@microsoft.azure/autorest.python@2.1.39", - "_from": "file:/tmp/.autorest/@microsoft.azure_autorest.python@2.1.39/node_modules/@microsoft.azure/autorest.python", + "_id": "@microsoft.azure/autorest.python@3.0.51", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@3.0.51/node_modules/@microsoft.azure/autorest.python", "_requested": { "type": "directory", - "where": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.39/node_modules/@microsoft.azure/autorest.python", - "raw": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.39/node_modules/@microsoft.azure/autorest.python", - "rawSpec": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.39/node_modules/@microsoft.azure/autorest.python", - "saveSpec": "file:/tmp/.autorest/@microsoft.azure_autorest.python@2.1.39/node_modules/@microsoft.azure/autorest.python", - "fetchSpec": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.39/node_modules/@microsoft.azure/autorest.python" - }, - "_spec": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.39/node_modules/@microsoft.azure/autorest.python", - "_where": "/tmp/.autorest/@microsoft.azure_autorest.python@2.1.39/node_modules/@microsoft.azure/autorest.python" - }, - "extensionManager": { - "installationPath": "/tmp/.autorest", - "sharedLock": { - "name": "/tmp/.autorest", - "exclusiveLock": { - "name": "_tmp_.autorest.exclusive-lock", - "options": { - "port": 5245, - "host": "2130716018", - "exclusive": true - }, - "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" - }, - "busyLock": { - "name": "_tmp_.autorest.busy-lock", - "options": { - "port": 46071, - "host": "2130735832", - "exclusive": true - }, - "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" - }, - "personalLock": { - "name": "_tmp_.autorest.4023.0923679230714.personal-lock", - "options": { - "port": 45556, - "host": "2130737852", - "exclusive": true - }, - "pipe": "/tmp/pipe__tmp_.autorest.4023.0923679230714.personal-lock:45556" - }, - "file": "/tmp/_tmp_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/tmp/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/classic-openapi-validator", - "version": "1.0.9", - "dependencies": { - "dotnet-2.0.0": "^1.1.0" - }, - "optionalDependencies": {}, - "devDependencies": { - "dotnet-sdk-2.0.0": "^1.1.1" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.9/node_modules/@microsoft.azure/classic-openapi-validator", - "_integrity": null, - "_shasum": "554be1db3e054b0a0e4e51c842ff5b7c6a60784c", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/classic-openapi-validator@1.0.9", - "_from": "file:/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.9/node_modules/@microsoft.azure/classic-openapi-validator", - "_requested": { - "type": "directory", - "where": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.9/node_modules/@microsoft.azure/classic-openapi-validator", - "raw": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.9/node_modules/@microsoft.azure/classic-openapi-validator", - "rawSpec": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.9/node_modules/@microsoft.azure/classic-openapi-validator", - "saveSpec": "file:/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.9/node_modules/@microsoft.azure/classic-openapi-validator", - "fetchSpec": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.9/node_modules/@microsoft.azure/classic-openapi-validator" - }, - "_spec": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.9/node_modules/@microsoft.azure/classic-openapi-validator", - "_where": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.9/node_modules/@microsoft.azure/classic-openapi-validator" - }, - "extensionManager": { - "installationPath": "/tmp/.autorest", - "sharedLock": { - "name": "/tmp/.autorest", - "exclusiveLock": { - "name": "_tmp_.autorest.exclusive-lock", - "options": { - "port": 5245, - "host": "2130716018", - "exclusive": true - }, - "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" - }, - "busyLock": { - "name": "_tmp_.autorest.busy-lock", - "options": { - "port": 46071, - "host": "2130735832", - "exclusive": true - }, - "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" - }, - "personalLock": { - "name": "_tmp_.autorest.4023.0923679230714.personal-lock", - "options": { - "port": 45556, - "host": "2130737852", - "exclusive": true - }, - "pipe": "/tmp/pipe__tmp_.autorest.4023.0923679230714.personal-lock:45556" - }, - "file": "/tmp/_tmp_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/tmp/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/openapi-validator", - "version": "1.0.2", - "dependencies": { - "fs": "^0.0.1-security", - "js-yaml": "^3.8.4", - "jsonpath": "^0.2.11", - "vscode-jsonrpc": "^3.2.0" - }, - "optionalDependencies": {}, - "devDependencies": { - "@types/js-yaml": "^3.5.30", - "@types/jsonpath": "^0.1.29", - "@types/node": "^7.0.18", - "gulp": "3.9.1", - "gulp-clean": "0.3.2", - "gulp-dotnet-cli": "0.4.0", - "gulp-mocha": "4.3.1", - "gulp-run": "1.7.1", - "mocha": "3.2.0", - "mocha-typescript": "1.0.22", - "typescript": "2.3.3" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", - "_integrity": null, - "_shasum": "352190e6dbb4a1d16587b39e589b9615d6e4aaaf", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/openapi-validator@1.0.2", - "_from": "file:/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", - "_requested": { - "type": "directory", - "where": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", - "raw": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", - "rawSpec": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", - "saveSpec": "file:/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", - "fetchSpec": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator" - }, - "_spec": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", - "_where": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator" + "where": "/root/.autorest/@microsoft.azure_autorest.python@3.0.51/node_modules/@microsoft.azure/autorest.python", + "raw": "/root/.autorest/@microsoft.azure_autorest.python@3.0.51/node_modules/@microsoft.azure/autorest.python", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@3.0.51/node_modules/@microsoft.azure/autorest.python", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@3.0.51/node_modules/@microsoft.azure/autorest.python", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@3.0.51/node_modules/@microsoft.azure/autorest.python" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.python@3.0.51/node_modules/@microsoft.azure/autorest.python", + "_where": "/root/.autorest/@microsoft.azure_autorest.python@3.0.51/node_modules/@microsoft.azure/autorest.python" }, "extensionManager": { - "installationPath": "/tmp/.autorest", + "installationPath": "/root/.autorest", "sharedLock": { - "name": "/tmp/.autorest", + "name": "/root/.autorest", "exclusiveLock": { - "name": "_tmp_.autorest.exclusive-lock", + "name": "_root_.autorest.exclusive-lock", "options": { - "port": 5245, - "host": "2130716018", + "port": 45234, + "host": "2130706813", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" + "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" }, "busyLock": { - "name": "_tmp_.autorest.busy-lock", + "name": "_root_.autorest.busy-lock", "options": { - "port": 46071, - "host": "2130735832", + "port": 37199, + "host": "2130756895", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" + "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" }, "personalLock": { - "name": "_tmp_.autorest.4023.0923679230714.personal-lock", + "name": "_root_.autorest.5377.7884759540775.personal-lock", "options": { - "port": 45556, - "host": "2130737852", + "port": 22884, + "host": "2130723409", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4023.0923679230714.personal-lock:45556" + "pipe": "/tmp/pipe__root_.autorest.5377.7884759540775.personal-lock:22884" }, - "file": "/tmp/_tmp_.autorest.lock" + "file": "/tmp/_root_.autorest.lock" }, "dotnetPath": "/root/.dotnet" }, - "installationPath": "/tmp/.autorest" + "installationPath": "/root/.autorest" } ], "autorest_bootstrap": {} diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py index 63972056a984..45155f314ad3 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py @@ -9,15 +9,26 @@ # regenerated. # -------------------------------------------------------------------------- -from .config_data_properties import ConfigDataProperties -from .config_data import ConfigData -from .arm_error_response_body import ARMErrorResponseBody -from .short_description import ShortDescription -from .resource_recommendation_base import ResourceRecommendationBase -from .resource import Resource -from .operation_display_info import OperationDisplayInfo -from .operation_entity import OperationEntity -from .suppression_contract import SuppressionContract +try: + from .config_data_properties_py3 import ConfigDataProperties + from .config_data_py3 import ConfigData + from .arm_error_response_body_py3 import ARMErrorResponseBody + from .short_description_py3 import ShortDescription + from .resource_recommendation_base_py3 import ResourceRecommendationBase + from .resource_py3 import Resource + from .operation_display_info_py3 import OperationDisplayInfo + from .operation_entity_py3 import OperationEntity + from .suppression_contract_py3 import SuppressionContract +except (SyntaxError, ImportError): + from .config_data_properties import ConfigDataProperties + from .config_data import ConfigData + from .arm_error_response_body import ARMErrorResponseBody + from .short_description import ShortDescription + from .resource_recommendation_base import ResourceRecommendationBase + from .resource import Resource + from .operation_display_info import OperationDisplayInfo + from .operation_entity import OperationEntity + from .suppression_contract import SuppressionContract from .config_data_paged import ConfigDataPaged from .resource_recommendation_base_paged import ResourceRecommendationBasePaged from .operation_entity_paged import OperationEntityPaged diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/advisor_management_client_enums.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/advisor_management_client_enums.py index 835a92ce544d..477dbe954da5 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/advisor_management_client_enums.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/advisor_management_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class Category(Enum): +class Category(str, Enum): high_availability = "HighAvailability" security = "Security" @@ -20,14 +20,14 @@ class Category(Enum): cost = "Cost" -class Impact(Enum): +class Impact(str, Enum): high = "High" medium = "Medium" low = "Low" -class Risk(Enum): +class Risk(str, Enum): error = "Error" warning = "Warning" diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body.py index 5bf889bbbd27..ae0fff677a8f 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body.py @@ -28,7 +28,7 @@ class ARMErrorResponseBody(Model): 'code': {'key': 'code', 'type': 'str'}, } - def __init__(self, message=None, code=None): - super(ARMErrorResponseBody, self).__init__() - self.message = message - self.code = code + def __init__(self, **kwargs): + super(ARMErrorResponseBody, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.code = kwargs.get('code', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body_py3.py new file mode 100644 index 000000000000..1a79f9387110 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class ARMErrorResponseBody(Model): + """ARM error response body. + + :param message: Gets or sets the string that describes the error in detail + and provides debugging information. + :type message: str + :param code: Gets or sets the string that can be used to programmatically + identify the error. + :type code: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__(self, *, message: str=None, code: str=None, **kwargs) -> None: + super(ARMErrorResponseBody, self).__init__(**kwargs) + self.message = message + self.code = code diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py index 3d4039cf76d6..534a0e11eb79 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py @@ -32,9 +32,9 @@ class ConfigData(Model): 'properties': {'key': 'properties', 'type': 'ConfigDataProperties'}, } - def __init__(self, id=None, type=None, name=None, properties=None): - super(ConfigData, self).__init__() - self.id = id - self.type = type - self.name = name - self.properties = properties + def __init__(self, **kwargs): + super(ConfigData, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties.py index 9e5d1e0217f8..cc0303d1c606 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties.py @@ -33,8 +33,8 @@ class ConfigDataProperties(Model): 'low_cpu_threshold': {'key': 'low_cpu_threshold', 'type': 'str'}, } - def __init__(self, additional_properties=None, exclude=None, low_cpu_threshold=None): - super(ConfigDataProperties, self).__init__() - self.additional_properties = additional_properties - self.exclude = exclude - self.low_cpu_threshold = low_cpu_threshold + def __init__(self, **kwargs): + super(ConfigDataProperties, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.exclude = kwargs.get('exclude', None) + self.low_cpu_threshold = kwargs.get('low_cpu_threshold', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties_py3.py new file mode 100644 index 000000000000..f52c01d6dafe --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ConfigDataProperties(Model): + """The list of property name/value pairs. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param exclude: Exclude the resource from Advisor evaluations. Valid + values: False (default) or True. + :type exclude: bool + :param low_cpu_threshold: Minimum percentage threshold for Advisor low CPU + utilization evaluation. Valid only for subscriptions. Valid values: 5 + (default), 10, 15 or 20. + :type low_cpu_threshold: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'exclude': {'key': 'exclude', 'type': 'bool'}, + 'low_cpu_threshold': {'key': 'low_cpu_threshold', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, exclude: bool=None, low_cpu_threshold: str=None, **kwargs) -> None: + super(ConfigDataProperties, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.exclude = exclude + self.low_cpu_threshold = low_cpu_threshold diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_py3.py new file mode 100644 index 000000000000..c8e7c45215c4 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ConfigData(Model): + """The Advisor configuration data structure. + + :param id: The resource Id of the configuration resource. + :type id: str + :param type: The type of the configuration resource. + :type type: str + :param name: The name of the configuration resource. + :type name: str + :param properties: The list of property name/value pairs. + :type properties: ~azure.mgmt.advisor.models.ConfigDataProperties + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConfigDataProperties'}, + } + + def __init__(self, *, id: str=None, type: str=None, name: str=None, properties=None, **kwargs) -> None: + super(ConfigData, self).__init__(**kwargs) + self.id = id + self.type = type + self.name = name + self.properties = properties diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info.py index b338bd668c8e..d4f103558727 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info.py @@ -33,9 +33,9 @@ class OperationDisplayInfo(Model): 'resource': {'key': 'resource', 'type': 'str'}, } - def __init__(self, description=None, operation=None, provider=None, resource=None): - super(OperationDisplayInfo, self).__init__() - self.description = description - self.operation = operation - self.provider = provider - self.resource = resource + def __init__(self, **kwargs): + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info_py3.py new file mode 100644 index 000000000000..24ca7bb48ec2 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class OperationDisplayInfo(Model): + """The operation supported by Advisor. + + :param description: The description of the operation. + :type description: str + :param operation: The action that users can perform, based on their + permission level. + :type operation: str + :param provider: Service provider: Microsoft Advisor. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity.py index 974966de9aa6..9872949cbe52 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity.py @@ -26,7 +26,7 @@ class OperationEntity(Model): 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, } - def __init__(self, name=None, display=None): - super(OperationEntity, self).__init__() - self.name = name - self.display = display + def __init__(self, **kwargs): + super(OperationEntity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity_py3.py new file mode 100644 index 000000000000..24c1b1b6eb82 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class OperationEntity(Model): + """The operation supported by Advisor. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The operation supported by Advisor. + :type display: ~azure.mgmt.advisor.models.OperationDisplayInfo + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationEntity, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py index 92c78390e734..f43f76f15a74 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py @@ -38,8 +38,8 @@ class Resource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_py3.py new file mode 100644 index 000000000000..33023c8d186f --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :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) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base.py index d00353cb69c6..b10979180171 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base.py @@ -73,15 +73,15 @@ class ResourceRecommendationBase(Resource): 'suppression_ids': {'key': 'properties.suppressionIds', 'type': '[str]'}, } - def __init__(self, category=None, impact=None, impacted_field=None, impacted_value=None, last_updated=None, metadata=None, recommendation_type_id=None, risk=None, short_description=None, suppression_ids=None): - super(ResourceRecommendationBase, self).__init__() - self.category = category - self.impact = impact - self.impacted_field = impacted_field - self.impacted_value = impacted_value - self.last_updated = last_updated - self.metadata = metadata - self.recommendation_type_id = recommendation_type_id - self.risk = risk - self.short_description = short_description - self.suppression_ids = suppression_ids + def __init__(self, **kwargs): + super(ResourceRecommendationBase, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.impact = kwargs.get('impact', None) + self.impacted_field = kwargs.get('impacted_field', None) + self.impacted_value = kwargs.get('impacted_value', None) + self.last_updated = kwargs.get('last_updated', None) + self.metadata = kwargs.get('metadata', None) + self.recommendation_type_id = kwargs.get('recommendation_type_id', None) + self.risk = kwargs.get('risk', None) + self.short_description = kwargs.get('short_description', None) + self.suppression_ids = kwargs.get('suppression_ids', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base_py3.py new file mode 100644 index 000000000000..4c27be9bbf72 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base_py3.py @@ -0,0 +1,87 @@ +# 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 .resource import Resource + + +class ResourceRecommendationBase(Resource): + """Advisor Recommendation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param category: The category of the recommendation. Possible values + include: 'HighAvailability', 'Security', 'Performance', 'Cost' + :type category: str or ~azure.mgmt.advisor.models.Category + :param impact: The business impact of the recommendation. Possible values + include: 'High', 'Medium', 'Low' + :type impact: str or ~azure.mgmt.advisor.models.Impact + :param impacted_field: The resource type identified by Advisor. + :type impacted_field: str + :param impacted_value: The resource identified by Advisor. + :type impacted_value: str + :param last_updated: The most recent time that Advisor checked the + validity of the recommendation. + :type last_updated: datetime + :param metadata: The recommendation metadata. + :type metadata: dict[str, object] + :param recommendation_type_id: The recommendation-type GUID. + :type recommendation_type_id: str + :param risk: The potential risk of not implementing the recommendation. + Possible values include: 'Error', 'Warning', 'None' + :type risk: str or ~azure.mgmt.advisor.models.Risk + :param short_description: A summary of the recommendation. + :type short_description: ~azure.mgmt.advisor.models.ShortDescription + :param suppression_ids: The list of snoozed and dismissed rules for the + recommendation. + :type suppression_ids: list[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'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'impact': {'key': 'properties.impact', 'type': 'str'}, + 'impacted_field': {'key': 'properties.impactedField', 'type': 'str'}, + 'impacted_value': {'key': 'properties.impactedValue', 'type': 'str'}, + 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{object}'}, + 'recommendation_type_id': {'key': 'properties.recommendationTypeId', 'type': 'str'}, + 'risk': {'key': 'properties.risk', 'type': 'str'}, + 'short_description': {'key': 'properties.shortDescription', 'type': 'ShortDescription'}, + 'suppression_ids': {'key': 'properties.suppressionIds', 'type': '[str]'}, + } + + def __init__(self, *, category=None, impact=None, impacted_field: str=None, impacted_value: str=None, last_updated=None, metadata=None, recommendation_type_id: str=None, risk=None, short_description=None, suppression_ids=None, **kwargs) -> None: + super(ResourceRecommendationBase, self).__init__(, **kwargs) + self.category = category + self.impact = impact + self.impacted_field = impacted_field + self.impacted_value = impacted_value + self.last_updated = last_updated + self.metadata = metadata + self.recommendation_type_id = recommendation_type_id + self.risk = risk + self.short_description = short_description + self.suppression_ids = suppression_ids diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description.py index ba93541a0671..f2c722033a30 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description.py @@ -26,7 +26,7 @@ class ShortDescription(Model): 'solution': {'key': 'solution', 'type': 'str'}, } - def __init__(self, problem=None, solution=None): - super(ShortDescription, self).__init__() - self.problem = problem - self.solution = solution + def __init__(self, **kwargs): + super(ShortDescription, self).__init__(**kwargs) + self.problem = kwargs.get('problem', None) + self.solution = kwargs.get('solution', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description_py3.py new file mode 100644 index 000000000000..ed3b7bd29aa2 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ShortDescription(Model): + """A summary of the recommendation. + + :param problem: The issue or opportunity identified by the recommendation. + :type problem: str + :param solution: The remediation action suggested by the recommendation. + :type solution: str + """ + + _attribute_map = { + 'problem': {'key': 'problem', 'type': 'str'}, + 'solution': {'key': 'solution', 'type': 'str'}, + } + + def __init__(self, *, problem: str=None, solution: str=None, **kwargs) -> None: + super(ShortDescription, self).__init__(**kwargs) + self.problem = problem + self.solution = solution diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract.py index 358d6c239e36..ff9cc1012dbd 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract.py @@ -45,7 +45,7 @@ class SuppressionContract(Resource): 'ttl': {'key': 'properties.ttl', 'type': 'str'}, } - def __init__(self, suppression_id=None, ttl=None): - super(SuppressionContract, self).__init__() - self.suppression_id = suppression_id - self.ttl = ttl + def __init__(self, **kwargs): + super(SuppressionContract, self).__init__(**kwargs) + self.suppression_id = kwargs.get('suppression_id', None) + self.ttl = kwargs.get('ttl', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract_py3.py new file mode 100644 index 000000000000..d25f9c395610 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract_py3.py @@ -0,0 +1,51 @@ +# 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 .resource import Resource + + +class SuppressionContract(Resource): + """The details of the snoozed or dismissed rule; for example, the duration, + name, and GUID associated with the rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param suppression_id: The GUID of the suppression. + :type suppression_id: str + :param ttl: The duration for which the suppression is valid. + :type ttl: 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'}, + 'suppression_id': {'key': 'properties.suppressionId', 'type': 'str'}, + 'ttl': {'key': 'properties.ttl', 'type': 'str'}, + } + + def __init__(self, *, suppression_id: str=None, ttl: str=None, **kwargs) -> None: + super(SuppressionContract, self).__init__(, **kwargs) + self.suppression_id = suppression_id + self.ttl = ttl diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/operations/configurations_operations.py b/azure-mgmt-advisor/azure/mgmt/advisor/operations/configurations_operations.py index 9a03137ea165..04586c6d5864 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/operations/configurations_operations.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/operations/configurations_operations.py @@ -22,7 +22,7 @@ class ConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19". """ @@ -58,7 +58,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations' + url = self.list_by_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,6 +103,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations'} def create_in_subscription( self, config_contract, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def create_in_subscription( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations' + url = self.create_in_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -168,6 +169,7 @@ def create_in_subscription( return client_raw_response return deserialized + create_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations'} def list_by_resource_group( self, resource_group, custom_headers=None, raw=False, **operation_config): @@ -189,7 +191,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str') @@ -235,6 +237,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations'} def create_in_resource_group( self, config_contract, resource_group, custom_headers=None, raw=False, **operation_config): @@ -256,7 +259,7 @@ def create_in_resource_group( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations' + url = self.create_in_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str') @@ -300,3 +303,4 @@ def create_in_resource_group( return client_raw_response return deserialized + create_in_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations'} diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/operations/operations.py b/azure-mgmt-advisor/azure/mgmt/advisor/operations/operations.py index b1c46006013e..d21c47368ac2 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/operations/operations.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Advisor/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Advisor/operations'} diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py b/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py index fc25a7a6ef45..18965d1a213e 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RecommendationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19". """ @@ -55,7 +55,7 @@ def generate( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations' + url = self.generate.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -91,12 +91,13 @@ def generate( 'Retry-After': 'str', }) return client_raw_response + generate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations'} def _get_generate_status_initial( self, operation_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations/{operationId}' + url = self.get_generate_status.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'operationId': self._serialize.url("operation_id", operation_id, 'str') @@ -131,7 +132,7 @@ def _get_generate_status_initial( return client_raw_response def get_generate_status( - self, operation_id, custom_headers=None, raw=False, **operation_config): + self, operation_id, custom_headers=None, raw=False, polling=True, **operation_config): """Retrieves the status of the recommendation computation or generation process. Invoke this API after calling the generation recommendation. The URI of this API is returned in the Location field of the response @@ -141,12 +142,14 @@ def get_generate_status( Location field in the generate recommendation response header. :type operation_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._get_generate_status_initial( @@ -155,40 +158,20 @@ def get_generate_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_generate_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations/{operationId}'} def list( self, filter=None, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): @@ -217,7 +200,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/recommendations' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -268,6 +251,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/recommendations'} def get( self, resource_uri, recommendation_id, custom_headers=None, raw=False, **operation_config): @@ -289,7 +273,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'), 'recommendationId': self._serialize.url("recommendation_id", recommendation_id, 'str') @@ -329,3 +313,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}'} diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/operations/suppressions_operations.py b/azure-mgmt-advisor/azure/mgmt/advisor/operations/suppressions_operations.py index 6c7806bc57e9..d3a9e85d47c8 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/operations/suppressions_operations.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/operations/suppressions_operations.py @@ -22,7 +22,7 @@ class SuppressionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19". """ @@ -59,7 +59,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'), 'recommendationId': self._serialize.url("recommendation_id", recommendation_id, 'str'), @@ -100,6 +100,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'} def create( self, resource_uri, recommendation_id, name, suppression_id=None, ttl=None, custom_headers=None, raw=False, **operation_config): @@ -132,7 +133,7 @@ def create( suppression_contract = models.SuppressionContract(suppression_id=suppression_id, ttl=ttl) # Construct URL - url = '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'), 'recommendationId': self._serialize.url("recommendation_id", recommendation_id, 'str'), @@ -177,6 +178,7 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'} def delete( self, resource_uri, recommendation_id, name, custom_headers=None, raw=False, **operation_config): @@ -201,7 +203,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'), 'recommendationId': self._serialize.url("recommendation_id", recommendation_id, 'str'), @@ -235,6 +237,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'} def list( self, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): @@ -262,7 +265,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/suppressions' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -311,3 +314,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/suppressions'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/__init__.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/__init__.py new file mode 100644 index 000000000000..a25abe1811a6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/__init__.py @@ -0,0 +1,18 @@ +# 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 .api_management_client import ApiManagementClient +from .version import VERSION + +__all__ = ['ApiManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/api_management_client.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/api_management_client.py new file mode 100644 index 000000000000..430a960255ec --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/api_management_client.py @@ -0,0 +1,360 @@ +# 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 msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.policy_operations import PolicyOperations +from .operations.policy_snippets_operations import PolicySnippetsOperations +from .operations.regions_operations import RegionsOperations +from .operations.api_operations import ApiOperations +from .operations.api_revisions_operations import ApiRevisionsOperations +from .operations.api_release_operations import ApiReleaseOperations +from .operations.api_operation_operations import ApiOperationOperations +from .operations.api_operation_policy_operations import ApiOperationPolicyOperations +from .operations.api_product_operations import ApiProductOperations +from .operations.api_policy_operations import ApiPolicyOperations +from .operations.api_schema_operations import ApiSchemaOperations +from .operations.api_diagnostic_operations import ApiDiagnosticOperations +from .operations.api_diagnostic_logger_operations import ApiDiagnosticLoggerOperations +from .operations.authorization_server_operations import AuthorizationServerOperations +from .operations.backend_operations import BackendOperations +from .operations.certificate_operations import CertificateOperations +from .operations.api_management_operations import ApiManagementOperations +from .operations.api_management_service_operations import ApiManagementServiceOperations +from .operations.diagnostic_operations import DiagnosticOperations +from .operations.diagnostic_logger_operations import DiagnosticLoggerOperations +from .operations.email_template_operations import EmailTemplateOperations +from .operations.group_operations import GroupOperations +from .operations.group_user_operations import GroupUserOperations +from .operations.identity_provider_operations import IdentityProviderOperations +from .operations.logger_operations import LoggerOperations +from .operations.notification_operations import NotificationOperations +from .operations.notification_recipient_user_operations import NotificationRecipientUserOperations +from .operations.notification_recipient_email_operations import NotificationRecipientEmailOperations +from .operations.network_status_operations import NetworkStatusOperations +from .operations.open_id_connect_provider_operations import OpenIdConnectProviderOperations +from .operations.sign_in_settings_operations import SignInSettingsOperations +from .operations.sign_up_settings_operations import SignUpSettingsOperations +from .operations.delegation_settings_operations import DelegationSettingsOperations +from .operations.product_operations import ProductOperations +from .operations.product_api_operations import ProductApiOperations +from .operations.product_group_operations import ProductGroupOperations +from .operations.product_subscriptions_operations import ProductSubscriptionsOperations +from .operations.product_policy_operations import ProductPolicyOperations +from .operations.property_operations import PropertyOperations +from .operations.quota_by_counter_keys_operations import QuotaByCounterKeysOperations +from .operations.quota_by_period_keys_operations import QuotaByPeriodKeysOperations +from .operations.reports_operations import ReportsOperations +from .operations.subscription_operations import SubscriptionOperations +from .operations.tag_resource_operations import TagResourceOperations +from .operations.tag_operations import TagOperations +from .operations.tag_description_operations import TagDescriptionOperations +from .operations.operation_operations import OperationOperations +from .operations.tenant_access_operations import TenantAccessOperations +from .operations.tenant_access_git_operations import TenantAccessGitOperations +from .operations.tenant_configuration_operations import TenantConfigurationOperations +from .operations.user_operations import UserOperations +from .operations.user_group_operations import UserGroupOperations +from .operations.user_subscription_operations import UserSubscriptionOperations +from .operations.user_identities_operations import UserIdentitiesOperations +from .operations.api_version_set_operations import ApiVersionSetOperations +from .operations.api_export_operations import ApiExportOperations +from . import models + + +class ApiManagementClientConfiguration(AzureConfiguration): + """Configuration for ApiManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :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 + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(ApiManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-apimanagement/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class ApiManagementClient(object): + """ApiManagement Client + + :ivar config: Configuration for client. + :vartype config: ApiManagementClientConfiguration + + :ivar policy: Policy operations + :vartype policy: azure.mgmt.apimanagement.operations.PolicyOperations + :ivar policy_snippets: PolicySnippets operations + :vartype policy_snippets: azure.mgmt.apimanagement.operations.PolicySnippetsOperations + :ivar regions: Regions operations + :vartype regions: azure.mgmt.apimanagement.operations.RegionsOperations + :ivar api: Api operations + :vartype api: azure.mgmt.apimanagement.operations.ApiOperations + :ivar api_revisions: ApiRevisions operations + :vartype api_revisions: azure.mgmt.apimanagement.operations.ApiRevisionsOperations + :ivar api_release: ApiRelease operations + :vartype api_release: azure.mgmt.apimanagement.operations.ApiReleaseOperations + :ivar api_operation: ApiOperation operations + :vartype api_operation: azure.mgmt.apimanagement.operations.ApiOperationOperations + :ivar api_operation_policy: ApiOperationPolicy operations + :vartype api_operation_policy: azure.mgmt.apimanagement.operations.ApiOperationPolicyOperations + :ivar api_product: ApiProduct operations + :vartype api_product: azure.mgmt.apimanagement.operations.ApiProductOperations + :ivar api_policy: ApiPolicy operations + :vartype api_policy: azure.mgmt.apimanagement.operations.ApiPolicyOperations + :ivar api_schema: ApiSchema operations + :vartype api_schema: azure.mgmt.apimanagement.operations.ApiSchemaOperations + :ivar api_diagnostic: ApiDiagnostic operations + :vartype api_diagnostic: azure.mgmt.apimanagement.operations.ApiDiagnosticOperations + :ivar api_diagnostic_logger: ApiDiagnosticLogger operations + :vartype api_diagnostic_logger: azure.mgmt.apimanagement.operations.ApiDiagnosticLoggerOperations + :ivar authorization_server: AuthorizationServer operations + :vartype authorization_server: azure.mgmt.apimanagement.operations.AuthorizationServerOperations + :ivar backend: Backend operations + :vartype backend: azure.mgmt.apimanagement.operations.BackendOperations + :ivar certificate: Certificate operations + :vartype certificate: azure.mgmt.apimanagement.operations.CertificateOperations + :ivar api_management_operations: ApiManagementOperations operations + :vartype api_management_operations: azure.mgmt.apimanagement.operations.ApiManagementOperations + :ivar api_management_service: ApiManagementService operations + :vartype api_management_service: azure.mgmt.apimanagement.operations.ApiManagementServiceOperations + :ivar diagnostic: Diagnostic operations + :vartype diagnostic: azure.mgmt.apimanagement.operations.DiagnosticOperations + :ivar diagnostic_logger: DiagnosticLogger operations + :vartype diagnostic_logger: azure.mgmt.apimanagement.operations.DiagnosticLoggerOperations + :ivar email_template: EmailTemplate operations + :vartype email_template: azure.mgmt.apimanagement.operations.EmailTemplateOperations + :ivar group: Group operations + :vartype group: azure.mgmt.apimanagement.operations.GroupOperations + :ivar group_user: GroupUser operations + :vartype group_user: azure.mgmt.apimanagement.operations.GroupUserOperations + :ivar identity_provider: IdentityProvider operations + :vartype identity_provider: azure.mgmt.apimanagement.operations.IdentityProviderOperations + :ivar logger: Logger operations + :vartype logger: azure.mgmt.apimanagement.operations.LoggerOperations + :ivar notification: Notification operations + :vartype notification: azure.mgmt.apimanagement.operations.NotificationOperations + :ivar notification_recipient_user: NotificationRecipientUser operations + :vartype notification_recipient_user: azure.mgmt.apimanagement.operations.NotificationRecipientUserOperations + :ivar notification_recipient_email: NotificationRecipientEmail operations + :vartype notification_recipient_email: azure.mgmt.apimanagement.operations.NotificationRecipientEmailOperations + :ivar network_status: NetworkStatus operations + :vartype network_status: azure.mgmt.apimanagement.operations.NetworkStatusOperations + :ivar open_id_connect_provider: OpenIdConnectProvider operations + :vartype open_id_connect_provider: azure.mgmt.apimanagement.operations.OpenIdConnectProviderOperations + :ivar sign_in_settings: SignInSettings operations + :vartype sign_in_settings: azure.mgmt.apimanagement.operations.SignInSettingsOperations + :ivar sign_up_settings: SignUpSettings operations + :vartype sign_up_settings: azure.mgmt.apimanagement.operations.SignUpSettingsOperations + :ivar delegation_settings: DelegationSettings operations + :vartype delegation_settings: azure.mgmt.apimanagement.operations.DelegationSettingsOperations + :ivar product: Product operations + :vartype product: azure.mgmt.apimanagement.operations.ProductOperations + :ivar product_api: ProductApi operations + :vartype product_api: azure.mgmt.apimanagement.operations.ProductApiOperations + :ivar product_group: ProductGroup operations + :vartype product_group: azure.mgmt.apimanagement.operations.ProductGroupOperations + :ivar product_subscriptions: ProductSubscriptions operations + :vartype product_subscriptions: azure.mgmt.apimanagement.operations.ProductSubscriptionsOperations + :ivar product_policy: ProductPolicy operations + :vartype product_policy: azure.mgmt.apimanagement.operations.ProductPolicyOperations + :ivar property: Property operations + :vartype property: azure.mgmt.apimanagement.operations.PropertyOperations + :ivar quota_by_counter_keys: QuotaByCounterKeys operations + :vartype quota_by_counter_keys: azure.mgmt.apimanagement.operations.QuotaByCounterKeysOperations + :ivar quota_by_period_keys: QuotaByPeriodKeys operations + :vartype quota_by_period_keys: azure.mgmt.apimanagement.operations.QuotaByPeriodKeysOperations + :ivar reports: Reports operations + :vartype reports: azure.mgmt.apimanagement.operations.ReportsOperations + :ivar subscription: Subscription operations + :vartype subscription: azure.mgmt.apimanagement.operations.SubscriptionOperations + :ivar tag_resource: TagResource operations + :vartype tag_resource: azure.mgmt.apimanagement.operations.TagResourceOperations + :ivar tag: Tag operations + :vartype tag: azure.mgmt.apimanagement.operations.TagOperations + :ivar tag_description: TagDescription operations + :vartype tag_description: azure.mgmt.apimanagement.operations.TagDescriptionOperations + :ivar operation: Operation operations + :vartype operation: azure.mgmt.apimanagement.operations.OperationOperations + :ivar tenant_access: TenantAccess operations + :vartype tenant_access: azure.mgmt.apimanagement.operations.TenantAccessOperations + :ivar tenant_access_git: TenantAccessGit operations + :vartype tenant_access_git: azure.mgmt.apimanagement.operations.TenantAccessGitOperations + :ivar tenant_configuration: TenantConfiguration operations + :vartype tenant_configuration: azure.mgmt.apimanagement.operations.TenantConfigurationOperations + :ivar user: User operations + :vartype user: azure.mgmt.apimanagement.operations.UserOperations + :ivar user_group: UserGroup operations + :vartype user_group: azure.mgmt.apimanagement.operations.UserGroupOperations + :ivar user_subscription: UserSubscription operations + :vartype user_subscription: azure.mgmt.apimanagement.operations.UserSubscriptionOperations + :ivar user_identities: UserIdentities operations + :vartype user_identities: azure.mgmt.apimanagement.operations.UserIdentitiesOperations + :ivar api_version_set: ApiVersionSet operations + :vartype api_version_set: azure.mgmt.apimanagement.operations.ApiVersionSetOperations + :ivar api_export: ApiExport operations + :vartype api_export: azure.mgmt.apimanagement.operations.ApiExportOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :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 + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ApiManagementClientConfiguration(credentials, subscription_id, base_url) + self._client = ServiceClient(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-01-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.policy = PolicyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.policy_snippets = PolicySnippetsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.regions = RegionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api = ApiOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_revisions = ApiRevisionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_release = ApiReleaseOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_operation = ApiOperationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_operation_policy = ApiOperationPolicyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_product = ApiProductOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_policy = ApiPolicyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_schema = ApiSchemaOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_diagnostic = ApiDiagnosticOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_diagnostic_logger = ApiDiagnosticLoggerOperations( + self._client, self.config, self._serialize, self._deserialize) + self.authorization_server = AuthorizationServerOperations( + self._client, self.config, self._serialize, self._deserialize) + self.backend = BackendOperations( + self._client, self.config, self._serialize, self._deserialize) + self.certificate = CertificateOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_management_operations = ApiManagementOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_management_service = ApiManagementServiceOperations( + self._client, self.config, self._serialize, self._deserialize) + self.diagnostic = DiagnosticOperations( + self._client, self.config, self._serialize, self._deserialize) + self.diagnostic_logger = DiagnosticLoggerOperations( + self._client, self.config, self._serialize, self._deserialize) + self.email_template = EmailTemplateOperations( + self._client, self.config, self._serialize, self._deserialize) + self.group = GroupOperations( + self._client, self.config, self._serialize, self._deserialize) + self.group_user = GroupUserOperations( + self._client, self.config, self._serialize, self._deserialize) + self.identity_provider = IdentityProviderOperations( + self._client, self.config, self._serialize, self._deserialize) + self.logger = LoggerOperations( + self._client, self.config, self._serialize, self._deserialize) + self.notification = NotificationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.notification_recipient_user = NotificationRecipientUserOperations( + self._client, self.config, self._serialize, self._deserialize) + self.notification_recipient_email = NotificationRecipientEmailOperations( + self._client, self.config, self._serialize, self._deserialize) + self.network_status = NetworkStatusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.open_id_connect_provider = OpenIdConnectProviderOperations( + self._client, self.config, self._serialize, self._deserialize) + self.sign_in_settings = SignInSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.sign_up_settings = SignUpSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.delegation_settings = DelegationSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.product = ProductOperations( + self._client, self.config, self._serialize, self._deserialize) + self.product_api = ProductApiOperations( + self._client, self.config, self._serialize, self._deserialize) + self.product_group = ProductGroupOperations( + self._client, self.config, self._serialize, self._deserialize) + self.product_subscriptions = ProductSubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.product_policy = ProductPolicyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.property = PropertyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.quota_by_counter_keys = QuotaByCounterKeysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.quota_by_period_keys = QuotaByPeriodKeysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.reports = ReportsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.subscription = SubscriptionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tag_resource = TagResourceOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tag = TagOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tag_description = TagDescriptionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tenant_access = TenantAccessOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tenant_access_git = TenantAccessGitOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tenant_configuration = TenantConfigurationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.user = UserOperations( + self._client, self.config, self._serialize, self._deserialize) + self.user_group = UserGroupOperations( + self._client, self.config, self._serialize, self._deserialize) + self.user_subscription = UserSubscriptionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.user_identities = UserIdentitiesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_version_set = ApiVersionSetOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_export = ApiExportOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py new file mode 100644 index 000000000000..d9da2332eed5 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py @@ -0,0 +1,554 @@ +# 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 .error_field_contract_py3 import ErrorFieldContract + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .policy_contract_py3 import PolicyContract + from .policy_collection_py3 import PolicyCollection + from .policy_snippet_contract_py3 import PolicySnippetContract + from .policy_snippets_collection_py3 import PolicySnippetsCollection + from .region_contract_py3 import RegionContract + from .resource_py3 import Resource + from .api_export_result_py3 import ApiExportResult + from .api_version_set_contract_details_py3 import ApiVersionSetContractDetails + from .api_contract_properties_py3 import ApiContractProperties + from .api_contract_py3 import ApiContract + from .api_create_or_update_properties_wsdl_selector_py3 import ApiCreateOrUpdatePropertiesWsdlSelector + from .api_create_or_update_parameter_py3 import ApiCreateOrUpdateParameter + from .api_update_contract_py3 import ApiUpdateContract + from .oauth2_authentication_settings_contract_py3 import OAuth2AuthenticationSettingsContract + from .authentication_settings_contract_py3 import AuthenticationSettingsContract + from .subscription_key_parameter_names_contract_py3 import SubscriptionKeyParameterNamesContract + from .api_entity_base_contract_py3 import ApiEntityBaseContract + from .api_revision_contract_py3 import ApiRevisionContract + from .api_revision_info_contract_py3 import ApiRevisionInfoContract + from .api_release_contract_py3 import ApiReleaseContract + from .operation_contract_py3 import OperationContract + from .parameter_contract_py3 import ParameterContract + from .representation_contract_py3 import RepresentationContract + from .request_contract_py3 import RequestContract + from .response_contract_py3 import ResponseContract + from .operation_entity_base_contract_py3 import OperationEntityBaseContract + from .operation_update_contract_py3 import OperationUpdateContract + from .schema_contract_py3 import SchemaContract + from .logger_contract_py3 import LoggerContract + from .diagnostic_contract_py3 import DiagnosticContract + from .product_entity_base_parameters_py3 import ProductEntityBaseParameters + from .product_tag_resource_contract_properties_py3 import ProductTagResourceContractProperties + from .operation_tag_resource_contract_properties_py3 import OperationTagResourceContractProperties + from .api_tag_resource_contract_properties_py3 import ApiTagResourceContractProperties + from .tag_tag_resource_contract_properties_py3 import TagTagResourceContractProperties + from .tag_resource_contract_py3 import TagResourceContract + from .product_contract_py3 import ProductContract + from .authorization_server_contract_py3 import AuthorizationServerContract + from .authorization_server_update_contract_py3 import AuthorizationServerUpdateContract + from .token_body_parameter_contract_py3 import TokenBodyParameterContract + from .authorization_server_contract_base_properties_py3 import AuthorizationServerContractBaseProperties + from .backend_authorization_header_credentials_py3 import BackendAuthorizationHeaderCredentials + from .x509_certificate_name_py3 import X509CertificateName + from .backend_service_fabric_cluster_properties_py3 import BackendServiceFabricClusterProperties + from .backend_properties_py3 import BackendProperties + from .backend_credentials_contract_py3 import BackendCredentialsContract + from .backend_proxy_contract_py3 import BackendProxyContract + from .backend_tls_properties_py3 import BackendTlsProperties + from .backend_base_parameters_py3 import BackendBaseParameters + from .backend_contract_py3 import BackendContract + from .backend_update_parameters_py3 import BackendUpdateParameters + from .backend_reconnect_contract_py3 import BackendReconnectContract + from .certificate_contract_py3 import CertificateContract + from .certificate_create_or_update_parameters_py3 import CertificateCreateOrUpdateParameters + from .certificate_information_py3 import CertificateInformation + from .certificate_configuration_py3 import CertificateConfiguration + from .hostname_configuration_py3 import HostnameConfiguration + from .virtual_network_configuration_py3 import VirtualNetworkConfiguration + from .api_management_service_sku_properties_py3 import ApiManagementServiceSkuProperties + from .additional_location_py3 import AdditionalLocation + from .api_management_service_backup_restore_parameters_py3 import ApiManagementServiceBackupRestoreParameters + from .api_management_service_base_properties_py3 import ApiManagementServiceBaseProperties + from .api_management_service_identity_py3 import ApiManagementServiceIdentity + from .api_management_service_resource_py3 import ApiManagementServiceResource + from .apim_resource_py3 import ApimResource + from .api_management_service_update_parameters_py3 import ApiManagementServiceUpdateParameters + from .api_management_service_get_sso_token_result_py3 import ApiManagementServiceGetSsoTokenResult + from .api_management_service_check_name_availability_parameters_py3 import ApiManagementServiceCheckNameAvailabilityParameters + from .api_management_service_name_availability_result_py3 import ApiManagementServiceNameAvailabilityResult + from .api_management_service_apply_network_configuration_parameters_py3 import ApiManagementServiceApplyNetworkConfigurationParameters + from .api_management_service_upload_certificate_parameters_py3 import ApiManagementServiceUploadCertificateParameters + from .hostname_configuration_old_py3 import HostnameConfigurationOld + from .api_management_service_update_hostname_parameters_py3 import ApiManagementServiceUpdateHostnameParameters + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .email_template_parameters_contract_properties_py3 import EmailTemplateParametersContractProperties + from .email_template_contract_py3 import EmailTemplateContract + from .email_template_update_parameters_py3 import EmailTemplateUpdateParameters + from .group_contract_properties_py3 import GroupContractProperties + from .group_contract_py3 import GroupContract + from .group_create_parameters_py3 import GroupCreateParameters + from .group_update_parameters_py3 import GroupUpdateParameters + from .user_identity_contract_py3 import UserIdentityContract + from .user_entity_base_parameters_py3 import UserEntityBaseParameters + from .user_contract_py3 import UserContract + from .identity_provider_contract_py3 import IdentityProviderContract + from .identity_provider_update_parameters_py3 import IdentityProviderUpdateParameters + from .identity_provider_base_parameters_py3 import IdentityProviderBaseParameters + from .logger_update_contract_py3 import LoggerUpdateContract + from .recipients_contract_properties_py3 import RecipientsContractProperties + from .notification_contract_py3 import NotificationContract + from .recipient_user_contract_py3 import RecipientUserContract + from .recipient_user_collection_py3 import RecipientUserCollection + from .recipient_email_contract_py3 import RecipientEmailContract + from .recipient_email_collection_py3 import RecipientEmailCollection + from .connectivity_status_contract_py3 import ConnectivityStatusContract + from .network_status_contract_py3 import NetworkStatusContract + from .network_status_contract_by_location_py3 import NetworkStatusContractByLocation + from .openid_connect_provider_contract_py3 import OpenidConnectProviderContract + from .openid_connect_provider_update_contract_py3 import OpenidConnectProviderUpdateContract + from .portal_signin_settings_py3 import PortalSigninSettings + from .terms_of_service_properties_py3 import TermsOfServiceProperties + from .portal_signup_settings_py3 import PortalSignupSettings + from .subscriptions_delegation_settings_properties_py3 import SubscriptionsDelegationSettingsProperties + from .registration_delegation_settings_properties_py3 import RegistrationDelegationSettingsProperties + from .portal_delegation_settings_py3 import PortalDelegationSettings + from .product_update_parameters_py3 import ProductUpdateParameters + from .subscription_contract_py3 import SubscriptionContract + from .property_contract_py3 import PropertyContract + from .property_update_parameters_py3 import PropertyUpdateParameters + from .property_entity_base_parameters_py3 import PropertyEntityBaseParameters + from .quota_counter_value_contract_properties_py3 import QuotaCounterValueContractProperties + from .quota_counter_contract_py3 import QuotaCounterContract + from .quota_counter_collection_py3 import QuotaCounterCollection + from .quota_counter_value_contract_py3 import QuotaCounterValueContract + from .report_record_contract_py3 import ReportRecordContract + from .request_report_record_contract_py3 import RequestReportRecordContract + from .subscription_create_parameters_py3 import SubscriptionCreateParameters + from .subscription_update_parameters_py3 import SubscriptionUpdateParameters + from .tag_contract_py3 import TagContract + from .tag_create_update_parameters_py3 import TagCreateUpdateParameters + from .tag_description_contract_py3 import TagDescriptionContract + from .tag_description_create_parameters_py3 import TagDescriptionCreateParameters + from .access_information_contract_py3 import AccessInformationContract + from .access_information_update_parameters_py3 import AccessInformationUpdateParameters + from .deploy_configuration_parameters_py3 import DeployConfigurationParameters + from .operation_result_log_item_contract_py3 import OperationResultLogItemContract + from .operation_result_contract_py3 import OperationResultContract + from .save_configuration_parameter_py3 import SaveConfigurationParameter + from .tenant_configuration_sync_state_contract_py3 import TenantConfigurationSyncStateContract + from .generate_sso_url_result_py3 import GenerateSsoUrlResult + from .user_create_parameters_py3 import UserCreateParameters + from .user_token_parameters_py3 import UserTokenParameters + from .user_token_result_py3 import UserTokenResult + from .user_update_parameters_py3 import UserUpdateParameters + from .api_version_set_contract_py3 import ApiVersionSetContract + from .api_version_set_entity_base_py3 import ApiVersionSetEntityBase + from .api_version_set_update_parameters_py3 import ApiVersionSetUpdateParameters +except (SyntaxError, ImportError): + from .error_field_contract import ErrorFieldContract + from .error_response import ErrorResponse, ErrorResponseException + from .policy_contract import PolicyContract + from .policy_collection import PolicyCollection + from .policy_snippet_contract import PolicySnippetContract + from .policy_snippets_collection import PolicySnippetsCollection + from .region_contract import RegionContract + from .resource import Resource + from .api_export_result import ApiExportResult + from .api_version_set_contract_details import ApiVersionSetContractDetails + from .api_contract_properties import ApiContractProperties + from .api_contract import ApiContract + from .api_create_or_update_properties_wsdl_selector import ApiCreateOrUpdatePropertiesWsdlSelector + from .api_create_or_update_parameter import ApiCreateOrUpdateParameter + from .api_update_contract import ApiUpdateContract + from .oauth2_authentication_settings_contract import OAuth2AuthenticationSettingsContract + from .authentication_settings_contract import AuthenticationSettingsContract + from .subscription_key_parameter_names_contract import SubscriptionKeyParameterNamesContract + from .api_entity_base_contract import ApiEntityBaseContract + from .api_revision_contract import ApiRevisionContract + from .api_revision_info_contract import ApiRevisionInfoContract + from .api_release_contract import ApiReleaseContract + from .operation_contract import OperationContract + from .parameter_contract import ParameterContract + from .representation_contract import RepresentationContract + from .request_contract import RequestContract + from .response_contract import ResponseContract + from .operation_entity_base_contract import OperationEntityBaseContract + from .operation_update_contract import OperationUpdateContract + from .schema_contract import SchemaContract + from .logger_contract import LoggerContract + from .diagnostic_contract import DiagnosticContract + from .product_entity_base_parameters import ProductEntityBaseParameters + from .product_tag_resource_contract_properties import ProductTagResourceContractProperties + from .operation_tag_resource_contract_properties import OperationTagResourceContractProperties + from .api_tag_resource_contract_properties import ApiTagResourceContractProperties + from .tag_tag_resource_contract_properties import TagTagResourceContractProperties + from .tag_resource_contract import TagResourceContract + from .product_contract import ProductContract + from .authorization_server_contract import AuthorizationServerContract + from .authorization_server_update_contract import AuthorizationServerUpdateContract + from .token_body_parameter_contract import TokenBodyParameterContract + from .authorization_server_contract_base_properties import AuthorizationServerContractBaseProperties + from .backend_authorization_header_credentials import BackendAuthorizationHeaderCredentials + from .x509_certificate_name import X509CertificateName + from .backend_service_fabric_cluster_properties import BackendServiceFabricClusterProperties + from .backend_properties import BackendProperties + from .backend_credentials_contract import BackendCredentialsContract + from .backend_proxy_contract import BackendProxyContract + from .backend_tls_properties import BackendTlsProperties + from .backend_base_parameters import BackendBaseParameters + from .backend_contract import BackendContract + from .backend_update_parameters import BackendUpdateParameters + from .backend_reconnect_contract import BackendReconnectContract + from .certificate_contract import CertificateContract + from .certificate_create_or_update_parameters import CertificateCreateOrUpdateParameters + from .certificate_information import CertificateInformation + from .certificate_configuration import CertificateConfiguration + from .hostname_configuration import HostnameConfiguration + from .virtual_network_configuration import VirtualNetworkConfiguration + from .api_management_service_sku_properties import ApiManagementServiceSkuProperties + from .additional_location import AdditionalLocation + from .api_management_service_backup_restore_parameters import ApiManagementServiceBackupRestoreParameters + from .api_management_service_base_properties import ApiManagementServiceBaseProperties + from .api_management_service_identity import ApiManagementServiceIdentity + from .api_management_service_resource import ApiManagementServiceResource + from .apim_resource import ApimResource + from .api_management_service_update_parameters import ApiManagementServiceUpdateParameters + from .api_management_service_get_sso_token_result import ApiManagementServiceGetSsoTokenResult + from .api_management_service_check_name_availability_parameters import ApiManagementServiceCheckNameAvailabilityParameters + from .api_management_service_name_availability_result import ApiManagementServiceNameAvailabilityResult + from .api_management_service_apply_network_configuration_parameters import ApiManagementServiceApplyNetworkConfigurationParameters + from .api_management_service_upload_certificate_parameters import ApiManagementServiceUploadCertificateParameters + from .hostname_configuration_old import HostnameConfigurationOld + from .api_management_service_update_hostname_parameters import ApiManagementServiceUpdateHostnameParameters + from .operation_display import OperationDisplay + from .operation import Operation + from .email_template_parameters_contract_properties import EmailTemplateParametersContractProperties + from .email_template_contract import EmailTemplateContract + from .email_template_update_parameters import EmailTemplateUpdateParameters + from .group_contract_properties import GroupContractProperties + from .group_contract import GroupContract + from .group_create_parameters import GroupCreateParameters + from .group_update_parameters import GroupUpdateParameters + from .user_identity_contract import UserIdentityContract + from .user_entity_base_parameters import UserEntityBaseParameters + from .user_contract import UserContract + from .identity_provider_contract import IdentityProviderContract + from .identity_provider_update_parameters import IdentityProviderUpdateParameters + from .identity_provider_base_parameters import IdentityProviderBaseParameters + from .logger_update_contract import LoggerUpdateContract + from .recipients_contract_properties import RecipientsContractProperties + from .notification_contract import NotificationContract + from .recipient_user_contract import RecipientUserContract + from .recipient_user_collection import RecipientUserCollection + from .recipient_email_contract import RecipientEmailContract + from .recipient_email_collection import RecipientEmailCollection + from .connectivity_status_contract import ConnectivityStatusContract + from .network_status_contract import NetworkStatusContract + from .network_status_contract_by_location import NetworkStatusContractByLocation + from .openid_connect_provider_contract import OpenidConnectProviderContract + from .openid_connect_provider_update_contract import OpenidConnectProviderUpdateContract + from .portal_signin_settings import PortalSigninSettings + from .terms_of_service_properties import TermsOfServiceProperties + from .portal_signup_settings import PortalSignupSettings + from .subscriptions_delegation_settings_properties import SubscriptionsDelegationSettingsProperties + from .registration_delegation_settings_properties import RegistrationDelegationSettingsProperties + from .portal_delegation_settings import PortalDelegationSettings + from .product_update_parameters import ProductUpdateParameters + from .subscription_contract import SubscriptionContract + from .property_contract import PropertyContract + from .property_update_parameters import PropertyUpdateParameters + from .property_entity_base_parameters import PropertyEntityBaseParameters + from .quota_counter_value_contract_properties import QuotaCounterValueContractProperties + from .quota_counter_contract import QuotaCounterContract + from .quota_counter_collection import QuotaCounterCollection + from .quota_counter_value_contract import QuotaCounterValueContract + from .report_record_contract import ReportRecordContract + from .request_report_record_contract import RequestReportRecordContract + from .subscription_create_parameters import SubscriptionCreateParameters + from .subscription_update_parameters import SubscriptionUpdateParameters + from .tag_contract import TagContract + from .tag_create_update_parameters import TagCreateUpdateParameters + from .tag_description_contract import TagDescriptionContract + from .tag_description_create_parameters import TagDescriptionCreateParameters + from .access_information_contract import AccessInformationContract + from .access_information_update_parameters import AccessInformationUpdateParameters + from .deploy_configuration_parameters import DeployConfigurationParameters + from .operation_result_log_item_contract import OperationResultLogItemContract + from .operation_result_contract import OperationResultContract + from .save_configuration_parameter import SaveConfigurationParameter + from .tenant_configuration_sync_state_contract import TenantConfigurationSyncStateContract + from .generate_sso_url_result import GenerateSsoUrlResult + from .user_create_parameters import UserCreateParameters + from .user_token_parameters import UserTokenParameters + from .user_token_result import UserTokenResult + from .user_update_parameters import UserUpdateParameters + from .api_version_set_contract import ApiVersionSetContract + from .api_version_set_entity_base import ApiVersionSetEntityBase + from .api_version_set_update_parameters import ApiVersionSetUpdateParameters +from .region_contract_paged import RegionContractPaged +from .api_contract_paged import ApiContractPaged +from .tag_resource_contract_paged import TagResourceContractPaged +from .api_revision_contract_paged import ApiRevisionContractPaged +from .api_release_contract_paged import ApiReleaseContractPaged +from .operation_contract_paged import OperationContractPaged +from .product_contract_paged import ProductContractPaged +from .schema_contract_paged import SchemaContractPaged +from .diagnostic_contract_paged import DiagnosticContractPaged +from .logger_contract_paged import LoggerContractPaged +from .authorization_server_contract_paged import AuthorizationServerContractPaged +from .backend_contract_paged import BackendContractPaged +from .certificate_contract_paged import CertificateContractPaged +from .operation_paged import OperationPaged +from .api_management_service_resource_paged import ApiManagementServiceResourcePaged +from .email_template_contract_paged import EmailTemplateContractPaged +from .group_contract_paged import GroupContractPaged +from .user_contract_paged import UserContractPaged +from .identity_provider_contract_paged import IdentityProviderContractPaged +from .notification_contract_paged import NotificationContractPaged +from .openid_connect_provider_contract_paged import OpenidConnectProviderContractPaged +from .subscription_contract_paged import SubscriptionContractPaged +from .property_contract_paged import PropertyContractPaged +from .report_record_contract_paged import ReportRecordContractPaged +from .request_report_record_contract_paged import RequestReportRecordContractPaged +from .tag_contract_paged import TagContractPaged +from .tag_description_contract_paged import TagDescriptionContractPaged +from .user_identity_contract_paged import UserIdentityContractPaged +from .api_version_set_contract_paged import ApiVersionSetContractPaged +from .api_management_client_enums import ( + PolicyContentFormat, + Protocol, + ContentFormat, + SoapApiType, + ApiType, + LoggerType, + ProductState, + GrantType, + AuthorizationMethod, + ClientAuthenticationMethod, + BearerTokenSendingMethod, + BackendProtocol, + HostnameType, + SkuType, + VirtualNetworkType, + NameAvailabilityReason, + GroupType, + Confirmation, + UserState, + IdentityProviderType, + ConnectivityStatusType, + SubscriptionState, + AsyncOperationStatus, + KeyType, + VersioningScheme, + TemplateName, + NotificationName, + PolicyScopeContract, + ExportFormat, +) + +__all__ = [ + 'ErrorFieldContract', + 'ErrorResponse', 'ErrorResponseException', + 'PolicyContract', + 'PolicyCollection', + 'PolicySnippetContract', + 'PolicySnippetsCollection', + 'RegionContract', + 'Resource', + 'ApiExportResult', + 'ApiVersionSetContractDetails', + 'ApiContractProperties', + 'ApiContract', + 'ApiCreateOrUpdatePropertiesWsdlSelector', + 'ApiCreateOrUpdateParameter', + 'ApiUpdateContract', + 'OAuth2AuthenticationSettingsContract', + 'AuthenticationSettingsContract', + 'SubscriptionKeyParameterNamesContract', + 'ApiEntityBaseContract', + 'ApiRevisionContract', + 'ApiRevisionInfoContract', + 'ApiReleaseContract', + 'OperationContract', + 'ParameterContract', + 'RepresentationContract', + 'RequestContract', + 'ResponseContract', + 'OperationEntityBaseContract', + 'OperationUpdateContract', + 'SchemaContract', + 'LoggerContract', + 'DiagnosticContract', + 'ProductEntityBaseParameters', + 'ProductTagResourceContractProperties', + 'OperationTagResourceContractProperties', + 'ApiTagResourceContractProperties', + 'TagTagResourceContractProperties', + 'TagResourceContract', + 'ProductContract', + 'AuthorizationServerContract', + 'AuthorizationServerUpdateContract', + 'TokenBodyParameterContract', + 'AuthorizationServerContractBaseProperties', + 'BackendAuthorizationHeaderCredentials', + 'X509CertificateName', + 'BackendServiceFabricClusterProperties', + 'BackendProperties', + 'BackendCredentialsContract', + 'BackendProxyContract', + 'BackendTlsProperties', + 'BackendBaseParameters', + 'BackendContract', + 'BackendUpdateParameters', + 'BackendReconnectContract', + 'CertificateContract', + 'CertificateCreateOrUpdateParameters', + 'CertificateInformation', + 'CertificateConfiguration', + 'HostnameConfiguration', + 'VirtualNetworkConfiguration', + 'ApiManagementServiceSkuProperties', + 'AdditionalLocation', + 'ApiManagementServiceBackupRestoreParameters', + 'ApiManagementServiceBaseProperties', + 'ApiManagementServiceIdentity', + 'ApiManagementServiceResource', + 'ApimResource', + 'ApiManagementServiceUpdateParameters', + 'ApiManagementServiceGetSsoTokenResult', + 'ApiManagementServiceCheckNameAvailabilityParameters', + 'ApiManagementServiceNameAvailabilityResult', + 'ApiManagementServiceApplyNetworkConfigurationParameters', + 'ApiManagementServiceUploadCertificateParameters', + 'HostnameConfigurationOld', + 'ApiManagementServiceUpdateHostnameParameters', + 'OperationDisplay', + 'Operation', + 'EmailTemplateParametersContractProperties', + 'EmailTemplateContract', + 'EmailTemplateUpdateParameters', + 'GroupContractProperties', + 'GroupContract', + 'GroupCreateParameters', + 'GroupUpdateParameters', + 'UserIdentityContract', + 'UserEntityBaseParameters', + 'UserContract', + 'IdentityProviderContract', + 'IdentityProviderUpdateParameters', + 'IdentityProviderBaseParameters', + 'LoggerUpdateContract', + 'RecipientsContractProperties', + 'NotificationContract', + 'RecipientUserContract', + 'RecipientUserCollection', + 'RecipientEmailContract', + 'RecipientEmailCollection', + 'ConnectivityStatusContract', + 'NetworkStatusContract', + 'NetworkStatusContractByLocation', + 'OpenidConnectProviderContract', + 'OpenidConnectProviderUpdateContract', + 'PortalSigninSettings', + 'TermsOfServiceProperties', + 'PortalSignupSettings', + 'SubscriptionsDelegationSettingsProperties', + 'RegistrationDelegationSettingsProperties', + 'PortalDelegationSettings', + 'ProductUpdateParameters', + 'SubscriptionContract', + 'PropertyContract', + 'PropertyUpdateParameters', + 'PropertyEntityBaseParameters', + 'QuotaCounterValueContractProperties', + 'QuotaCounterContract', + 'QuotaCounterCollection', + 'QuotaCounterValueContract', + 'ReportRecordContract', + 'RequestReportRecordContract', + 'SubscriptionCreateParameters', + 'SubscriptionUpdateParameters', + 'TagContract', + 'TagCreateUpdateParameters', + 'TagDescriptionContract', + 'TagDescriptionCreateParameters', + 'AccessInformationContract', + 'AccessInformationUpdateParameters', + 'DeployConfigurationParameters', + 'OperationResultLogItemContract', + 'OperationResultContract', + 'SaveConfigurationParameter', + 'TenantConfigurationSyncStateContract', + 'GenerateSsoUrlResult', + 'UserCreateParameters', + 'UserTokenParameters', + 'UserTokenResult', + 'UserUpdateParameters', + 'ApiVersionSetContract', + 'ApiVersionSetEntityBase', + 'ApiVersionSetUpdateParameters', + 'RegionContractPaged', + 'ApiContractPaged', + 'TagResourceContractPaged', + 'ApiRevisionContractPaged', + 'ApiReleaseContractPaged', + 'OperationContractPaged', + 'ProductContractPaged', + 'SchemaContractPaged', + 'DiagnosticContractPaged', + 'LoggerContractPaged', + 'AuthorizationServerContractPaged', + 'BackendContractPaged', + 'CertificateContractPaged', + 'OperationPaged', + 'ApiManagementServiceResourcePaged', + 'EmailTemplateContractPaged', + 'GroupContractPaged', + 'UserContractPaged', + 'IdentityProviderContractPaged', + 'NotificationContractPaged', + 'OpenidConnectProviderContractPaged', + 'SubscriptionContractPaged', + 'PropertyContractPaged', + 'ReportRecordContractPaged', + 'RequestReportRecordContractPaged', + 'TagContractPaged', + 'TagDescriptionContractPaged', + 'UserIdentityContractPaged', + 'ApiVersionSetContractPaged', + 'PolicyContentFormat', + 'Protocol', + 'ContentFormat', + 'SoapApiType', + 'ApiType', + 'LoggerType', + 'ProductState', + 'GrantType', + 'AuthorizationMethod', + 'ClientAuthenticationMethod', + 'BearerTokenSendingMethod', + 'BackendProtocol', + 'HostnameType', + 'SkuType', + 'VirtualNetworkType', + 'NameAvailabilityReason', + 'GroupType', + 'Confirmation', + 'UserState', + 'IdentityProviderType', + 'ConnectivityStatusType', + 'SubscriptionState', + 'AsyncOperationStatus', + 'KeyType', + 'VersioningScheme', + 'TemplateName', + 'NotificationName', + 'PolicyScopeContract', + 'ExportFormat', +] diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_contract.py new file mode 100644 index 000000000000..a778b6ac2a7b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_contract.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AccessInformationContract(Model): + """Tenant access information contract of the API Management service. + + :param id: Identifier. + :type id: str + :param primary_key: Primary access key. + :type primary_key: str + :param secondary_key: Secondary access key. + :type secondary_key: str + :param enabled: Tenant access information of the API Management service. + :type enabled: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AccessInformationContract, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_contract_py3.py new file mode 100644 index 000000000000..b1420594eb3b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_contract_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AccessInformationContract(Model): + """Tenant access information contract of the API Management service. + + :param id: Identifier. + :type id: str + :param primary_key: Primary access key. + :type primary_key: str + :param secondary_key: Secondary access key. + :type secondary_key: str + :param enabled: Tenant access information of the API Management service. + :type enabled: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, primary_key: str=None, secondary_key: str=None, enabled: bool=None, **kwargs) -> None: + super(AccessInformationContract, self).__init__(**kwargs) + self.id = id + self.primary_key = primary_key + self.secondary_key = secondary_key + self.enabled = enabled diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_update_parameters.py new file mode 100644 index 000000000000..975cdec8a836 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_update_parameters.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class AccessInformationUpdateParameters(Model): + """Tenant access information update parameters of the API Management service. + + :param enabled: Tenant access information of the API Management service. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AccessInformationUpdateParameters, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_update_parameters_py3.py new file mode 100644 index 000000000000..1219fc588e6b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/access_information_update_parameters_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class AccessInformationUpdateParameters(Model): + """Tenant access information update parameters of the API Management service. + + :param enabled: Tenant access information of the API Management service. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(AccessInformationUpdateParameters, self).__init__(**kwargs) + self.enabled = enabled diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/additional_location.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/additional_location.py new file mode 100644 index 000000000000..b99c60ba207a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/additional_location.py @@ -0,0 +1,62 @@ +# 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 msrest.serialization import Model + + +class AdditionalLocation(Model): + """Description of an additional API Management resource 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. + + :param location: Required. The location name of the additional region + among Azure Data center regions. + :type location: str + :param sku: Required. SKU properties of the API Management service. + :type sku: + ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties + :ivar public_ip_addresses: Static IP addresses of the location's virtual + machines. + :vartype public_ip_addresses: list[str] + :param virtual_network_configuration: Virtual network configuration for + the location. + :type virtual_network_configuration: + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration + :ivar gateway_regional_url: Gateway URL of the API Management service in + the Region. + :vartype gateway_regional_url: str + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'public_ip_addresses': {'readonly': True}, + 'gateway_regional_url': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, + 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, + 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AdditionalLocation, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.sku = kwargs.get('sku', None) + self.public_ip_addresses = None + self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) + self.gateway_regional_url = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/additional_location_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/additional_location_py3.py new file mode 100644 index 000000000000..5d26b6563412 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/additional_location_py3.py @@ -0,0 +1,62 @@ +# 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 msrest.serialization import Model + + +class AdditionalLocation(Model): + """Description of an additional API Management resource 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. + + :param location: Required. The location name of the additional region + among Azure Data center regions. + :type location: str + :param sku: Required. SKU properties of the API Management service. + :type sku: + ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties + :ivar public_ip_addresses: Static IP addresses of the location's virtual + machines. + :vartype public_ip_addresses: list[str] + :param virtual_network_configuration: Virtual network configuration for + the location. + :type virtual_network_configuration: + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration + :ivar gateway_regional_url: Gateway URL of the API Management service in + the Region. + :vartype gateway_regional_url: str + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'public_ip_addresses': {'readonly': True}, + 'gateway_regional_url': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, + 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, + 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'}, + } + + def __init__(self, *, location: str, sku, virtual_network_configuration=None, **kwargs) -> None: + super(AdditionalLocation, self).__init__(**kwargs) + self.location = location + self.sku = sku + self.public_ip_addresses = None + self.virtual_network_configuration = virtual_network_configuration + self.gateway_regional_url = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract.py new file mode 100644 index 000000000000..11ad7b5c3108 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract.py @@ -0,0 +1,121 @@ +# 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 .resource import Resource + + +class ApiContract(Resource): + """API details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param display_name: API name. + :type display_name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Required. Relative URL uniquely identifying this API and all + of its resource paths within the API Management service instance. It is + appended to the API endpoint base URL specified during the service + instance creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + :param api_version_set: + :type api_version_set: + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 0}, + 'path': {'required': True, 'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authentication_settings': {'key': 'properties.authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'properties.subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'properties.type', 'type': 'str'}, + 'api_revision': {'key': 'properties.apiRevision', 'type': 'str'}, + 'api_version': {'key': 'properties.apiVersion', 'type': 'str'}, + 'is_current': {'key': 'properties.isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'properties.isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, + } + + def __init__(self, **kwargs): + super(ApiContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.authentication_settings = kwargs.get('authentication_settings', None) + self.subscription_key_parameter_names = kwargs.get('subscription_key_parameter_names', None) + self.api_type = kwargs.get('api_type', None) + self.api_revision = kwargs.get('api_revision', None) + self.api_version = kwargs.get('api_version', None) + self.is_current = None + self.is_online = None + self.api_version_set_id = kwargs.get('api_version_set_id', None) + self.display_name = kwargs.get('display_name', None) + self.service_url = kwargs.get('service_url', None) + self.path = kwargs.get('path', None) + self.protocols = kwargs.get('protocols', None) + self.api_version_set = kwargs.get('api_version_set', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_paged.py new file mode 100644 index 000000000000..35e5c717faa9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_paged.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 msrest.paging import Paged + + +class ApiContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApiContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApiContract]'} + } + + def __init__(self, *args, **kwargs): + + super(ApiContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_properties.py new file mode 100644 index 000000000000..1188e495549c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_properties.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 .api_entity_base_contract import ApiEntityBaseContract + + +class ApiContractProperties(ApiEntityBaseContract): + """Api Entity 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 description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param display_name: API name. + :type display_name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Required. Relative URL uniquely identifying this API and all + of its resource paths within the API Management service instance. It is + appended to the API endpoint base URL specified during the service + instance creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + :param api_version_set: + :type api_version_set: + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 0}, + 'path': {'required': True, 'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authentication_settings': {'key': 'authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'type', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'is_current': {'key': 'isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'protocols': {'key': 'protocols', 'type': '[Protocol]'}, + 'api_version_set': {'key': 'apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, + } + + def __init__(self, **kwargs): + super(ApiContractProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.service_url = kwargs.get('service_url', None) + self.path = kwargs.get('path', None) + self.protocols = kwargs.get('protocols', None) + self.api_version_set = kwargs.get('api_version_set', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_properties_py3.py new file mode 100644 index 000000000000..3f2e351e60da --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_properties_py3.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 .api_entity_base_contract import ApiEntityBaseContract + + +class ApiContractProperties(ApiEntityBaseContract): + """Api Entity 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 description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param display_name: API name. + :type display_name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Required. Relative URL uniquely identifying this API and all + of its resource paths within the API Management service instance. It is + appended to the API endpoint base URL specified during the service + instance creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + :param api_version_set: + :type api_version_set: + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 0}, + 'path': {'required': True, 'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authentication_settings': {'key': 'authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'type', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'is_current': {'key': 'isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'protocols': {'key': 'protocols', 'type': '[Protocol]'}, + 'api_version_set': {'key': 'apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, + } + + def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, api_version_set_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, **kwargs) -> None: + super(ApiContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, api_version_set_id=api_version_set_id, **kwargs) + self.display_name = display_name + self.service_url = service_url + self.path = path + self.protocols = protocols + self.api_version_set = api_version_set diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_py3.py new file mode 100644 index 000000000000..7d16c5ef9d28 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_contract_py3.py @@ -0,0 +1,121 @@ +# 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 .resource import Resource + + +class ApiContract(Resource): + """API details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param display_name: API name. + :type display_name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Required. Relative URL uniquely identifying this API and all + of its resource paths within the API Management service instance. It is + appended to the API endpoint base URL specified during the service + instance creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + :param api_version_set: + :type api_version_set: + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 0}, + 'path': {'required': True, 'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authentication_settings': {'key': 'properties.authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'properties.subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'properties.type', 'type': 'str'}, + 'api_revision': {'key': 'properties.apiRevision', 'type': 'str'}, + 'api_version': {'key': 'properties.apiVersion', 'type': 'str'}, + 'is_current': {'key': 'properties.isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'properties.isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, + } + + def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, api_version_set_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, **kwargs) -> None: + super(ApiContract, self).__init__(, **kwargs) + self.description = description + self.authentication_settings = authentication_settings + self.subscription_key_parameter_names = subscription_key_parameter_names + self.api_type = api_type + self.api_revision = api_revision + self.api_version = api_version + self.is_current = None + self.is_online = None + self.api_version_set_id = api_version_set_id + self.display_name = display_name + self.service_url = service_url + self.path = path + self.protocols = protocols + self.api_version_set = api_version_set diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_parameter.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_parameter.py new file mode 100644 index 000000000000..d1511797f73b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_parameter.py @@ -0,0 +1,133 @@ +# 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 msrest.serialization import Model + + +class ApiCreateOrUpdateParameter(Model): + """API Create or Update Parameters. + + Variables are only 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 description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param display_name: API name. + :type display_name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Required. Relative URL uniquely identifying this API and all + of its resource paths within the API Management service instance. It is + appended to the API endpoint base URL specified during the service + instance creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + :param api_version_set: + :type api_version_set: + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails + :param content_value: Content value when Importing an API. + :type content_value: str + :param content_format: Format of the Content in which the API is getting + imported. Possible values include: 'wadl-xml', 'wadl-link-json', + 'swagger-json', 'swagger-link-json', 'wsdl', 'wsdl-link' + :type content_format: str or + ~azure.mgmt.apimanagement.models.ContentFormat + :param wsdl_selector: Criteria to limit import of WSDL to a subset of the + document. + :type wsdl_selector: + ~azure.mgmt.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector + :param soap_api_type: Type of Api to create. + * `http` creates a SOAP to REST API + * `soap` creates a SOAP pass-through API. Possible values include: + 'SoapToRest', 'SoapPassThrough' + :type soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 0}, + 'path': {'required': True, 'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authentication_settings': {'key': 'properties.authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'properties.subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'properties.type', 'type': 'str'}, + 'api_revision': {'key': 'properties.apiRevision', 'type': 'str'}, + 'api_version': {'key': 'properties.apiVersion', 'type': 'str'}, + 'is_current': {'key': 'properties.isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'properties.isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, + 'content_value': {'key': 'properties.contentValue', 'type': 'str'}, + 'content_format': {'key': 'properties.contentFormat', 'type': 'str'}, + 'wsdl_selector': {'key': 'properties.wsdlSelector', 'type': 'ApiCreateOrUpdatePropertiesWsdlSelector'}, + 'soap_api_type': {'key': 'properties.apiType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiCreateOrUpdateParameter, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.authentication_settings = kwargs.get('authentication_settings', None) + self.subscription_key_parameter_names = kwargs.get('subscription_key_parameter_names', None) + self.api_type = kwargs.get('api_type', None) + self.api_revision = kwargs.get('api_revision', None) + self.api_version = kwargs.get('api_version', None) + self.is_current = None + self.is_online = None + self.api_version_set_id = kwargs.get('api_version_set_id', None) + self.display_name = kwargs.get('display_name', None) + self.service_url = kwargs.get('service_url', None) + self.path = kwargs.get('path', None) + self.protocols = kwargs.get('protocols', None) + self.api_version_set = kwargs.get('api_version_set', None) + self.content_value = kwargs.get('content_value', None) + self.content_format = kwargs.get('content_format', None) + self.wsdl_selector = kwargs.get('wsdl_selector', None) + self.soap_api_type = kwargs.get('soap_api_type', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_parameter_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_parameter_py3.py new file mode 100644 index 000000000000..fb445174bdb0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_parameter_py3.py @@ -0,0 +1,133 @@ +# 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 msrest.serialization import Model + + +class ApiCreateOrUpdateParameter(Model): + """API Create or Update Parameters. + + Variables are only 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 description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param display_name: API name. + :type display_name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Required. Relative URL uniquely identifying this API and all + of its resource paths within the API Management service instance. It is + appended to the API endpoint base URL specified during the service + instance creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + :param api_version_set: + :type api_version_set: + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails + :param content_value: Content value when Importing an API. + :type content_value: str + :param content_format: Format of the Content in which the API is getting + imported. Possible values include: 'wadl-xml', 'wadl-link-json', + 'swagger-json', 'swagger-link-json', 'wsdl', 'wsdl-link' + :type content_format: str or + ~azure.mgmt.apimanagement.models.ContentFormat + :param wsdl_selector: Criteria to limit import of WSDL to a subset of the + document. + :type wsdl_selector: + ~azure.mgmt.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector + :param soap_api_type: Type of Api to create. + * `http` creates a SOAP to REST API + * `soap` creates a SOAP pass-through API. Possible values include: + 'SoapToRest', 'SoapPassThrough' + :type soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 0}, + 'path': {'required': True, 'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authentication_settings': {'key': 'properties.authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'properties.subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'properties.type', 'type': 'str'}, + 'api_revision': {'key': 'properties.apiRevision', 'type': 'str'}, + 'api_version': {'key': 'properties.apiVersion', 'type': 'str'}, + 'is_current': {'key': 'properties.isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'properties.isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, + 'content_value': {'key': 'properties.contentValue', 'type': 'str'}, + 'content_format': {'key': 'properties.contentFormat', 'type': 'str'}, + 'wsdl_selector': {'key': 'properties.wsdlSelector', 'type': 'ApiCreateOrUpdatePropertiesWsdlSelector'}, + 'soap_api_type': {'key': 'properties.apiType', 'type': 'str'}, + } + + def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, api_version_set_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, content_value: str=None, content_format=None, wsdl_selector=None, soap_api_type=None, **kwargs) -> None: + super(ApiCreateOrUpdateParameter, self).__init__(**kwargs) + self.description = description + self.authentication_settings = authentication_settings + self.subscription_key_parameter_names = subscription_key_parameter_names + self.api_type = api_type + self.api_revision = api_revision + self.api_version = api_version + self.is_current = None + self.is_online = None + self.api_version_set_id = api_version_set_id + self.display_name = display_name + self.service_url = service_url + self.path = path + self.protocols = protocols + self.api_version_set = api_version_set + self.content_value = content_value + self.content_format = content_format + self.wsdl_selector = wsdl_selector + self.soap_api_type = soap_api_type diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_properties_wsdl_selector.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_properties_wsdl_selector.py new file mode 100644 index 000000000000..f94026f29f08 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_properties_wsdl_selector.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ApiCreateOrUpdatePropertiesWsdlSelector(Model): + """Criteria to limit import of WSDL to a subset of the document. + + :param wsdl_service_name: Name of service to import from WSDL + :type wsdl_service_name: str + :param wsdl_endpoint_name: Name of endpoint(port) to import from WSDL + :type wsdl_endpoint_name: str + """ + + _attribute_map = { + 'wsdl_service_name': {'key': 'wsdlServiceName', 'type': 'str'}, + 'wsdl_endpoint_name': {'key': 'wsdlEndpointName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiCreateOrUpdatePropertiesWsdlSelector, self).__init__(**kwargs) + self.wsdl_service_name = kwargs.get('wsdl_service_name', None) + self.wsdl_endpoint_name = kwargs.get('wsdl_endpoint_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_properties_wsdl_selector_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_properties_wsdl_selector_py3.py new file mode 100644 index 000000000000..cd7249f0e0ba --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_create_or_update_properties_wsdl_selector_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ApiCreateOrUpdatePropertiesWsdlSelector(Model): + """Criteria to limit import of WSDL to a subset of the document. + + :param wsdl_service_name: Name of service to import from WSDL + :type wsdl_service_name: str + :param wsdl_endpoint_name: Name of endpoint(port) to import from WSDL + :type wsdl_endpoint_name: str + """ + + _attribute_map = { + 'wsdl_service_name': {'key': 'wsdlServiceName', 'type': 'str'}, + 'wsdl_endpoint_name': {'key': 'wsdlEndpointName', 'type': 'str'}, + } + + def __init__(self, *, wsdl_service_name: str=None, wsdl_endpoint_name: str=None, **kwargs) -> None: + super(ApiCreateOrUpdatePropertiesWsdlSelector, self).__init__(**kwargs) + self.wsdl_service_name = wsdl_service_name + self.wsdl_endpoint_name = wsdl_endpoint_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_entity_base_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_entity_base_contract.py new file mode 100644 index 000000000000..75e62715978d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_entity_base_contract.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class ApiEntityBaseContract(Model): + """API base contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authentication_settings': {'key': 'authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'type', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'is_current': {'key': 'isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiEntityBaseContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.authentication_settings = kwargs.get('authentication_settings', None) + self.subscription_key_parameter_names = kwargs.get('subscription_key_parameter_names', None) + self.api_type = kwargs.get('api_type', None) + self.api_revision = kwargs.get('api_revision', None) + self.api_version = kwargs.get('api_version', None) + self.is_current = None + self.is_online = None + self.api_version_set_id = kwargs.get('api_version_set_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_entity_base_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_entity_base_contract_py3.py new file mode 100644 index 000000000000..f38bc02d85d7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_entity_base_contract_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class ApiEntityBaseContract(Model): + """API base contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authentication_settings': {'key': 'authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'type', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'is_current': {'key': 'isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, api_version_set_id: str=None, **kwargs) -> None: + super(ApiEntityBaseContract, self).__init__(**kwargs) + self.description = description + self.authentication_settings = authentication_settings + self.subscription_key_parameter_names = subscription_key_parameter_names + self.api_type = api_type + self.api_revision = api_revision + self.api_version = api_version + self.is_current = None + self.is_online = None + self.api_version_set_id = api_version_set_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_export_result.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_export_result.py new file mode 100644 index 000000000000..dfe0f09e82d4 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_export_result.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 msrest.serialization import Model + + +class ApiExportResult(Model): + """API Export result Blob Uri. + + :param link: Link to the Storage Blob containing the result of the export + operation. The Blob Uri is only valid for 5 minutes. + :type link: str + """ + + _attribute_map = { + 'link': {'key': 'link', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiExportResult, self).__init__(**kwargs) + self.link = kwargs.get('link', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_export_result_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_export_result_py3.py new file mode 100644 index 000000000000..4d2e2671fbf8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_export_result_py3.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 msrest.serialization import Model + + +class ApiExportResult(Model): + """API Export result Blob Uri. + + :param link: Link to the Storage Blob containing the result of the export + operation. The Blob Uri is only valid for 5 minutes. + :type link: str + """ + + _attribute_map = { + 'link': {'key': 'link', 'type': 'str'}, + } + + def __init__(self, *, link: str=None, **kwargs) -> None: + super(ApiExportResult, self).__init__(**kwargs) + self.link = link diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_client_enums.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_client_enums.py new file mode 100644 index 000000000000..fccd5681cb26 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_client_enums.py @@ -0,0 +1,240 @@ +# 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 + + +class PolicyContentFormat(str, Enum): + + xml = "xml" + xml_link = "xml-link" + + +class Protocol(str, Enum): + + http = "http" + https = "https" + + +class ContentFormat(str, Enum): + + wadl_xml = "wadl-xml" + wadl_link_json = "wadl-link-json" + swagger_json = "swagger-json" + swagger_link_json = "swagger-link-json" + wsdl = "wsdl" + wsdl_link = "wsdl-link" + + +class SoapApiType(str, Enum): + + soap_to_rest = "http" + soap_pass_through = "soap" + + +class ApiType(str, Enum): + + http = "http" + soap = "soap" + + +class LoggerType(str, Enum): + + azure_event_hub = "azureEventHub" + application_insights = "applicationInsights" + + +class ProductState(str, Enum): + + not_published = "notPublished" + published = "published" + + +class GrantType(str, Enum): + + authorization_code = "authorizationCode" + implicit = "implicit" + resource_owner_password = "resourceOwnerPassword" + client_credentials = "clientCredentials" + + +class AuthorizationMethod(str, Enum): + + head = "HEAD" + options = "OPTIONS" + trace = "TRACE" + get = "GET" + post = "POST" + put = "PUT" + patch = "PATCH" + delete = "DELETE" + + +class ClientAuthenticationMethod(str, Enum): + + basic = "Basic" + body = "Body" + + +class BearerTokenSendingMethod(str, Enum): + + authorization_header = "authorizationHeader" + query = "query" + + +class BackendProtocol(str, Enum): + + http = "http" + soap = "soap" + + +class HostnameType(str, Enum): + + proxy = "Proxy" + portal = "Portal" + management = "Management" + scm = "Scm" + + +class SkuType(str, Enum): + + developer = "Developer" + standard = "Standard" + premium = "Premium" + basic = "Basic" + + +class VirtualNetworkType(str, Enum): + + none = "None" + external = "External" + internal = "Internal" + + +class NameAvailabilityReason(str, Enum): + + valid = "Valid" + invalid = "Invalid" + already_exists = "AlreadyExists" + + +class GroupType(str, Enum): + + custom = "custom" + system = "system" + external = "external" + + +class Confirmation(str, Enum): + + signup = "signup" + invite = "invite" + + +class UserState(str, Enum): + + active = "active" + blocked = "blocked" + pending = "pending" + deleted = "deleted" + + +class IdentityProviderType(str, Enum): + + facebook = "facebook" + google = "google" + microsoft = "microsoft" + twitter = "twitter" + aad = "aad" + aad_b2_c = "aadB2C" + + +class ConnectivityStatusType(str, Enum): + + initializing = "initializing" + success = "success" + failure = "failure" + + +class SubscriptionState(str, Enum): + + suspended = "suspended" + active = "active" + expired = "expired" + submitted = "submitted" + rejected = "rejected" + cancelled = "cancelled" + + +class AsyncOperationStatus(str, Enum): + + started = "Started" + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + + +class KeyType(str, Enum): + + primary = "primary" + secondary = "secondary" + + +class VersioningScheme(str, Enum): + + segment = "Segment" + query = "Query" + header = "Header" + + +class TemplateName(str, Enum): + + application_approved_notification_message = "applicationApprovedNotificationMessage" + account_closed_developer = "accountClosedDeveloper" + quota_limit_approaching_developer_notification_message = "quotaLimitApproachingDeveloperNotificationMessage" + new_developer_notification_message = "newDeveloperNotificationMessage" + email_change_identity_default = "emailChangeIdentityDefault" + invite_user_notification_message = "inviteUserNotificationMessage" + new_comment_notification_message = "newCommentNotificationMessage" + confirm_sign_up_identity_default = "confirmSignUpIdentityDefault" + new_issue_notification_message = "newIssueNotificationMessage" + purchase_developer_notification_message = "purchaseDeveloperNotificationMessage" + password_reset_identity_default = "passwordResetIdentityDefault" + password_reset_by_admin_notification_message = "passwordResetByAdminNotificationMessage" + reject_developer_notification_message = "rejectDeveloperNotificationMessage" + request_developer_notification_message = "requestDeveloperNotificationMessage" + + +class NotificationName(str, Enum): + + request_publisher_notification_message = "RequestPublisherNotificationMessage" + purchase_publisher_notification_message = "PurchasePublisherNotificationMessage" + new_application_notification_message = "NewApplicationNotificationMessage" + bcc = "BCC" + new_issue_publisher_notification_message = "NewIssuePublisherNotificationMessage" + account_closed_publisher = "AccountClosedPublisher" + quota_limit_approaching_publisher_notification_message = "QuotaLimitApproachingPublisherNotificationMessage" + + +class PolicyScopeContract(str, Enum): + + tenant = "Tenant" + product = "Product" + api = "Api" + operation = "Operation" + all = "All" + + +class ExportFormat(str, Enum): + + swagger = "swagger-link" + wsdl = "wsdl-link" + wadl = "wadl-link" diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_apply_network_configuration_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_apply_network_configuration_parameters.py new file mode 100644 index 000000000000..7de08f790795 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_apply_network_configuration_parameters.py @@ -0,0 +1,30 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceApplyNetworkConfigurationParameters(Model): + """Parameter supplied to the Apply Network configuration operation. + + :param location: Location of the Api Management service to update for a + multi-region service. For a service deployed in a single region, this + parameter is not required. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceApplyNetworkConfigurationParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_apply_network_configuration_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_apply_network_configuration_parameters_py3.py new file mode 100644 index 000000000000..315f5e2859ca --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_apply_network_configuration_parameters_py3.py @@ -0,0 +1,30 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceApplyNetworkConfigurationParameters(Model): + """Parameter supplied to the Apply Network configuration operation. + + :param location: Location of the Api Management service to update for a + multi-region service. For a service deployed in a single region, this + parameter is not required. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, **kwargs) -> None: + super(ApiManagementServiceApplyNetworkConfigurationParameters, self).__init__(**kwargs) + self.location = location diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_backup_restore_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_backup_restore_parameters.py new file mode 100644 index 000000000000..9cde1269f3f7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_backup_restore_parameters.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceBackupRestoreParameters(Model): + """Parameters supplied to the Backup/Restore of an API Management service + operation. + + All required parameters must be populated in order to send to Azure. + + :param storage_account: Required. Azure Cloud Storage account (used to + place/retrieve the backup) name. + :type storage_account: str + :param access_key: Required. Azure Cloud Storage account (used to + place/retrieve the backup) access key. + :type access_key: str + :param container_name: Required. Azure Cloud Storage blob container name + used to place/retrieve the backup. + :type container_name: str + :param backup_name: Required. The name of the backup file to create. + :type backup_name: str + """ + + _validation = { + 'storage_account': {'required': True}, + 'access_key': {'required': True}, + 'container_name': {'required': True}, + 'backup_name': {'required': True}, + } + + _attribute_map = { + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'backup_name': {'key': 'backupName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceBackupRestoreParameters, self).__init__(**kwargs) + self.storage_account = kwargs.get('storage_account', None) + self.access_key = kwargs.get('access_key', None) + self.container_name = kwargs.get('container_name', None) + self.backup_name = kwargs.get('backup_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_backup_restore_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_backup_restore_parameters_py3.py new file mode 100644 index 000000000000..e6cba95e6129 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_backup_restore_parameters_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceBackupRestoreParameters(Model): + """Parameters supplied to the Backup/Restore of an API Management service + operation. + + All required parameters must be populated in order to send to Azure. + + :param storage_account: Required. Azure Cloud Storage account (used to + place/retrieve the backup) name. + :type storage_account: str + :param access_key: Required. Azure Cloud Storage account (used to + place/retrieve the backup) access key. + :type access_key: str + :param container_name: Required. Azure Cloud Storage blob container name + used to place/retrieve the backup. + :type container_name: str + :param backup_name: Required. The name of the backup file to create. + :type backup_name: str + """ + + _validation = { + 'storage_account': {'required': True}, + 'access_key': {'required': True}, + 'container_name': {'required': True}, + 'backup_name': {'required': True}, + } + + _attribute_map = { + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'backup_name': {'key': 'backupName', 'type': 'str'}, + } + + def __init__(self, *, storage_account: str, access_key: str, container_name: str, backup_name: str, **kwargs) -> None: + super(ApiManagementServiceBackupRestoreParameters, self).__init__(**kwargs) + self.storage_account = storage_account + self.access_key = access_key + self.container_name = container_name + self.backup_name = backup_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_base_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_base_properties.py new file mode 100644 index 000000000000..0bf5bea57993 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_base_properties.py @@ -0,0 +1,148 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceBaseProperties(Model): + """Base Properties of an API Management service resource description. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param notification_sender_email: Email address from which the + notification will be sent. + :type notification_sender_email: str + :ivar provisioning_state: The current provisioning state of the API + Management service which can be one of the following: + Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + :vartype provisioning_state: str + :ivar target_provisioning_state: The provisioning state of the API + Management service, which is targeted by the long running operation + started on the service. + :vartype target_provisioning_state: str + :ivar created_at_utc: Creation UTC date of the API Management service.The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :vartype created_at_utc: datetime + :ivar gateway_url: Gateway URL of the API Management service. + :vartype gateway_url: str + :ivar gateway_regional_url: Gateway URL of the API Management service in + the Default Region. + :vartype gateway_regional_url: str + :ivar portal_url: Publisher portal endpoint Url of the API Management + service. + :vartype portal_url: str + :ivar management_api_url: Management API endpoint URL of the API + Management service. + :vartype management_api_url: str + :ivar scm_url: SCM endpoint URL of the API Management service. + :vartype scm_url: str + :param hostname_configurations: Custom hostname configuration of the API + Management service. + :type hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] + :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the + API Management service. Available only for Basic, Standard and Premium + SKU. + :vartype public_ip_addresses: list[str] + :ivar private_ip_addresses: Private Static Load Balanced IP addresses of + the API Management service which is deployed in an Internal Virtual + Network. Available only for Basic, Standard and Premium SKU. + :vartype private_ip_addresses: list[str] + :param virtual_network_configuration: Virtual network configuration of the + API Management service. + :type virtual_network_configuration: + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration + :param additional_locations: Additional datacenter locations of the API + Management service. + :type additional_locations: + list[~azure.mgmt.apimanagement.models.AdditionalLocation] + :param custom_properties: Custom properties of the API Management service. + Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 + and 1.2). Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + can be used to disable just TLS 1.1 and setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + can be used to disable TLS 1.0 on an API Management service. + :type custom_properties: dict[str, str] + :param certificates: List of Certificates that need to be installed in the + API Management service. Max supported certificates that can be installed + is 10. + :type certificates: + list[~azure.mgmt.apimanagement.models.CertificateConfiguration] + :param virtual_network_type: The type of VPN in which API Managemet + service needs to be configured in. None (Default Value) means the API + Management service is not part of any Virtual Network, External means the + API Management deployment is set up inside a Virtual Network having an + Internet Facing Endpoint, and Internal means that API Management + deployment is setup inside a Virtual Network having an Intranet Facing + Endpoint only. Possible values include: 'None', 'External', 'Internal'. + Default value: "None" . + :type virtual_network_type: str or + ~azure.mgmt.apimanagement.models.VirtualNetworkType + """ + + _validation = { + 'notification_sender_email': {'max_length': 100}, + 'provisioning_state': {'readonly': True}, + 'target_provisioning_state': {'readonly': True}, + 'created_at_utc': {'readonly': True}, + 'gateway_url': {'readonly': True}, + 'gateway_regional_url': {'readonly': True}, + 'portal_url': {'readonly': True}, + 'management_api_url': {'readonly': True}, + 'scm_url': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + 'private_ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'notification_sender_email': {'key': 'notificationSenderEmail', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'target_provisioning_state': {'key': 'targetProvisioningState', 'type': 'str'}, + 'created_at_utc': {'key': 'createdAtUtc', 'type': 'iso-8601'}, + 'gateway_url': {'key': 'gatewayUrl', 'type': 'str'}, + 'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'}, + 'portal_url': {'key': 'portalUrl', 'type': 'str'}, + 'management_api_url': {'key': 'managementApiUrl', 'type': 'str'}, + 'scm_url': {'key': 'scmUrl', 'type': 'str'}, + 'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'}, + 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, + 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'}, + 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, + 'certificates': {'key': 'certificates', 'type': '[CertificateConfiguration]'}, + 'virtual_network_type': {'key': 'virtualNetworkType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceBaseProperties, self).__init__(**kwargs) + self.notification_sender_email = kwargs.get('notification_sender_email', None) + self.provisioning_state = None + self.target_provisioning_state = None + self.created_at_utc = None + self.gateway_url = None + self.gateway_regional_url = None + self.portal_url = None + self.management_api_url = None + self.scm_url = None + self.hostname_configurations = kwargs.get('hostname_configurations', None) + self.public_ip_addresses = None + self.private_ip_addresses = None + self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) + self.additional_locations = kwargs.get('additional_locations', None) + self.custom_properties = kwargs.get('custom_properties', None) + self.certificates = kwargs.get('certificates', None) + self.virtual_network_type = kwargs.get('virtual_network_type', "None") diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_base_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_base_properties_py3.py new file mode 100644 index 000000000000..c7d968d749ae --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_base_properties_py3.py @@ -0,0 +1,148 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceBaseProperties(Model): + """Base Properties of an API Management service resource description. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param notification_sender_email: Email address from which the + notification will be sent. + :type notification_sender_email: str + :ivar provisioning_state: The current provisioning state of the API + Management service which can be one of the following: + Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + :vartype provisioning_state: str + :ivar target_provisioning_state: The provisioning state of the API + Management service, which is targeted by the long running operation + started on the service. + :vartype target_provisioning_state: str + :ivar created_at_utc: Creation UTC date of the API Management service.The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :vartype created_at_utc: datetime + :ivar gateway_url: Gateway URL of the API Management service. + :vartype gateway_url: str + :ivar gateway_regional_url: Gateway URL of the API Management service in + the Default Region. + :vartype gateway_regional_url: str + :ivar portal_url: Publisher portal endpoint Url of the API Management + service. + :vartype portal_url: str + :ivar management_api_url: Management API endpoint URL of the API + Management service. + :vartype management_api_url: str + :ivar scm_url: SCM endpoint URL of the API Management service. + :vartype scm_url: str + :param hostname_configurations: Custom hostname configuration of the API + Management service. + :type hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] + :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the + API Management service. Available only for Basic, Standard and Premium + SKU. + :vartype public_ip_addresses: list[str] + :ivar private_ip_addresses: Private Static Load Balanced IP addresses of + the API Management service which is deployed in an Internal Virtual + Network. Available only for Basic, Standard and Premium SKU. + :vartype private_ip_addresses: list[str] + :param virtual_network_configuration: Virtual network configuration of the + API Management service. + :type virtual_network_configuration: + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration + :param additional_locations: Additional datacenter locations of the API + Management service. + :type additional_locations: + list[~azure.mgmt.apimanagement.models.AdditionalLocation] + :param custom_properties: Custom properties of the API Management service. + Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 + and 1.2). Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + can be used to disable just TLS 1.1 and setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + can be used to disable TLS 1.0 on an API Management service. + :type custom_properties: dict[str, str] + :param certificates: List of Certificates that need to be installed in the + API Management service. Max supported certificates that can be installed + is 10. + :type certificates: + list[~azure.mgmt.apimanagement.models.CertificateConfiguration] + :param virtual_network_type: The type of VPN in which API Managemet + service needs to be configured in. None (Default Value) means the API + Management service is not part of any Virtual Network, External means the + API Management deployment is set up inside a Virtual Network having an + Internet Facing Endpoint, and Internal means that API Management + deployment is setup inside a Virtual Network having an Intranet Facing + Endpoint only. Possible values include: 'None', 'External', 'Internal'. + Default value: "None" . + :type virtual_network_type: str or + ~azure.mgmt.apimanagement.models.VirtualNetworkType + """ + + _validation = { + 'notification_sender_email': {'max_length': 100}, + 'provisioning_state': {'readonly': True}, + 'target_provisioning_state': {'readonly': True}, + 'created_at_utc': {'readonly': True}, + 'gateway_url': {'readonly': True}, + 'gateway_regional_url': {'readonly': True}, + 'portal_url': {'readonly': True}, + 'management_api_url': {'readonly': True}, + 'scm_url': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + 'private_ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'notification_sender_email': {'key': 'notificationSenderEmail', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'target_provisioning_state': {'key': 'targetProvisioningState', 'type': 'str'}, + 'created_at_utc': {'key': 'createdAtUtc', 'type': 'iso-8601'}, + 'gateway_url': {'key': 'gatewayUrl', 'type': 'str'}, + 'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'}, + 'portal_url': {'key': 'portalUrl', 'type': 'str'}, + 'management_api_url': {'key': 'managementApiUrl', 'type': 'str'}, + 'scm_url': {'key': 'scmUrl', 'type': 'str'}, + 'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'}, + 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, + 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'}, + 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, + 'certificates': {'key': 'certificates', 'type': '[CertificateConfiguration]'}, + 'virtual_network_type': {'key': 'virtualNetworkType', 'type': 'str'}, + } + + def __init__(self, *, notification_sender_email: str=None, hostname_configurations=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, virtual_network_type="None", **kwargs) -> None: + super(ApiManagementServiceBaseProperties, self).__init__(**kwargs) + self.notification_sender_email = notification_sender_email + self.provisioning_state = None + self.target_provisioning_state = None + self.created_at_utc = None + self.gateway_url = None + self.gateway_regional_url = None + self.portal_url = None + self.management_api_url = None + self.scm_url = None + self.hostname_configurations = hostname_configurations + self.public_ip_addresses = None + self.private_ip_addresses = None + self.virtual_network_configuration = virtual_network_configuration + self.additional_locations = additional_locations + self.custom_properties = custom_properties + self.certificates = certificates + self.virtual_network_type = virtual_network_type diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_check_name_availability_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_check_name_availability_parameters.py new file mode 100644 index 000000000000..621a58f23110 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_check_name_availability_parameters.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceCheckNameAvailabilityParameters(Model): + """Parameters supplied to the CheckNameAvailability operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name to check for availability. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_check_name_availability_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..8025048f1cb7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_check_name_availability_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceCheckNameAvailabilityParameters(Model): + """Parameters supplied to the CheckNameAvailability operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name to check for availability. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(ApiManagementServiceCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_get_sso_token_result.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_get_sso_token_result.py new file mode 100644 index 000000000000..34e758843486 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_get_sso_token_result.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 msrest.serialization import Model + + +class ApiManagementServiceGetSsoTokenResult(Model): + """The response of the GetSsoToken operation. + + :param redirect_uri: Redirect URL to the Publisher Portal containing the + SSO token. + :type redirect_uri: str + """ + + _attribute_map = { + 'redirect_uri': {'key': 'redirectUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceGetSsoTokenResult, self).__init__(**kwargs) + self.redirect_uri = kwargs.get('redirect_uri', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_get_sso_token_result_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_get_sso_token_result_py3.py new file mode 100644 index 000000000000..607491621d49 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_get_sso_token_result_py3.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 msrest.serialization import Model + + +class ApiManagementServiceGetSsoTokenResult(Model): + """The response of the GetSsoToken operation. + + :param redirect_uri: Redirect URL to the Publisher Portal containing the + SSO token. + :type redirect_uri: str + """ + + _attribute_map = { + 'redirect_uri': {'key': 'redirectUri', 'type': 'str'}, + } + + def __init__(self, *, redirect_uri: str=None, **kwargs) -> None: + super(ApiManagementServiceGetSsoTokenResult, self).__init__(**kwargs) + self.redirect_uri = redirect_uri diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_identity.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_identity.py new file mode 100644 index 000000000000..784c8854358d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_identity.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 msrest.serialization import Model + + +class ApiManagementServiceIdentity(Model): + """Identity properties of the Api Management service 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 type: Required. The identity type. Currently the only supported type + is 'SystemAssigned'. Default value: "SystemAssigned" . + :vartype type: str + :ivar principal_id: The principal id of the identity. + :vartype principal_id: str + :ivar tenant_id: The client tenant id of the identity. + :vartype tenant_id: str + """ + + _validation = { + 'type': {'required': True, 'constant': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(ApiManagementServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_identity_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_identity_py3.py new file mode 100644 index 000000000000..2ef5954875ef --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_identity_py3.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 msrest.serialization import Model + + +class ApiManagementServiceIdentity(Model): + """Identity properties of the Api Management service 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 type: Required. The identity type. Currently the only supported type + is 'SystemAssigned'. Default value: "SystemAssigned" . + :vartype type: str + :ivar principal_id: The principal id of the identity. + :vartype principal_id: str + :ivar tenant_id: The client tenant id of the identity. + :vartype tenant_id: str + """ + + _validation = { + 'type': {'required': True, 'constant': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(ApiManagementServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_name_availability_result.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_name_availability_result.py new file mode 100644 index 000000000000..dd5eda6bdb95 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_name_availability_result.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceNameAvailabilityResult(Model): + """Response of the CheckNameAvailability operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: True if the name is available and can be used to + create a new API Management service; otherwise false. + :vartype name_available: bool + :ivar 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 is already in use, and direct them to select a + different name. + :vartype message: str + :param reason: Invalid indicates the name provided does not match the + resource provider’s naming requirements (incorrect length, unsupported + characters, etc.) AlreadyExists indicates that the name is already in use + and is therefore unavailable. Possible values include: 'Valid', 'Invalid', + 'AlreadyExists' + :type reason: str or + ~azure.mgmt.apimanagement.models.NameAvailabilityReason + """ + + _validation = { + 'name_available': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'NameAvailabilityReason'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.message = None + self.reason = kwargs.get('reason', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_name_availability_result_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_name_availability_result_py3.py new file mode 100644 index 000000000000..3bae91346b47 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_name_availability_result_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceNameAvailabilityResult(Model): + """Response of the CheckNameAvailability operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: True if the name is available and can be used to + create a new API Management service; otherwise false. + :vartype name_available: bool + :ivar 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 is already in use, and direct them to select a + different name. + :vartype message: str + :param reason: Invalid indicates the name provided does not match the + resource provider’s naming requirements (incorrect length, unsupported + characters, etc.) AlreadyExists indicates that the name is already in use + and is therefore unavailable. Possible values include: 'Valid', 'Invalid', + 'AlreadyExists' + :type reason: str or + ~azure.mgmt.apimanagement.models.NameAvailabilityReason + """ + + _validation = { + 'name_available': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'NameAvailabilityReason'}, + } + + def __init__(self, *, reason=None, **kwargs) -> None: + super(ApiManagementServiceNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.message = None + self.reason = reason diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_resource.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_resource.py new file mode 100644 index 000000000000..067a958b20c4 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_resource.py @@ -0,0 +1,197 @@ +# 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 .apim_resource import ApimResource + + +class ApiManagementServiceResource(ApimResource): + """A single API Management service resource in List or Get response. + + Variables are only 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 for API Management resource is set to + Microsoft.ApiManagement. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param notification_sender_email: Email address from which the + notification will be sent. + :type notification_sender_email: str + :ivar provisioning_state: The current provisioning state of the API + Management service which can be one of the following: + Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + :vartype provisioning_state: str + :ivar target_provisioning_state: The provisioning state of the API + Management service, which is targeted by the long running operation + started on the service. + :vartype target_provisioning_state: str + :ivar created_at_utc: Creation UTC date of the API Management service.The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :vartype created_at_utc: datetime + :ivar gateway_url: Gateway URL of the API Management service. + :vartype gateway_url: str + :ivar gateway_regional_url: Gateway URL of the API Management service in + the Default Region. + :vartype gateway_regional_url: str + :ivar portal_url: Publisher portal endpoint Url of the API Management + service. + :vartype portal_url: str + :ivar management_api_url: Management API endpoint URL of the API + Management service. + :vartype management_api_url: str + :ivar scm_url: SCM endpoint URL of the API Management service. + :vartype scm_url: str + :param hostname_configurations: Custom hostname configuration of the API + Management service. + :type hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] + :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the + API Management service. Available only for Basic, Standard and Premium + SKU. + :vartype public_ip_addresses: list[str] + :ivar private_ip_addresses: Private Static Load Balanced IP addresses of + the API Management service which is deployed in an Internal Virtual + Network. Available only for Basic, Standard and Premium SKU. + :vartype private_ip_addresses: list[str] + :param virtual_network_configuration: Virtual network configuration of the + API Management service. + :type virtual_network_configuration: + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration + :param additional_locations: Additional datacenter locations of the API + Management service. + :type additional_locations: + list[~azure.mgmt.apimanagement.models.AdditionalLocation] + :param custom_properties: Custom properties of the API Management service. + Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 + and 1.2). Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + can be used to disable just TLS 1.1 and setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + can be used to disable TLS 1.0 on an API Management service. + :type custom_properties: dict[str, str] + :param certificates: List of Certificates that need to be installed in the + API Management service. Max supported certificates that can be installed + is 10. + :type certificates: + list[~azure.mgmt.apimanagement.models.CertificateConfiguration] + :param virtual_network_type: The type of VPN in which API Managemet + service needs to be configured in. None (Default Value) means the API + Management service is not part of any Virtual Network, External means the + API Management deployment is set up inside a Virtual Network having an + Internet Facing Endpoint, and Internal means that API Management + deployment is setup inside a Virtual Network having an Intranet Facing + Endpoint only. Possible values include: 'None', 'External', 'Internal'. + Default value: "None" . + :type virtual_network_type: str or + ~azure.mgmt.apimanagement.models.VirtualNetworkType + :param publisher_email: Required. Publisher email. + :type publisher_email: str + :param publisher_name: Required. Publisher name. + :type publisher_name: str + :param sku: Required. SKU properties of the API Management service. + :type sku: + ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties + :param identity: Managed service identity of the Api Management service. + :type identity: + ~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity + :param location: Required. Resource location. + :type location: str + :ivar etag: ETag of the resource. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'notification_sender_email': {'max_length': 100}, + 'provisioning_state': {'readonly': True}, + 'target_provisioning_state': {'readonly': True}, + 'created_at_utc': {'readonly': True}, + 'gateway_url': {'readonly': True}, + 'gateway_regional_url': {'readonly': True}, + 'portal_url': {'readonly': True}, + 'management_api_url': {'readonly': True}, + 'scm_url': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + 'private_ip_addresses': {'readonly': True}, + 'publisher_email': {'required': True, 'max_length': 100}, + 'publisher_name': {'required': True, 'max_length': 100}, + 'sku': {'required': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'notification_sender_email': {'key': 'properties.notificationSenderEmail', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'target_provisioning_state': {'key': 'properties.targetProvisioningState', 'type': 'str'}, + 'created_at_utc': {'key': 'properties.createdAtUtc', 'type': 'iso-8601'}, + 'gateway_url': {'key': 'properties.gatewayUrl', 'type': 'str'}, + 'gateway_regional_url': {'key': 'properties.gatewayRegionalUrl', 'type': 'str'}, + 'portal_url': {'key': 'properties.portalUrl', 'type': 'str'}, + 'management_api_url': {'key': 'properties.managementApiUrl', 'type': 'str'}, + 'scm_url': {'key': 'properties.scmUrl', 'type': 'str'}, + 'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'}, + 'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'}, + 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'}, + 'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'}, + 'certificates': {'key': 'properties.certificates', 'type': '[CertificateConfiguration]'}, + 'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'}, + 'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, + 'identity': {'key': 'identity', 'type': 'ApiManagementServiceIdentity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceResource, self).__init__(**kwargs) + self.notification_sender_email = kwargs.get('notification_sender_email', None) + self.provisioning_state = None + self.target_provisioning_state = None + self.created_at_utc = None + self.gateway_url = None + self.gateway_regional_url = None + self.portal_url = None + self.management_api_url = None + self.scm_url = None + self.hostname_configurations = kwargs.get('hostname_configurations', None) + self.public_ip_addresses = None + self.private_ip_addresses = None + self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) + self.additional_locations = kwargs.get('additional_locations', None) + self.custom_properties = kwargs.get('custom_properties', None) + self.certificates = kwargs.get('certificates', None) + self.virtual_network_type = kwargs.get('virtual_network_type', "None") + self.publisher_email = kwargs.get('publisher_email', None) + self.publisher_name = kwargs.get('publisher_name', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) + self.location = kwargs.get('location', None) + self.etag = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_resource_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_resource_paged.py new file mode 100644 index 000000000000..3f5ff2743b15 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_resource_paged.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 msrest.paging import Paged + + +class ApiManagementServiceResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`ApiManagementServiceResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApiManagementServiceResource]'} + } + + def __init__(self, *args, **kwargs): + + super(ApiManagementServiceResourcePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_resource_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_resource_py3.py new file mode 100644 index 000000000000..8ae1ae98e0b6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_resource_py3.py @@ -0,0 +1,197 @@ +# 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 .apim_resource import ApimResource + + +class ApiManagementServiceResource(ApimResource): + """A single API Management service resource in List or Get response. + + Variables are only 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 for API Management resource is set to + Microsoft.ApiManagement. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param notification_sender_email: Email address from which the + notification will be sent. + :type notification_sender_email: str + :ivar provisioning_state: The current provisioning state of the API + Management service which can be one of the following: + Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + :vartype provisioning_state: str + :ivar target_provisioning_state: The provisioning state of the API + Management service, which is targeted by the long running operation + started on the service. + :vartype target_provisioning_state: str + :ivar created_at_utc: Creation UTC date of the API Management service.The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :vartype created_at_utc: datetime + :ivar gateway_url: Gateway URL of the API Management service. + :vartype gateway_url: str + :ivar gateway_regional_url: Gateway URL of the API Management service in + the Default Region. + :vartype gateway_regional_url: str + :ivar portal_url: Publisher portal endpoint Url of the API Management + service. + :vartype portal_url: str + :ivar management_api_url: Management API endpoint URL of the API + Management service. + :vartype management_api_url: str + :ivar scm_url: SCM endpoint URL of the API Management service. + :vartype scm_url: str + :param hostname_configurations: Custom hostname configuration of the API + Management service. + :type hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] + :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the + API Management service. Available only for Basic, Standard and Premium + SKU. + :vartype public_ip_addresses: list[str] + :ivar private_ip_addresses: Private Static Load Balanced IP addresses of + the API Management service which is deployed in an Internal Virtual + Network. Available only for Basic, Standard and Premium SKU. + :vartype private_ip_addresses: list[str] + :param virtual_network_configuration: Virtual network configuration of the + API Management service. + :type virtual_network_configuration: + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration + :param additional_locations: Additional datacenter locations of the API + Management service. + :type additional_locations: + list[~azure.mgmt.apimanagement.models.AdditionalLocation] + :param custom_properties: Custom properties of the API Management service. + Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 + and 1.2). Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + can be used to disable just TLS 1.1 and setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + can be used to disable TLS 1.0 on an API Management service. + :type custom_properties: dict[str, str] + :param certificates: List of Certificates that need to be installed in the + API Management service. Max supported certificates that can be installed + is 10. + :type certificates: + list[~azure.mgmt.apimanagement.models.CertificateConfiguration] + :param virtual_network_type: The type of VPN in which API Managemet + service needs to be configured in. None (Default Value) means the API + Management service is not part of any Virtual Network, External means the + API Management deployment is set up inside a Virtual Network having an + Internet Facing Endpoint, and Internal means that API Management + deployment is setup inside a Virtual Network having an Intranet Facing + Endpoint only. Possible values include: 'None', 'External', 'Internal'. + Default value: "None" . + :type virtual_network_type: str or + ~azure.mgmt.apimanagement.models.VirtualNetworkType + :param publisher_email: Required. Publisher email. + :type publisher_email: str + :param publisher_name: Required. Publisher name. + :type publisher_name: str + :param sku: Required. SKU properties of the API Management service. + :type sku: + ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties + :param identity: Managed service identity of the Api Management service. + :type identity: + ~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity + :param location: Required. Resource location. + :type location: str + :ivar etag: ETag of the resource. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'notification_sender_email': {'max_length': 100}, + 'provisioning_state': {'readonly': True}, + 'target_provisioning_state': {'readonly': True}, + 'created_at_utc': {'readonly': True}, + 'gateway_url': {'readonly': True}, + 'gateway_regional_url': {'readonly': True}, + 'portal_url': {'readonly': True}, + 'management_api_url': {'readonly': True}, + 'scm_url': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + 'private_ip_addresses': {'readonly': True}, + 'publisher_email': {'required': True, 'max_length': 100}, + 'publisher_name': {'required': True, 'max_length': 100}, + 'sku': {'required': True}, + 'location': {'required': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'notification_sender_email': {'key': 'properties.notificationSenderEmail', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'target_provisioning_state': {'key': 'properties.targetProvisioningState', 'type': 'str'}, + 'created_at_utc': {'key': 'properties.createdAtUtc', 'type': 'iso-8601'}, + 'gateway_url': {'key': 'properties.gatewayUrl', 'type': 'str'}, + 'gateway_regional_url': {'key': 'properties.gatewayRegionalUrl', 'type': 'str'}, + 'portal_url': {'key': 'properties.portalUrl', 'type': 'str'}, + 'management_api_url': {'key': 'properties.managementApiUrl', 'type': 'str'}, + 'scm_url': {'key': 'properties.scmUrl', 'type': 'str'}, + 'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'}, + 'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'}, + 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'}, + 'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'}, + 'certificates': {'key': 'properties.certificates', 'type': '[CertificateConfiguration]'}, + 'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'}, + 'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, + 'identity': {'key': 'identity', 'type': 'ApiManagementServiceIdentity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, publisher_email: str, publisher_name: str, sku, location: str, tags=None, notification_sender_email: str=None, hostname_configurations=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, virtual_network_type="None", identity=None, **kwargs) -> None: + super(ApiManagementServiceResource, self).__init__(tags=tags, **kwargs) + self.notification_sender_email = notification_sender_email + self.provisioning_state = None + self.target_provisioning_state = None + self.created_at_utc = None + self.gateway_url = None + self.gateway_regional_url = None + self.portal_url = None + self.management_api_url = None + self.scm_url = None + self.hostname_configurations = hostname_configurations + self.public_ip_addresses = None + self.private_ip_addresses = None + self.virtual_network_configuration = virtual_network_configuration + self.additional_locations = additional_locations + self.custom_properties = custom_properties + self.certificates = certificates + self.virtual_network_type = virtual_network_type + self.publisher_email = publisher_email + self.publisher_name = publisher_name + self.sku = sku + self.identity = identity + self.location = location + self.etag = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_sku_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_sku_properties.py new file mode 100644 index 000000000000..da7bbcf4e442 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_sku_properties.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceSkuProperties(Model): + """API Management service resource SKU properties. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the Sku. Possible values include: + 'Developer', 'Standard', 'Premium', 'Basic' + :type name: str or ~azure.mgmt.apimanagement.models.SkuType + :param capacity: Capacity of the SKU (number of deployed units of the + SKU). The default value is 1. Default value: 1 . + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceSkuProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capacity = kwargs.get('capacity', 1) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_sku_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_sku_properties_py3.py new file mode 100644 index 000000000000..d97692da043b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_sku_properties_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceSkuProperties(Model): + """API Management service resource SKU properties. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the Sku. Possible values include: + 'Developer', 'Standard', 'Premium', 'Basic' + :type name: str or ~azure.mgmt.apimanagement.models.SkuType + :param capacity: Capacity of the SKU (number of deployed units of the + SKU). The default value is 1. Default value: 1 . + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name, capacity: int=1, **kwargs) -> None: + super(ApiManagementServiceSkuProperties, self).__init__(**kwargs) + self.name = name + self.capacity = capacity diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_hostname_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_hostname_parameters.py new file mode 100644 index 000000000000..d5287c1bc66a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_hostname_parameters.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceUpdateHostnameParameters(Model): + """Parameters supplied to the UpdateHostname operation. + + :param update: Hostnames to create or update. + :type update: + list[~azure.mgmt.apimanagement.models.HostnameConfigurationOld] + :param delete: Hostnames types to delete. + :type delete: list[str or ~azure.mgmt.apimanagement.models.HostnameType] + """ + + _attribute_map = { + 'update': {'key': 'update', 'type': '[HostnameConfigurationOld]'}, + 'delete': {'key': 'delete', 'type': '[HostnameType]'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceUpdateHostnameParameters, self).__init__(**kwargs) + self.update = kwargs.get('update', None) + self.delete = kwargs.get('delete', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_hostname_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_hostname_parameters_py3.py new file mode 100644 index 000000000000..f4e99094ac7c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_hostname_parameters_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceUpdateHostnameParameters(Model): + """Parameters supplied to the UpdateHostname operation. + + :param update: Hostnames to create or update. + :type update: + list[~azure.mgmt.apimanagement.models.HostnameConfigurationOld] + :param delete: Hostnames types to delete. + :type delete: list[str or ~azure.mgmt.apimanagement.models.HostnameType] + """ + + _attribute_map = { + 'update': {'key': 'update', 'type': '[HostnameConfigurationOld]'}, + 'delete': {'key': 'delete', 'type': '[HostnameType]'}, + } + + def __init__(self, *, update=None, delete=None, **kwargs) -> None: + super(ApiManagementServiceUpdateHostnameParameters, self).__init__(**kwargs) + self.update = update + self.delete = delete diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_parameters.py new file mode 100644 index 000000000000..49312f82baf2 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_parameters.py @@ -0,0 +1,189 @@ +# 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 .apim_resource import ApimResource + + +class ApiManagementServiceUpdateParameters(ApimResource): + """Parameter supplied to Update Api Management Service. + + Variables are only populated by 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 for API Management resource is set to + Microsoft.ApiManagement. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param notification_sender_email: Email address from which the + notification will be sent. + :type notification_sender_email: str + :ivar provisioning_state: The current provisioning state of the API + Management service which can be one of the following: + Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + :vartype provisioning_state: str + :ivar target_provisioning_state: The provisioning state of the API + Management service, which is targeted by the long running operation + started on the service. + :vartype target_provisioning_state: str + :ivar created_at_utc: Creation UTC date of the API Management service.The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :vartype created_at_utc: datetime + :ivar gateway_url: Gateway URL of the API Management service. + :vartype gateway_url: str + :ivar gateway_regional_url: Gateway URL of the API Management service in + the Default Region. + :vartype gateway_regional_url: str + :ivar portal_url: Publisher portal endpoint Url of the API Management + service. + :vartype portal_url: str + :ivar management_api_url: Management API endpoint URL of the API + Management service. + :vartype management_api_url: str + :ivar scm_url: SCM endpoint URL of the API Management service. + :vartype scm_url: str + :param hostname_configurations: Custom hostname configuration of the API + Management service. + :type hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] + :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the + API Management service. Available only for Basic, Standard and Premium + SKU. + :vartype public_ip_addresses: list[str] + :ivar private_ip_addresses: Private Static Load Balanced IP addresses of + the API Management service which is deployed in an Internal Virtual + Network. Available only for Basic, Standard and Premium SKU. + :vartype private_ip_addresses: list[str] + :param virtual_network_configuration: Virtual network configuration of the + API Management service. + :type virtual_network_configuration: + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration + :param additional_locations: Additional datacenter locations of the API + Management service. + :type additional_locations: + list[~azure.mgmt.apimanagement.models.AdditionalLocation] + :param custom_properties: Custom properties of the API Management service. + Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 + and 1.2). Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + can be used to disable just TLS 1.1 and setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + can be used to disable TLS 1.0 on an API Management service. + :type custom_properties: dict[str, str] + :param certificates: List of Certificates that need to be installed in the + API Management service. Max supported certificates that can be installed + is 10. + :type certificates: + list[~azure.mgmt.apimanagement.models.CertificateConfiguration] + :param virtual_network_type: The type of VPN in which API Managemet + service needs to be configured in. None (Default Value) means the API + Management service is not part of any Virtual Network, External means the + API Management deployment is set up inside a Virtual Network having an + Internet Facing Endpoint, and Internal means that API Management + deployment is setup inside a Virtual Network having an Intranet Facing + Endpoint only. Possible values include: 'None', 'External', 'Internal'. + Default value: "None" . + :type virtual_network_type: str or + ~azure.mgmt.apimanagement.models.VirtualNetworkType + :param publisher_email: Publisher email. + :type publisher_email: str + :param publisher_name: Publisher name. + :type publisher_name: str + :param sku: SKU properties of the API Management service. + :type sku: + ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties + :param identity: Managed service identity of the Api Management service. + :type identity: + ~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity + :ivar etag: ETag of the resource. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'notification_sender_email': {'max_length': 100}, + 'provisioning_state': {'readonly': True}, + 'target_provisioning_state': {'readonly': True}, + 'created_at_utc': {'readonly': True}, + 'gateway_url': {'readonly': True}, + 'gateway_regional_url': {'readonly': True}, + 'portal_url': {'readonly': True}, + 'management_api_url': {'readonly': True}, + 'scm_url': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + 'private_ip_addresses': {'readonly': True}, + 'publisher_email': {'max_length': 100}, + 'publisher_name': {'max_length': 100}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'notification_sender_email': {'key': 'properties.notificationSenderEmail', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'target_provisioning_state': {'key': 'properties.targetProvisioningState', 'type': 'str'}, + 'created_at_utc': {'key': 'properties.createdAtUtc', 'type': 'iso-8601'}, + 'gateway_url': {'key': 'properties.gatewayUrl', 'type': 'str'}, + 'gateway_regional_url': {'key': 'properties.gatewayRegionalUrl', 'type': 'str'}, + 'portal_url': {'key': 'properties.portalUrl', 'type': 'str'}, + 'management_api_url': {'key': 'properties.managementApiUrl', 'type': 'str'}, + 'scm_url': {'key': 'properties.scmUrl', 'type': 'str'}, + 'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'}, + 'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'}, + 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'}, + 'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'}, + 'certificates': {'key': 'properties.certificates', 'type': '[CertificateConfiguration]'}, + 'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'}, + 'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, + 'identity': {'key': 'identity', 'type': 'ApiManagementServiceIdentity'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceUpdateParameters, self).__init__(**kwargs) + self.notification_sender_email = kwargs.get('notification_sender_email', None) + self.provisioning_state = None + self.target_provisioning_state = None + self.created_at_utc = None + self.gateway_url = None + self.gateway_regional_url = None + self.portal_url = None + self.management_api_url = None + self.scm_url = None + self.hostname_configurations = kwargs.get('hostname_configurations', None) + self.public_ip_addresses = None + self.private_ip_addresses = None + self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) + self.additional_locations = kwargs.get('additional_locations', None) + self.custom_properties = kwargs.get('custom_properties', None) + self.certificates = kwargs.get('certificates', None) + self.virtual_network_type = kwargs.get('virtual_network_type', "None") + self.publisher_email = kwargs.get('publisher_email', None) + self.publisher_name = kwargs.get('publisher_name', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) + self.etag = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_parameters_py3.py new file mode 100644 index 000000000000..09f64e683468 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_update_parameters_py3.py @@ -0,0 +1,189 @@ +# 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 .apim_resource import ApimResource + + +class ApiManagementServiceUpdateParameters(ApimResource): + """Parameter supplied to Update Api Management Service. + + Variables are only populated by 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 for API Management resource is set to + Microsoft.ApiManagement. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param notification_sender_email: Email address from which the + notification will be sent. + :type notification_sender_email: str + :ivar provisioning_state: The current provisioning state of the API + Management service which can be one of the following: + Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + :vartype provisioning_state: str + :ivar target_provisioning_state: The provisioning state of the API + Management service, which is targeted by the long running operation + started on the service. + :vartype target_provisioning_state: str + :ivar created_at_utc: Creation UTC date of the API Management service.The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :vartype created_at_utc: datetime + :ivar gateway_url: Gateway URL of the API Management service. + :vartype gateway_url: str + :ivar gateway_regional_url: Gateway URL of the API Management service in + the Default Region. + :vartype gateway_regional_url: str + :ivar portal_url: Publisher portal endpoint Url of the API Management + service. + :vartype portal_url: str + :ivar management_api_url: Management API endpoint URL of the API + Management service. + :vartype management_api_url: str + :ivar scm_url: SCM endpoint URL of the API Management service. + :vartype scm_url: str + :param hostname_configurations: Custom hostname configuration of the API + Management service. + :type hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] + :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the + API Management service. Available only for Basic, Standard and Premium + SKU. + :vartype public_ip_addresses: list[str] + :ivar private_ip_addresses: Private Static Load Balanced IP addresses of + the API Management service which is deployed in an Internal Virtual + Network. Available only for Basic, Standard and Premium SKU. + :vartype private_ip_addresses: list[str] + :param virtual_network_configuration: Virtual network configuration of the + API Management service. + :type virtual_network_configuration: + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration + :param additional_locations: Additional datacenter locations of the API + Management service. + :type additional_locations: + list[~azure.mgmt.apimanagement.models.AdditionalLocation] + :param custom_properties: Custom properties of the API Management service. + Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 + and 1.2). Setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + can be used to disable just TLS 1.1 and setting + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + can be used to disable TLS 1.0 on an API Management service. + :type custom_properties: dict[str, str] + :param certificates: List of Certificates that need to be installed in the + API Management service. Max supported certificates that can be installed + is 10. + :type certificates: + list[~azure.mgmt.apimanagement.models.CertificateConfiguration] + :param virtual_network_type: The type of VPN in which API Managemet + service needs to be configured in. None (Default Value) means the API + Management service is not part of any Virtual Network, External means the + API Management deployment is set up inside a Virtual Network having an + Internet Facing Endpoint, and Internal means that API Management + deployment is setup inside a Virtual Network having an Intranet Facing + Endpoint only. Possible values include: 'None', 'External', 'Internal'. + Default value: "None" . + :type virtual_network_type: str or + ~azure.mgmt.apimanagement.models.VirtualNetworkType + :param publisher_email: Publisher email. + :type publisher_email: str + :param publisher_name: Publisher name. + :type publisher_name: str + :param sku: SKU properties of the API Management service. + :type sku: + ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties + :param identity: Managed service identity of the Api Management service. + :type identity: + ~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity + :ivar etag: ETag of the resource. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'notification_sender_email': {'max_length': 100}, + 'provisioning_state': {'readonly': True}, + 'target_provisioning_state': {'readonly': True}, + 'created_at_utc': {'readonly': True}, + 'gateway_url': {'readonly': True}, + 'gateway_regional_url': {'readonly': True}, + 'portal_url': {'readonly': True}, + 'management_api_url': {'readonly': True}, + 'scm_url': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + 'private_ip_addresses': {'readonly': True}, + 'publisher_email': {'max_length': 100}, + 'publisher_name': {'max_length': 100}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'notification_sender_email': {'key': 'properties.notificationSenderEmail', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'target_provisioning_state': {'key': 'properties.targetProvisioningState', 'type': 'str'}, + 'created_at_utc': {'key': 'properties.createdAtUtc', 'type': 'iso-8601'}, + 'gateway_url': {'key': 'properties.gatewayUrl', 'type': 'str'}, + 'gateway_regional_url': {'key': 'properties.gatewayRegionalUrl', 'type': 'str'}, + 'portal_url': {'key': 'properties.portalUrl', 'type': 'str'}, + 'management_api_url': {'key': 'properties.managementApiUrl', 'type': 'str'}, + 'scm_url': {'key': 'properties.scmUrl', 'type': 'str'}, + 'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'}, + 'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'}, + 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'}, + 'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'}, + 'certificates': {'key': 'properties.certificates', 'type': '[CertificateConfiguration]'}, + 'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'}, + 'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, + 'identity': {'key': 'identity', 'type': 'ApiManagementServiceIdentity'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, notification_sender_email: str=None, hostname_configurations=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, virtual_network_type="None", publisher_email: str=None, publisher_name: str=None, sku=None, identity=None, **kwargs) -> None: + super(ApiManagementServiceUpdateParameters, self).__init__(tags=tags, **kwargs) + self.notification_sender_email = notification_sender_email + self.provisioning_state = None + self.target_provisioning_state = None + self.created_at_utc = None + self.gateway_url = None + self.gateway_regional_url = None + self.portal_url = None + self.management_api_url = None + self.scm_url = None + self.hostname_configurations = hostname_configurations + self.public_ip_addresses = None + self.private_ip_addresses = None + self.virtual_network_configuration = virtual_network_configuration + self.additional_locations = additional_locations + self.custom_properties = custom_properties + self.certificates = certificates + self.virtual_network_type = virtual_network_type + self.publisher_email = publisher_email + self.publisher_name = publisher_name + self.sku = sku + self.identity = identity + self.etag = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_upload_certificate_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_upload_certificate_parameters.py new file mode 100644 index 000000000000..52ce4a9c9384 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_upload_certificate_parameters.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceUploadCertificateParameters(Model): + """Parameters supplied to the Upload SSL certificate for an API Management + service operation. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Hostname type. Possible values include: 'Proxy', + 'Portal', 'Management', 'Scm' + :type type: str or ~azure.mgmt.apimanagement.models.HostnameType + :param certificate: Required. Base64 Encoded certificate. + :type certificate: str + :param certificate_password: Required. Certificate password. + :type certificate_password: str + """ + + _validation = { + 'type': {'required': True}, + 'certificate': {'required': True}, + 'certificate_password': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'HostnameType'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificate_password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiManagementServiceUploadCertificateParameters, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.certificate = kwargs.get('certificate', None) + self.certificate_password = kwargs.get('certificate_password', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_upload_certificate_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_upload_certificate_parameters_py3.py new file mode 100644 index 000000000000..b264650b0527 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_service_upload_certificate_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class ApiManagementServiceUploadCertificateParameters(Model): + """Parameters supplied to the Upload SSL certificate for an API Management + service operation. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Hostname type. Possible values include: 'Proxy', + 'Portal', 'Management', 'Scm' + :type type: str or ~azure.mgmt.apimanagement.models.HostnameType + :param certificate: Required. Base64 Encoded certificate. + :type certificate: str + :param certificate_password: Required. Certificate password. + :type certificate_password: str + """ + + _validation = { + 'type': {'required': True}, + 'certificate': {'required': True}, + 'certificate_password': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'HostnameType'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificate_password', 'type': 'str'}, + } + + def __init__(self, *, type, certificate: str, certificate_password: str, **kwargs) -> None: + super(ApiManagementServiceUploadCertificateParameters, self).__init__(**kwargs) + self.type = type + self.certificate = certificate + self.certificate_password = certificate_password diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_release_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_release_contract.py new file mode 100644 index 000000000000..cbee7727371e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_release_contract.py @@ -0,0 +1,62 @@ +# 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 .resource import Resource + + +class ApiReleaseContract(Resource): + """Api Release details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param api_id: Identifier of the API the release belongs to. + :type api_id: str + :ivar created_date_time: The time the API was released. The date conforms + to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 + standard. + :vartype created_date_time: datetime + :ivar updated_date_time: The time the API release was updated. + :vartype updated_date_time: datetime + :param notes: Release Notes + :type notes: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'updated_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'api_id': {'key': 'properties.apiId', 'type': 'str'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + 'updated_date_time': {'key': 'properties.updatedDateTime', 'type': 'iso-8601'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiReleaseContract, self).__init__(**kwargs) + self.api_id = kwargs.get('api_id', None) + self.created_date_time = None + self.updated_date_time = None + self.notes = kwargs.get('notes', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_release_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_release_contract_paged.py new file mode 100644 index 000000000000..f95ad2334f66 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_release_contract_paged.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 msrest.paging import Paged + + +class ApiReleaseContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApiReleaseContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApiReleaseContract]'} + } + + def __init__(self, *args, **kwargs): + + super(ApiReleaseContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_release_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_release_contract_py3.py new file mode 100644 index 000000000000..ec86e723b6d1 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_release_contract_py3.py @@ -0,0 +1,62 @@ +# 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 .resource import Resource + + +class ApiReleaseContract(Resource): + """Api Release details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param api_id: Identifier of the API the release belongs to. + :type api_id: str + :ivar created_date_time: The time the API was released. The date conforms + to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 + standard. + :vartype created_date_time: datetime + :ivar updated_date_time: The time the API release was updated. + :vartype updated_date_time: datetime + :param notes: Release Notes + :type notes: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'updated_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'api_id': {'key': 'properties.apiId', 'type': 'str'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + 'updated_date_time': {'key': 'properties.updatedDateTime', 'type': 'iso-8601'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + } + + def __init__(self, *, api_id: str=None, notes: str=None, **kwargs) -> None: + super(ApiReleaseContract, self).__init__(, **kwargs) + self.api_id = api_id + self.created_date_time = None + self.updated_date_time = None + self.notes = notes diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_contract.py new file mode 100644 index 000000000000..8ee1788c315a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_contract.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class ApiRevisionContract(Model): + """Summary of revision metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar api_id: Identifier of the API Revision. + :vartype api_id: str + :ivar api_revision: Revision number of API. + :vartype api_revision: str + :ivar created_date_time: The time the API Revision was created. The date + conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the + ISO 8601 standard. + :vartype created_date_time: datetime + :ivar updated_date_time: The time the API Revision were updated. The date + conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the + ISO 8601 standard. + :vartype updated_date_time: datetime + :ivar description: Description of the API Revision. + :vartype description: str + :ivar private_url: Gateway URL for accessing the non-current API Revision. + :vartype private_url: str + :ivar is_online: Indicates if API revision is the current api revision. + :vartype is_online: bool + :ivar is_current: Indicates if API revision is accessible via the gateway. + :vartype is_current: bool + """ + + _validation = { + 'api_id': {'readonly': True}, + 'api_revision': {'readonly': True, 'max_length': 100, 'min_length': 1}, + 'created_date_time': {'readonly': True}, + 'updated_date_time': {'readonly': True}, + 'description': {'readonly': True, 'max_length': 256}, + 'private_url': {'readonly': True}, + 'is_online': {'readonly': True}, + 'is_current': {'readonly': True}, + } + + _attribute_map = { + 'api_id': {'key': 'apiId', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'updated_date_time': {'key': 'updatedDateTime', 'type': 'iso-8601'}, + 'description': {'key': 'description', 'type': 'str'}, + 'private_url': {'key': 'privateUrl', 'type': 'str'}, + 'is_online': {'key': 'isOnline', 'type': 'bool'}, + 'is_current': {'key': 'isCurrent', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ApiRevisionContract, self).__init__(**kwargs) + self.api_id = None + self.api_revision = None + self.created_date_time = None + self.updated_date_time = None + self.description = None + self.private_url = None + self.is_online = None + self.is_current = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_contract_paged.py new file mode 100644 index 000000000000..1cc0fe483079 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_contract_paged.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 msrest.paging import Paged + + +class ApiRevisionContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApiRevisionContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApiRevisionContract]'} + } + + def __init__(self, *args, **kwargs): + + super(ApiRevisionContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_contract_py3.py new file mode 100644 index 000000000000..a3b4f9892094 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_contract_py3.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class ApiRevisionContract(Model): + """Summary of revision metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar api_id: Identifier of the API Revision. + :vartype api_id: str + :ivar api_revision: Revision number of API. + :vartype api_revision: str + :ivar created_date_time: The time the API Revision was created. The date + conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the + ISO 8601 standard. + :vartype created_date_time: datetime + :ivar updated_date_time: The time the API Revision were updated. The date + conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the + ISO 8601 standard. + :vartype updated_date_time: datetime + :ivar description: Description of the API Revision. + :vartype description: str + :ivar private_url: Gateway URL for accessing the non-current API Revision. + :vartype private_url: str + :ivar is_online: Indicates if API revision is the current api revision. + :vartype is_online: bool + :ivar is_current: Indicates if API revision is accessible via the gateway. + :vartype is_current: bool + """ + + _validation = { + 'api_id': {'readonly': True}, + 'api_revision': {'readonly': True, 'max_length': 100, 'min_length': 1}, + 'created_date_time': {'readonly': True}, + 'updated_date_time': {'readonly': True}, + 'description': {'readonly': True, 'max_length': 256}, + 'private_url': {'readonly': True}, + 'is_online': {'readonly': True}, + 'is_current': {'readonly': True}, + } + + _attribute_map = { + 'api_id': {'key': 'apiId', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'updated_date_time': {'key': 'updatedDateTime', 'type': 'iso-8601'}, + 'description': {'key': 'description', 'type': 'str'}, + 'private_url': {'key': 'privateUrl', 'type': 'str'}, + 'is_online': {'key': 'isOnline', 'type': 'bool'}, + 'is_current': {'key': 'isCurrent', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(ApiRevisionContract, self).__init__(**kwargs) + self.api_id = None + self.api_revision = None + self.created_date_time = None + self.updated_date_time = None + self.description = None + self.private_url = None + self.is_online = None + self.is_current = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_info_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_info_contract.py new file mode 100644 index 000000000000..f134492b1db3 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_info_contract.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class ApiRevisionInfoContract(Model): + """Object used to create an API Revision or Version based on an existing API + Revision. + + :param source_api_id: Resource identifier of API to be used to create the + revision from. + :type source_api_id: str + :param api_version_name: Version identifier for the new API Version. + :type api_version_name: str + :param api_revision_description: Description of new API Revision. + :type api_revision_description: str + :param api_version_set: Version set details + :type api_version_set: + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails + """ + + _validation = { + 'api_version_name': {'max_length': 100}, + 'api_revision_description': {'max_length': 256}, + } + + _attribute_map = { + 'source_api_id': {'key': 'sourceApiId', 'type': 'str'}, + 'api_version_name': {'key': 'apiVersionName', 'type': 'str'}, + 'api_revision_description': {'key': 'apiRevisionDescription', 'type': 'str'}, + 'api_version_set': {'key': 'apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, + } + + def __init__(self, **kwargs): + super(ApiRevisionInfoContract, self).__init__(**kwargs) + self.source_api_id = kwargs.get('source_api_id', None) + self.api_version_name = kwargs.get('api_version_name', None) + self.api_revision_description = kwargs.get('api_revision_description', None) + self.api_version_set = kwargs.get('api_version_set', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_info_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_info_contract_py3.py new file mode 100644 index 000000000000..7f2ccaed2b0e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_revision_info_contract_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class ApiRevisionInfoContract(Model): + """Object used to create an API Revision or Version based on an existing API + Revision. + + :param source_api_id: Resource identifier of API to be used to create the + revision from. + :type source_api_id: str + :param api_version_name: Version identifier for the new API Version. + :type api_version_name: str + :param api_revision_description: Description of new API Revision. + :type api_revision_description: str + :param api_version_set: Version set details + :type api_version_set: + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails + """ + + _validation = { + 'api_version_name': {'max_length': 100}, + 'api_revision_description': {'max_length': 256}, + } + + _attribute_map = { + 'source_api_id': {'key': 'sourceApiId', 'type': 'str'}, + 'api_version_name': {'key': 'apiVersionName', 'type': 'str'}, + 'api_revision_description': {'key': 'apiRevisionDescription', 'type': 'str'}, + 'api_version_set': {'key': 'apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, + } + + def __init__(self, *, source_api_id: str=None, api_version_name: str=None, api_revision_description: str=None, api_version_set=None, **kwargs) -> None: + super(ApiRevisionInfoContract, self).__init__(**kwargs) + self.source_api_id = source_api_id + self.api_version_name = api_version_name + self.api_revision_description = api_revision_description + self.api_version_set = api_version_set diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_tag_resource_contract_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_tag_resource_contract_properties.py new file mode 100644 index 000000000000..986a28dcac22 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_tag_resource_contract_properties.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 .api_entity_base_contract import ApiEntityBaseContract + + +class ApiTagResourceContractProperties(ApiEntityBaseContract): + """API contract properties for the Tag Resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param id: API identifier in the form /apis/{apiId}. + :type id: str + :param name: API name. + :type name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Relative URL uniquely identifying this API and all of its + resource paths within the API Management service instance. It is appended + to the API endpoint base URL specified during the service instance + creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 1}, + 'path': {'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authentication_settings': {'key': 'authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'type', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'is_current': {'key': 'isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'protocols': {'key': 'protocols', 'type': '[Protocol]'}, + } + + def __init__(self, **kwargs): + super(ApiTagResourceContractProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.service_url = kwargs.get('service_url', None) + self.path = kwargs.get('path', None) + self.protocols = kwargs.get('protocols', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_tag_resource_contract_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_tag_resource_contract_properties_py3.py new file mode 100644 index 000000000000..89fc914e2ed9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_tag_resource_contract_properties_py3.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 .api_entity_base_contract import ApiEntityBaseContract + + +class ApiTagResourceContractProperties(ApiEntityBaseContract): + """API contract properties for the Tag Resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param id: API identifier in the form /apis/{apiId}. + :type id: str + :param name: API name. + :type name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Relative URL uniquely identifying this API and all of its + resource paths within the API Management service instance. It is appended + to the API endpoint base URL specified during the service instance + creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 1}, + 'path': {'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authentication_settings': {'key': 'authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'type', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'is_current': {'key': 'isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'protocols': {'key': 'protocols', 'type': '[Protocol]'}, + } + + def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, api_version_set_id: str=None, id: str=None, name: str=None, service_url: str=None, path: str=None, protocols=None, **kwargs) -> None: + super(ApiTagResourceContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, api_version_set_id=api_version_set_id, **kwargs) + self.id = id + self.name = name + self.service_url = service_url + self.path = path + self.protocols = protocols diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_update_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_update_contract.py new file mode 100644 index 000000000000..6d1df2e380a9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_update_contract.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 msrest.serialization import Model + + +class ApiUpdateContract(Model): + """API update contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param display_name: API name. + :type display_name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Relative URL uniquely identifying this API and all of its + resource paths within the API Management service instance. It is appended + to the API endpoint base URL specified during the service instance + creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 1}, + 'path': {'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authentication_settings': {'key': 'properties.authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'properties.subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'properties.type', 'type': 'str'}, + 'api_revision': {'key': 'properties.apiRevision', 'type': 'str'}, + 'api_version': {'key': 'properties.apiVersion', 'type': 'str'}, + 'is_current': {'key': 'properties.isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'properties.isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + } + + def __init__(self, **kwargs): + super(ApiUpdateContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.authentication_settings = kwargs.get('authentication_settings', None) + self.subscription_key_parameter_names = kwargs.get('subscription_key_parameter_names', None) + self.api_type = kwargs.get('api_type', None) + self.api_revision = kwargs.get('api_revision', None) + self.api_version = kwargs.get('api_version', None) + self.is_current = None + self.is_online = None + self.api_version_set_id = kwargs.get('api_version_set_id', None) + self.display_name = kwargs.get('display_name', None) + self.service_url = kwargs.get('service_url', None) + self.path = kwargs.get('path', None) + self.protocols = kwargs.get('protocols', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_update_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_update_contract_py3.py new file mode 100644 index 000000000000..270935c93e75 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_update_contract_py3.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 msrest.serialization import Model + + +class ApiUpdateContract(Model): + """API update contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param description: Description of the API. May include HTML formatting + tags. + :type description: str + :param authentication_settings: Collection of authentication settings + included into this API. + :type authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract + :param subscription_key_parameter_names: Protocols over which API is made + available. + :type subscription_key_parameter_names: + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract + :param api_type: Type of API. Possible values include: 'http', 'soap' + :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType + :param api_revision: Describes the Revision of the Api. If no value is + provided, default revision 1 is created + :type api_revision: str + :param api_version: Indicates the Version identifier of the API if the API + is versioned + :type api_version: str + :ivar is_current: Indicates if API revision is current api revision. + :vartype is_current: bool + :ivar is_online: Indicates if API revision is accessible via the gateway. + :vartype is_online: bool + :param api_version_set_id: A resource identifier for the related + ApiVersionSet. + :type api_version_set_id: str + :param display_name: API name. + :type display_name: str + :param service_url: Absolute URL of the backend service implementing this + API. + :type service_url: str + :param path: Relative URL uniquely identifying this API and all of its + resource paths within the API Management service instance. It is appended + to the API endpoint base URL specified during the service instance + creation to form a public URL for this API. + :type path: str + :param protocols: Describes on which protocols the operations in this API + can be invoked. + :type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] + """ + + _validation = { + 'api_revision': {'max_length': 100, 'min_length': 1}, + 'api_version': {'max_length': 100}, + 'is_current': {'readonly': True}, + 'is_online': {'readonly': True}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'service_url': {'max_length': 2000, 'min_length': 1}, + 'path': {'max_length': 400, 'min_length': 0}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authentication_settings': {'key': 'properties.authenticationSettings', 'type': 'AuthenticationSettingsContract'}, + 'subscription_key_parameter_names': {'key': 'properties.subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'}, + 'api_type': {'key': 'properties.type', 'type': 'str'}, + 'api_revision': {'key': 'properties.apiRevision', 'type': 'str'}, + 'api_version': {'key': 'properties.apiVersion', 'type': 'str'}, + 'is_current': {'key': 'properties.isCurrent', 'type': 'bool'}, + 'is_online': {'key': 'properties.isOnline', 'type': 'bool'}, + 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + } + + def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, api_version_set_id: str=None, display_name: str=None, service_url: str=None, path: str=None, protocols=None, **kwargs) -> None: + super(ApiUpdateContract, self).__init__(**kwargs) + self.description = description + self.authentication_settings = authentication_settings + self.subscription_key_parameter_names = subscription_key_parameter_names + self.api_type = api_type + self.api_revision = api_revision + self.api_version = api_version + self.is_current = None + self.is_online = None + self.api_version_set_id = api_version_set_id + self.display_name = display_name + self.service_url = service_url + self.path = path + self.protocols = protocols diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract.py new file mode 100644 index 000000000000..841221ab5ca4 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract.py @@ -0,0 +1,73 @@ +# 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 .resource import Resource + + +class ApiVersionSetContract(Resource): + """Api Version Set Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param description: Description of API Version Set. + :type description: str + :param version_query_name: Name of query parameter that indicates the API + Version if versioningScheme is set to `query`. + :type version_query_name: str + :param version_header_name: Name of HTTP header parameter that indicates + the API Version if versioningScheme is set to `header`. + :type version_header_name: str + :param display_name: Required. Name of API Version Set + :type display_name: str + :param versioning_scheme: Required. An value that determines where the API + Version identifer will be located in a HTTP request. Possible values + include: 'Segment', 'Query', 'Header' + :type versioning_scheme: str or + ~azure.mgmt.apimanagement.models.VersioningScheme + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'version_query_name': {'max_length': 100, 'min_length': 1}, + 'version_header_name': {'max_length': 100, 'min_length': 1}, + 'display_name': {'required': True, 'max_length': 100, 'min_length': 1}, + 'versioning_scheme': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version_query_name': {'key': 'properties.versionQueryName', 'type': 'str'}, + 'version_header_name': {'key': 'properties.versionHeaderName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'versioning_scheme': {'key': 'properties.versioningScheme', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiVersionSetContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.version_query_name = kwargs.get('version_query_name', None) + self.version_header_name = kwargs.get('version_header_name', None) + self.display_name = kwargs.get('display_name', None) + self.versioning_scheme = kwargs.get('versioning_scheme', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_details.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_details.py new file mode 100644 index 000000000000..4cee808912e1 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_details.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class ApiVersionSetContractDetails(Model): + """An API Version Set contains the common configuration for a set of API + Versions relating . + + :param id: Identifier for existing API Version Set. Omit this value to + create a new Version Set. + :type id: str + :param description: Description of API Version Set. + :type description: str + :param versioning_scheme: An value that determines where the API Version + identifer will be located in a HTTP request. Possible values include: + 'Segment', 'Query', 'Header' + :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.enum + :param version_query_name: Name of query parameter that indicates the API + Version if versioningScheme is set to `query`. + :type version_query_name: str + :param version_header_name: Name of HTTP header parameter that indicates + the API Version if versioningScheme is set to `header`. + :type version_header_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'versioning_scheme': {'key': 'versioningScheme', 'type': 'str'}, + 'version_query_name': {'key': 'versionQueryName', 'type': 'str'}, + 'version_header_name': {'key': 'versionHeaderName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiVersionSetContractDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.description = kwargs.get('description', None) + self.versioning_scheme = kwargs.get('versioning_scheme', None) + self.version_query_name = kwargs.get('version_query_name', None) + self.version_header_name = kwargs.get('version_header_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_details_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_details_py3.py new file mode 100644 index 000000000000..d412da8ef191 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_details_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class ApiVersionSetContractDetails(Model): + """An API Version Set contains the common configuration for a set of API + Versions relating . + + :param id: Identifier for existing API Version Set. Omit this value to + create a new Version Set. + :type id: str + :param description: Description of API Version Set. + :type description: str + :param versioning_scheme: An value that determines where the API Version + identifer will be located in a HTTP request. Possible values include: + 'Segment', 'Query', 'Header' + :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.enum + :param version_query_name: Name of query parameter that indicates the API + Version if versioningScheme is set to `query`. + :type version_query_name: str + :param version_header_name: Name of HTTP header parameter that indicates + the API Version if versioningScheme is set to `header`. + :type version_header_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'versioning_scheme': {'key': 'versioningScheme', 'type': 'str'}, + 'version_query_name': {'key': 'versionQueryName', 'type': 'str'}, + 'version_header_name': {'key': 'versionHeaderName', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, description: str=None, versioning_scheme=None, version_query_name: str=None, version_header_name: str=None, **kwargs) -> None: + super(ApiVersionSetContractDetails, self).__init__(**kwargs) + self.id = id + self.description = description + self.versioning_scheme = versioning_scheme + self.version_query_name = version_query_name + self.version_header_name = version_header_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_paged.py new file mode 100644 index 000000000000..cfe10ae6a136 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_paged.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 msrest.paging import Paged + + +class ApiVersionSetContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApiVersionSetContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApiVersionSetContract]'} + } + + def __init__(self, *args, **kwargs): + + super(ApiVersionSetContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_py3.py new file mode 100644 index 000000000000..e85093618db0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_contract_py3.py @@ -0,0 +1,73 @@ +# 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 .resource import Resource + + +class ApiVersionSetContract(Resource): + """Api Version Set Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param description: Description of API Version Set. + :type description: str + :param version_query_name: Name of query parameter that indicates the API + Version if versioningScheme is set to `query`. + :type version_query_name: str + :param version_header_name: Name of HTTP header parameter that indicates + the API Version if versioningScheme is set to `header`. + :type version_header_name: str + :param display_name: Required. Name of API Version Set + :type display_name: str + :param versioning_scheme: Required. An value that determines where the API + Version identifer will be located in a HTTP request. Possible values + include: 'Segment', 'Query', 'Header' + :type versioning_scheme: str or + ~azure.mgmt.apimanagement.models.VersioningScheme + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'version_query_name': {'max_length': 100, 'min_length': 1}, + 'version_header_name': {'max_length': 100, 'min_length': 1}, + 'display_name': {'required': True, 'max_length': 100, 'min_length': 1}, + 'versioning_scheme': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version_query_name': {'key': 'properties.versionQueryName', 'type': 'str'}, + 'version_header_name': {'key': 'properties.versionHeaderName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'versioning_scheme': {'key': 'properties.versioningScheme', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, versioning_scheme, description: str=None, version_query_name: str=None, version_header_name: str=None, **kwargs) -> None: + super(ApiVersionSetContract, self).__init__(, **kwargs) + self.description = description + self.version_query_name = version_query_name + self.version_header_name = version_header_name + self.display_name = display_name + self.versioning_scheme = versioning_scheme diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_entity_base.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_entity_base.py new file mode 100644 index 000000000000..c939168cc5e8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_entity_base.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class ApiVersionSetEntityBase(Model): + """Api Version set base parameters. + + :param description: Description of API Version Set. + :type description: str + :param version_query_name: Name of query parameter that indicates the API + Version if versioningScheme is set to `query`. + :type version_query_name: str + :param version_header_name: Name of HTTP header parameter that indicates + the API Version if versioningScheme is set to `header`. + :type version_header_name: str + """ + + _validation = { + 'version_query_name': {'max_length': 100, 'min_length': 1}, + 'version_header_name': {'max_length': 100, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'version_query_name': {'key': 'versionQueryName', 'type': 'str'}, + 'version_header_name': {'key': 'versionHeaderName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiVersionSetEntityBase, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.version_query_name = kwargs.get('version_query_name', None) + self.version_header_name = kwargs.get('version_header_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_entity_base_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_entity_base_py3.py new file mode 100644 index 000000000000..83ff82631423 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_entity_base_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class ApiVersionSetEntityBase(Model): + """Api Version set base parameters. + + :param description: Description of API Version Set. + :type description: str + :param version_query_name: Name of query parameter that indicates the API + Version if versioningScheme is set to `query`. + :type version_query_name: str + :param version_header_name: Name of HTTP header parameter that indicates + the API Version if versioningScheme is set to `header`. + :type version_header_name: str + """ + + _validation = { + 'version_query_name': {'max_length': 100, 'min_length': 1}, + 'version_header_name': {'max_length': 100, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'version_query_name': {'key': 'versionQueryName', 'type': 'str'}, + 'version_header_name': {'key': 'versionHeaderName', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, version_query_name: str=None, version_header_name: str=None, **kwargs) -> None: + super(ApiVersionSetEntityBase, self).__init__(**kwargs) + self.description = description + self.version_query_name = version_query_name + self.version_header_name = version_header_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_update_parameters.py new file mode 100644 index 000000000000..0132a009a6e9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_update_parameters.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class ApiVersionSetUpdateParameters(Model): + """Parameters to update or create an Api Version Set Contract. + + :param description: Description of API Version Set. + :type description: str + :param version_query_name: Name of query parameter that indicates the API + Version if versioningScheme is set to `query`. + :type version_query_name: str + :param version_header_name: Name of HTTP header parameter that indicates + the API Version if versioningScheme is set to `header`. + :type version_header_name: str + :param display_name: Name of API Version Set + :type display_name: str + :param versioning_scheme: An value that determines where the API Version + identifer will be located in a HTTP request. Possible values include: + 'Segment', 'Query', 'Header' + :type versioning_scheme: str or + ~azure.mgmt.apimanagement.models.VersioningScheme + """ + + _validation = { + 'version_query_name': {'max_length': 100, 'min_length': 1}, + 'version_header_name': {'max_length': 100, 'min_length': 1}, + 'display_name': {'max_length': 100, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version_query_name': {'key': 'properties.versionQueryName', 'type': 'str'}, + 'version_header_name': {'key': 'properties.versionHeaderName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'versioning_scheme': {'key': 'properties.versioningScheme', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiVersionSetUpdateParameters, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.version_query_name = kwargs.get('version_query_name', None) + self.version_header_name = kwargs.get('version_header_name', None) + self.display_name = kwargs.get('display_name', None) + self.versioning_scheme = kwargs.get('versioning_scheme', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_update_parameters_py3.py new file mode 100644 index 000000000000..1a8cce08c012 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_version_set_update_parameters_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class ApiVersionSetUpdateParameters(Model): + """Parameters to update or create an Api Version Set Contract. + + :param description: Description of API Version Set. + :type description: str + :param version_query_name: Name of query parameter that indicates the API + Version if versioningScheme is set to `query`. + :type version_query_name: str + :param version_header_name: Name of HTTP header parameter that indicates + the API Version if versioningScheme is set to `header`. + :type version_header_name: str + :param display_name: Name of API Version Set + :type display_name: str + :param versioning_scheme: An value that determines where the API Version + identifer will be located in a HTTP request. Possible values include: + 'Segment', 'Query', 'Header' + :type versioning_scheme: str or + ~azure.mgmt.apimanagement.models.VersioningScheme + """ + + _validation = { + 'version_query_name': {'max_length': 100, 'min_length': 1}, + 'version_header_name': {'max_length': 100, 'min_length': 1}, + 'display_name': {'max_length': 100, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version_query_name': {'key': 'properties.versionQueryName', 'type': 'str'}, + 'version_header_name': {'key': 'properties.versionHeaderName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'versioning_scheme': {'key': 'properties.versioningScheme', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, version_query_name: str=None, version_header_name: str=None, display_name: str=None, versioning_scheme=None, **kwargs) -> None: + super(ApiVersionSetUpdateParameters, self).__init__(**kwargs) + self.description = description + self.version_query_name = version_query_name + self.version_header_name = version_header_name + self.display_name = display_name + self.versioning_scheme = versioning_scheme diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/apim_resource.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/apim_resource.py new file mode 100644 index 000000000000..5812e245eb0d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/apim_resource.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class ApimResource(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 for API Management resource is set to + Microsoft.ApiManagement. + :vartype type: str + :param 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ApimResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/apim_resource_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/apim_resource_py3.py new file mode 100644 index 000000000000..b63a2a6ed74c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/apim_resource_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class ApimResource(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 for API Management resource is set to + Microsoft.ApiManagement. + :vartype type: str + :param 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ApimResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = tags diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authentication_settings_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authentication_settings_contract.py new file mode 100644 index 000000000000..936cc1fd7dba --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authentication_settings_contract.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 msrest.serialization import Model + + +class AuthenticationSettingsContract(Model): + """API Authentication Settings. + + :param o_auth2: OAuth2 Authentication settings + :type o_auth2: + ~azure.mgmt.apimanagement.models.OAuth2AuthenticationSettingsContract + """ + + _attribute_map = { + 'o_auth2': {'key': 'oAuth2', 'type': 'OAuth2AuthenticationSettingsContract'}, + } + + def __init__(self, **kwargs): + super(AuthenticationSettingsContract, self).__init__(**kwargs) + self.o_auth2 = kwargs.get('o_auth2', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authentication_settings_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authentication_settings_contract_py3.py new file mode 100644 index 000000000000..e255bbd523aa --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authentication_settings_contract_py3.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 msrest.serialization import Model + + +class AuthenticationSettingsContract(Model): + """API Authentication Settings. + + :param o_auth2: OAuth2 Authentication settings + :type o_auth2: + ~azure.mgmt.apimanagement.models.OAuth2AuthenticationSettingsContract + """ + + _attribute_map = { + 'o_auth2': {'key': 'oAuth2', 'type': 'OAuth2AuthenticationSettingsContract'}, + } + + def __init__(self, *, o_auth2=None, **kwargs) -> None: + super(AuthenticationSettingsContract, self).__init__(**kwargs) + self.o_auth2 = o_auth2 diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract.py new file mode 100644 index 000000000000..9a50d1d1ee37 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract.py @@ -0,0 +1,142 @@ +# 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 .resource import Resource + + +class AuthorizationServerContract(Resource): + """External OAuth authorization server settings. + + Variables are only 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 for API Management resource. + :vartype type: str + :param description: Description of the authorization server. Can contain + HTML formatting tags. + :type description: str + :param authorization_methods: HTTP verbs supported by the authorization + endpoint. GET must be always present. POST is optional. + :type authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] + :param client_authentication_method: Method of authentication supported by + the token endpoint of this authorization server. Possible values are Basic + and/or Body. When Body is specified, client credentials and other + parameters are passed within the request body in the + application/x-www-form-urlencoded format. + :type client_authentication_method: list[str or + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] + :param token_body_parameters: Additional parameters required by the token + endpoint of this authorization server represented as an array of JSON + objects with name and value string properties, i.e. {"name" : "name + value", "value": "a value"}. + :type token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] + :param token_endpoint: OAuth token endpoint. Contains absolute URI to + entity being referenced. + :type token_endpoint: str + :param support_state: If true, authorization server will include state + parameter from the authorization request to its response. Client may use + state parameter to raise protocol security. + :type support_state: bool + :param default_scope: Access token scope that is going to be requested by + default. Can be overridden at the API level. Should be provided in the + form of a string containing space-delimited values. + :type default_scope: str + :param bearer_token_sending_methods: Specifies the mechanism by which + access token is passed to the API. + :type bearer_token_sending_methods: list[str or + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] + :param client_secret: Client or app secret registered with this + authorization server. + :type client_secret: str + :param resource_owner_username: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner username. + :type resource_owner_username: str + :param resource_owner_password: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner password. + :type resource_owner_password: str + :param display_name: Required. User-friendly authorization server name. + :type display_name: str + :param client_registration_endpoint: Required. Optional reference to a + page where client or app registration for this authorization server is + performed. Contains absolute URL to entity being referenced. + :type client_registration_endpoint: str + :param authorization_endpoint: Required. OAuth authorization endpoint. See + http://tools.ietf.org/html/rfc6749#section-3.2. + :type authorization_endpoint: str + :param grant_types: Required. Form of an authorization grant, which the + client uses to request the access token. + :type grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] + :param client_id: Required. Client or app id registered with this + authorization server. + :type client_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True, 'max_length': 50, 'min_length': 1}, + 'client_registration_endpoint': {'required': True}, + 'authorization_endpoint': {'required': True}, + 'grant_types': {'required': True}, + 'client_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authorization_methods': {'key': 'properties.authorizationMethods', 'type': '[AuthorizationMethod]'}, + 'client_authentication_method': {'key': 'properties.clientAuthenticationMethod', 'type': '[str]'}, + 'token_body_parameters': {'key': 'properties.tokenBodyParameters', 'type': '[TokenBodyParameterContract]'}, + 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, + 'support_state': {'key': 'properties.supportState', 'type': 'bool'}, + 'default_scope': {'key': 'properties.defaultScope', 'type': 'str'}, + 'bearer_token_sending_methods': {'key': 'properties.bearerTokenSendingMethods', 'type': '[str]'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'resource_owner_username': {'key': 'properties.resourceOwnerUsername', 'type': 'str'}, + 'resource_owner_password': {'key': 'properties.resourceOwnerPassword', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'client_registration_endpoint': {'key': 'properties.clientRegistrationEndpoint', 'type': 'str'}, + 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, + 'grant_types': {'key': 'properties.grantTypes', 'type': '[str]'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AuthorizationServerContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.authorization_methods = kwargs.get('authorization_methods', None) + self.client_authentication_method = kwargs.get('client_authentication_method', None) + self.token_body_parameters = kwargs.get('token_body_parameters', None) + self.token_endpoint = kwargs.get('token_endpoint', None) + self.support_state = kwargs.get('support_state', None) + self.default_scope = kwargs.get('default_scope', None) + self.bearer_token_sending_methods = kwargs.get('bearer_token_sending_methods', None) + self.client_secret = kwargs.get('client_secret', None) + self.resource_owner_username = kwargs.get('resource_owner_username', None) + self.resource_owner_password = kwargs.get('resource_owner_password', None) + self.display_name = kwargs.get('display_name', None) + self.client_registration_endpoint = kwargs.get('client_registration_endpoint', None) + self.authorization_endpoint = kwargs.get('authorization_endpoint', None) + self.grant_types = kwargs.get('grant_types', None) + self.client_id = kwargs.get('client_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_base_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_base_properties.py new file mode 100644 index 000000000000..4b5b27bab20c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_base_properties.py @@ -0,0 +1,92 @@ +# 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 msrest.serialization import Model + + +class AuthorizationServerContractBaseProperties(Model): + """External OAuth authorization server Update settings contract. + + :param description: Description of the authorization server. Can contain + HTML formatting tags. + :type description: str + :param authorization_methods: HTTP verbs supported by the authorization + endpoint. GET must be always present. POST is optional. + :type authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] + :param client_authentication_method: Method of authentication supported by + the token endpoint of this authorization server. Possible values are Basic + and/or Body. When Body is specified, client credentials and other + parameters are passed within the request body in the + application/x-www-form-urlencoded format. + :type client_authentication_method: list[str or + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] + :param token_body_parameters: Additional parameters required by the token + endpoint of this authorization server represented as an array of JSON + objects with name and value string properties, i.e. {"name" : "name + value", "value": "a value"}. + :type token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] + :param token_endpoint: OAuth token endpoint. Contains absolute URI to + entity being referenced. + :type token_endpoint: str + :param support_state: If true, authorization server will include state + parameter from the authorization request to its response. Client may use + state parameter to raise protocol security. + :type support_state: bool + :param default_scope: Access token scope that is going to be requested by + default. Can be overridden at the API level. Should be provided in the + form of a string containing space-delimited values. + :type default_scope: str + :param bearer_token_sending_methods: Specifies the mechanism by which + access token is passed to the API. + :type bearer_token_sending_methods: list[str or + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] + :param client_secret: Client or app secret registered with this + authorization server. + :type client_secret: str + :param resource_owner_username: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner username. + :type resource_owner_username: str + :param resource_owner_password: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner password. + :type resource_owner_password: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authorization_methods': {'key': 'authorizationMethods', 'type': '[AuthorizationMethod]'}, + 'client_authentication_method': {'key': 'clientAuthenticationMethod', 'type': '[str]'}, + 'token_body_parameters': {'key': 'tokenBodyParameters', 'type': '[TokenBodyParameterContract]'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'support_state': {'key': 'supportState', 'type': 'bool'}, + 'default_scope': {'key': 'defaultScope', 'type': 'str'}, + 'bearer_token_sending_methods': {'key': 'bearerTokenSendingMethods', 'type': '[str]'}, + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + 'resource_owner_username': {'key': 'resourceOwnerUsername', 'type': 'str'}, + 'resource_owner_password': {'key': 'resourceOwnerPassword', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AuthorizationServerContractBaseProperties, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.authorization_methods = kwargs.get('authorization_methods', None) + self.client_authentication_method = kwargs.get('client_authentication_method', None) + self.token_body_parameters = kwargs.get('token_body_parameters', None) + self.token_endpoint = kwargs.get('token_endpoint', None) + self.support_state = kwargs.get('support_state', None) + self.default_scope = kwargs.get('default_scope', None) + self.bearer_token_sending_methods = kwargs.get('bearer_token_sending_methods', None) + self.client_secret = kwargs.get('client_secret', None) + self.resource_owner_username = kwargs.get('resource_owner_username', None) + self.resource_owner_password = kwargs.get('resource_owner_password', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_base_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_base_properties_py3.py new file mode 100644 index 000000000000..3d18e7cd3695 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_base_properties_py3.py @@ -0,0 +1,92 @@ +# 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 msrest.serialization import Model + + +class AuthorizationServerContractBaseProperties(Model): + """External OAuth authorization server Update settings contract. + + :param description: Description of the authorization server. Can contain + HTML formatting tags. + :type description: str + :param authorization_methods: HTTP verbs supported by the authorization + endpoint. GET must be always present. POST is optional. + :type authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] + :param client_authentication_method: Method of authentication supported by + the token endpoint of this authorization server. Possible values are Basic + and/or Body. When Body is specified, client credentials and other + parameters are passed within the request body in the + application/x-www-form-urlencoded format. + :type client_authentication_method: list[str or + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] + :param token_body_parameters: Additional parameters required by the token + endpoint of this authorization server represented as an array of JSON + objects with name and value string properties, i.e. {"name" : "name + value", "value": "a value"}. + :type token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] + :param token_endpoint: OAuth token endpoint. Contains absolute URI to + entity being referenced. + :type token_endpoint: str + :param support_state: If true, authorization server will include state + parameter from the authorization request to its response. Client may use + state parameter to raise protocol security. + :type support_state: bool + :param default_scope: Access token scope that is going to be requested by + default. Can be overridden at the API level. Should be provided in the + form of a string containing space-delimited values. + :type default_scope: str + :param bearer_token_sending_methods: Specifies the mechanism by which + access token is passed to the API. + :type bearer_token_sending_methods: list[str or + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] + :param client_secret: Client or app secret registered with this + authorization server. + :type client_secret: str + :param resource_owner_username: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner username. + :type resource_owner_username: str + :param resource_owner_password: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner password. + :type resource_owner_password: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authorization_methods': {'key': 'authorizationMethods', 'type': '[AuthorizationMethod]'}, + 'client_authentication_method': {'key': 'clientAuthenticationMethod', 'type': '[str]'}, + 'token_body_parameters': {'key': 'tokenBodyParameters', 'type': '[TokenBodyParameterContract]'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'support_state': {'key': 'supportState', 'type': 'bool'}, + 'default_scope': {'key': 'defaultScope', 'type': 'str'}, + 'bearer_token_sending_methods': {'key': 'bearerTokenSendingMethods', 'type': '[str]'}, + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + 'resource_owner_username': {'key': 'resourceOwnerUsername', 'type': 'str'}, + 'resource_owner_password': {'key': 'resourceOwnerPassword', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, authorization_methods=None, client_authentication_method=None, token_body_parameters=None, token_endpoint: str=None, support_state: bool=None, default_scope: str=None, bearer_token_sending_methods=None, client_secret: str=None, resource_owner_username: str=None, resource_owner_password: str=None, **kwargs) -> None: + super(AuthorizationServerContractBaseProperties, self).__init__(**kwargs) + self.description = description + self.authorization_methods = authorization_methods + self.client_authentication_method = client_authentication_method + self.token_body_parameters = token_body_parameters + self.token_endpoint = token_endpoint + self.support_state = support_state + self.default_scope = default_scope + self.bearer_token_sending_methods = bearer_token_sending_methods + self.client_secret = client_secret + self.resource_owner_username = resource_owner_username + self.resource_owner_password = resource_owner_password diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_paged.py new file mode 100644 index 000000000000..471b4f0192d5 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_paged.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 msrest.paging import Paged + + +class AuthorizationServerContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`AuthorizationServerContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AuthorizationServerContract]'} + } + + def __init__(self, *args, **kwargs): + + super(AuthorizationServerContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_py3.py new file mode 100644 index 000000000000..4a89ef4236b6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_contract_py3.py @@ -0,0 +1,142 @@ +# 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 .resource import Resource + + +class AuthorizationServerContract(Resource): + """External OAuth authorization server settings. + + Variables are only 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 for API Management resource. + :vartype type: str + :param description: Description of the authorization server. Can contain + HTML formatting tags. + :type description: str + :param authorization_methods: HTTP verbs supported by the authorization + endpoint. GET must be always present. POST is optional. + :type authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] + :param client_authentication_method: Method of authentication supported by + the token endpoint of this authorization server. Possible values are Basic + and/or Body. When Body is specified, client credentials and other + parameters are passed within the request body in the + application/x-www-form-urlencoded format. + :type client_authentication_method: list[str or + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] + :param token_body_parameters: Additional parameters required by the token + endpoint of this authorization server represented as an array of JSON + objects with name and value string properties, i.e. {"name" : "name + value", "value": "a value"}. + :type token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] + :param token_endpoint: OAuth token endpoint. Contains absolute URI to + entity being referenced. + :type token_endpoint: str + :param support_state: If true, authorization server will include state + parameter from the authorization request to its response. Client may use + state parameter to raise protocol security. + :type support_state: bool + :param default_scope: Access token scope that is going to be requested by + default. Can be overridden at the API level. Should be provided in the + form of a string containing space-delimited values. + :type default_scope: str + :param bearer_token_sending_methods: Specifies the mechanism by which + access token is passed to the API. + :type bearer_token_sending_methods: list[str or + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] + :param client_secret: Client or app secret registered with this + authorization server. + :type client_secret: str + :param resource_owner_username: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner username. + :type resource_owner_username: str + :param resource_owner_password: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner password. + :type resource_owner_password: str + :param display_name: Required. User-friendly authorization server name. + :type display_name: str + :param client_registration_endpoint: Required. Optional reference to a + page where client or app registration for this authorization server is + performed. Contains absolute URL to entity being referenced. + :type client_registration_endpoint: str + :param authorization_endpoint: Required. OAuth authorization endpoint. See + http://tools.ietf.org/html/rfc6749#section-3.2. + :type authorization_endpoint: str + :param grant_types: Required. Form of an authorization grant, which the + client uses to request the access token. + :type grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] + :param client_id: Required. Client or app id registered with this + authorization server. + :type client_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True, 'max_length': 50, 'min_length': 1}, + 'client_registration_endpoint': {'required': True}, + 'authorization_endpoint': {'required': True}, + 'grant_types': {'required': True}, + 'client_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authorization_methods': {'key': 'properties.authorizationMethods', 'type': '[AuthorizationMethod]'}, + 'client_authentication_method': {'key': 'properties.clientAuthenticationMethod', 'type': '[str]'}, + 'token_body_parameters': {'key': 'properties.tokenBodyParameters', 'type': '[TokenBodyParameterContract]'}, + 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, + 'support_state': {'key': 'properties.supportState', 'type': 'bool'}, + 'default_scope': {'key': 'properties.defaultScope', 'type': 'str'}, + 'bearer_token_sending_methods': {'key': 'properties.bearerTokenSendingMethods', 'type': '[str]'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'resource_owner_username': {'key': 'properties.resourceOwnerUsername', 'type': 'str'}, + 'resource_owner_password': {'key': 'properties.resourceOwnerPassword', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'client_registration_endpoint': {'key': 'properties.clientRegistrationEndpoint', 'type': 'str'}, + 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, + 'grant_types': {'key': 'properties.grantTypes', 'type': '[str]'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, client_registration_endpoint: str, authorization_endpoint: str, grant_types, client_id: str, description: str=None, authorization_methods=None, client_authentication_method=None, token_body_parameters=None, token_endpoint: str=None, support_state: bool=None, default_scope: str=None, bearer_token_sending_methods=None, client_secret: str=None, resource_owner_username: str=None, resource_owner_password: str=None, **kwargs) -> None: + super(AuthorizationServerContract, self).__init__(, **kwargs) + self.description = description + self.authorization_methods = authorization_methods + self.client_authentication_method = client_authentication_method + self.token_body_parameters = token_body_parameters + self.token_endpoint = token_endpoint + self.support_state = support_state + self.default_scope = default_scope + self.bearer_token_sending_methods = bearer_token_sending_methods + self.client_secret = client_secret + self.resource_owner_username = resource_owner_username + self.resource_owner_password = resource_owner_password + self.display_name = display_name + self.client_registration_endpoint = client_registration_endpoint + self.authorization_endpoint = authorization_endpoint + self.grant_types = grant_types + self.client_id = client_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_update_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_update_contract.py new file mode 100644 index 000000000000..0e7b3a542afe --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_update_contract.py @@ -0,0 +1,136 @@ +# 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 .resource import Resource + + +class AuthorizationServerUpdateContract(Resource): + """External OAuth authorization server 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 + :ivar type: Resource type for API Management resource. + :vartype type: str + :param description: Description of the authorization server. Can contain + HTML formatting tags. + :type description: str + :param authorization_methods: HTTP verbs supported by the authorization + endpoint. GET must be always present. POST is optional. + :type authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] + :param client_authentication_method: Method of authentication supported by + the token endpoint of this authorization server. Possible values are Basic + and/or Body. When Body is specified, client credentials and other + parameters are passed within the request body in the + application/x-www-form-urlencoded format. + :type client_authentication_method: list[str or + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] + :param token_body_parameters: Additional parameters required by the token + endpoint of this authorization server represented as an array of JSON + objects with name and value string properties, i.e. {"name" : "name + value", "value": "a value"}. + :type token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] + :param token_endpoint: OAuth token endpoint. Contains absolute URI to + entity being referenced. + :type token_endpoint: str + :param support_state: If true, authorization server will include state + parameter from the authorization request to its response. Client may use + state parameter to raise protocol security. + :type support_state: bool + :param default_scope: Access token scope that is going to be requested by + default. Can be overridden at the API level. Should be provided in the + form of a string containing space-delimited values. + :type default_scope: str + :param bearer_token_sending_methods: Specifies the mechanism by which + access token is passed to the API. + :type bearer_token_sending_methods: list[str or + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] + :param client_secret: Client or app secret registered with this + authorization server. + :type client_secret: str + :param resource_owner_username: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner username. + :type resource_owner_username: str + :param resource_owner_password: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner password. + :type resource_owner_password: str + :param display_name: User-friendly authorization server name. + :type display_name: str + :param client_registration_endpoint: Optional reference to a page where + client or app registration for this authorization server is performed. + Contains absolute URL to entity being referenced. + :type client_registration_endpoint: str + :param authorization_endpoint: OAuth authorization endpoint. See + http://tools.ietf.org/html/rfc6749#section-3.2. + :type authorization_endpoint: str + :param grant_types: Form of an authorization grant, which the client uses + to request the access token. + :type grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] + :param client_id: Client or app id registered with this authorization + server. + :type client_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'max_length': 50, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authorization_methods': {'key': 'properties.authorizationMethods', 'type': '[AuthorizationMethod]'}, + 'client_authentication_method': {'key': 'properties.clientAuthenticationMethod', 'type': '[str]'}, + 'token_body_parameters': {'key': 'properties.tokenBodyParameters', 'type': '[TokenBodyParameterContract]'}, + 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, + 'support_state': {'key': 'properties.supportState', 'type': 'bool'}, + 'default_scope': {'key': 'properties.defaultScope', 'type': 'str'}, + 'bearer_token_sending_methods': {'key': 'properties.bearerTokenSendingMethods', 'type': '[str]'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'resource_owner_username': {'key': 'properties.resourceOwnerUsername', 'type': 'str'}, + 'resource_owner_password': {'key': 'properties.resourceOwnerPassword', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'client_registration_endpoint': {'key': 'properties.clientRegistrationEndpoint', 'type': 'str'}, + 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, + 'grant_types': {'key': 'properties.grantTypes', 'type': '[str]'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AuthorizationServerUpdateContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.authorization_methods = kwargs.get('authorization_methods', None) + self.client_authentication_method = kwargs.get('client_authentication_method', None) + self.token_body_parameters = kwargs.get('token_body_parameters', None) + self.token_endpoint = kwargs.get('token_endpoint', None) + self.support_state = kwargs.get('support_state', None) + self.default_scope = kwargs.get('default_scope', None) + self.bearer_token_sending_methods = kwargs.get('bearer_token_sending_methods', None) + self.client_secret = kwargs.get('client_secret', None) + self.resource_owner_username = kwargs.get('resource_owner_username', None) + self.resource_owner_password = kwargs.get('resource_owner_password', None) + self.display_name = kwargs.get('display_name', None) + self.client_registration_endpoint = kwargs.get('client_registration_endpoint', None) + self.authorization_endpoint = kwargs.get('authorization_endpoint', None) + self.grant_types = kwargs.get('grant_types', None) + self.client_id = kwargs.get('client_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_update_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_update_contract_py3.py new file mode 100644 index 000000000000..87f6ed1e6e3f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/authorization_server_update_contract_py3.py @@ -0,0 +1,136 @@ +# 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 .resource import Resource + + +class AuthorizationServerUpdateContract(Resource): + """External OAuth authorization server 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 + :ivar type: Resource type for API Management resource. + :vartype type: str + :param description: Description of the authorization server. Can contain + HTML formatting tags. + :type description: str + :param authorization_methods: HTTP verbs supported by the authorization + endpoint. GET must be always present. POST is optional. + :type authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] + :param client_authentication_method: Method of authentication supported by + the token endpoint of this authorization server. Possible values are Basic + and/or Body. When Body is specified, client credentials and other + parameters are passed within the request body in the + application/x-www-form-urlencoded format. + :type client_authentication_method: list[str or + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] + :param token_body_parameters: Additional parameters required by the token + endpoint of this authorization server represented as an array of JSON + objects with name and value string properties, i.e. {"name" : "name + value", "value": "a value"}. + :type token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] + :param token_endpoint: OAuth token endpoint. Contains absolute URI to + entity being referenced. + :type token_endpoint: str + :param support_state: If true, authorization server will include state + parameter from the authorization request to its response. Client may use + state parameter to raise protocol security. + :type support_state: bool + :param default_scope: Access token scope that is going to be requested by + default. Can be overridden at the API level. Should be provided in the + form of a string containing space-delimited values. + :type default_scope: str + :param bearer_token_sending_methods: Specifies the mechanism by which + access token is passed to the API. + :type bearer_token_sending_methods: list[str or + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] + :param client_secret: Client or app secret registered with this + authorization server. + :type client_secret: str + :param resource_owner_username: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner username. + :type resource_owner_username: str + :param resource_owner_password: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner password. + :type resource_owner_password: str + :param display_name: User-friendly authorization server name. + :type display_name: str + :param client_registration_endpoint: Optional reference to a page where + client or app registration for this authorization server is performed. + Contains absolute URL to entity being referenced. + :type client_registration_endpoint: str + :param authorization_endpoint: OAuth authorization endpoint. See + http://tools.ietf.org/html/rfc6749#section-3.2. + :type authorization_endpoint: str + :param grant_types: Form of an authorization grant, which the client uses + to request the access token. + :type grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] + :param client_id: Client or app id registered with this authorization + server. + :type client_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'max_length': 50, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'authorization_methods': {'key': 'properties.authorizationMethods', 'type': '[AuthorizationMethod]'}, + 'client_authentication_method': {'key': 'properties.clientAuthenticationMethod', 'type': '[str]'}, + 'token_body_parameters': {'key': 'properties.tokenBodyParameters', 'type': '[TokenBodyParameterContract]'}, + 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, + 'support_state': {'key': 'properties.supportState', 'type': 'bool'}, + 'default_scope': {'key': 'properties.defaultScope', 'type': 'str'}, + 'bearer_token_sending_methods': {'key': 'properties.bearerTokenSendingMethods', 'type': '[str]'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'resource_owner_username': {'key': 'properties.resourceOwnerUsername', 'type': 'str'}, + 'resource_owner_password': {'key': 'properties.resourceOwnerPassword', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'client_registration_endpoint': {'key': 'properties.clientRegistrationEndpoint', 'type': 'str'}, + 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, + 'grant_types': {'key': 'properties.grantTypes', 'type': '[str]'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, authorization_methods=None, client_authentication_method=None, token_body_parameters=None, token_endpoint: str=None, support_state: bool=None, default_scope: str=None, bearer_token_sending_methods=None, client_secret: str=None, resource_owner_username: str=None, resource_owner_password: str=None, display_name: str=None, client_registration_endpoint: str=None, authorization_endpoint: str=None, grant_types=None, client_id: str=None, **kwargs) -> None: + super(AuthorizationServerUpdateContract, self).__init__(, **kwargs) + self.description = description + self.authorization_methods = authorization_methods + self.client_authentication_method = client_authentication_method + self.token_body_parameters = token_body_parameters + self.token_endpoint = token_endpoint + self.support_state = support_state + self.default_scope = default_scope + self.bearer_token_sending_methods = bearer_token_sending_methods + self.client_secret = client_secret + self.resource_owner_username = resource_owner_username + self.resource_owner_password = resource_owner_password + self.display_name = display_name + self.client_registration_endpoint = client_registration_endpoint + self.authorization_endpoint = authorization_endpoint + self.grant_types = grant_types + self.client_id = client_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_authorization_header_credentials.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_authorization_header_credentials.py new file mode 100644 index 000000000000..f579daecff01 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_authorization_header_credentials.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class BackendAuthorizationHeaderCredentials(Model): + """Authorization header information. + + All required parameters must be populated in order to send to Azure. + + :param scheme: Required. Authentication Scheme name. + :type scheme: str + :param parameter: Required. Authentication Parameter value. + :type parameter: str + """ + + _validation = { + 'scheme': {'required': True, 'max_length': 100, 'min_length': 1}, + 'parameter': {'required': True, 'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'scheme': {'key': 'scheme', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BackendAuthorizationHeaderCredentials, self).__init__(**kwargs) + self.scheme = kwargs.get('scheme', None) + self.parameter = kwargs.get('parameter', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_authorization_header_credentials_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_authorization_header_credentials_py3.py new file mode 100644 index 000000000000..9118b95378b7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_authorization_header_credentials_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class BackendAuthorizationHeaderCredentials(Model): + """Authorization header information. + + All required parameters must be populated in order to send to Azure. + + :param scheme: Required. Authentication Scheme name. + :type scheme: str + :param parameter: Required. Authentication Parameter value. + :type parameter: str + """ + + _validation = { + 'scheme': {'required': True, 'max_length': 100, 'min_length': 1}, + 'parameter': {'required': True, 'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'scheme': {'key': 'scheme', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + } + + def __init__(self, *, scheme: str, parameter: str, **kwargs) -> None: + super(BackendAuthorizationHeaderCredentials, self).__init__(**kwargs) + self.scheme = scheme + self.parameter = parameter diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_base_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_base_parameters.py new file mode 100644 index 000000000000..8a1440dc943b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_base_parameters.py @@ -0,0 +1,61 @@ +# 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 msrest.serialization import Model + + +class BackendBaseParameters(Model): + """Backend entity base Parameter set. + + :param title: Backend Title. + :type title: str + :param description: Backend Description. + :type description: str + :param resource_id: Management Uri of the Resource in External System. + This url can be the Arm Resource Id of Logic Apps, Function Apps or Api + Apps. + :type resource_id: str + :param properties: Backend Properties contract + :type properties: ~azure.mgmt.apimanagement.models.BackendProperties + :param credentials: Backend Credentials Contract Properties + :type credentials: + ~azure.mgmt.apimanagement.models.BackendCredentialsContract + :param proxy: Backend Proxy Contract Properties + :type proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract + :param tls: Backend TLS Properties + :type tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties + """ + + _validation = { + 'title': {'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 2000, 'min_length': 1}, + 'resource_id': {'max_length': 2000, 'min_length': 1}, + } + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackendProperties'}, + 'credentials': {'key': 'credentials', 'type': 'BackendCredentialsContract'}, + 'proxy': {'key': 'proxy', 'type': 'BackendProxyContract'}, + 'tls': {'key': 'tls', 'type': 'BackendTlsProperties'}, + } + + def __init__(self, **kwargs): + super(BackendBaseParameters, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.resource_id = kwargs.get('resource_id', None) + self.properties = kwargs.get('properties', None) + self.credentials = kwargs.get('credentials', None) + self.proxy = kwargs.get('proxy', None) + self.tls = kwargs.get('tls', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_base_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_base_parameters_py3.py new file mode 100644 index 000000000000..87c0a199bd72 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_base_parameters_py3.py @@ -0,0 +1,61 @@ +# 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 msrest.serialization import Model + + +class BackendBaseParameters(Model): + """Backend entity base Parameter set. + + :param title: Backend Title. + :type title: str + :param description: Backend Description. + :type description: str + :param resource_id: Management Uri of the Resource in External System. + This url can be the Arm Resource Id of Logic Apps, Function Apps or Api + Apps. + :type resource_id: str + :param properties: Backend Properties contract + :type properties: ~azure.mgmt.apimanagement.models.BackendProperties + :param credentials: Backend Credentials Contract Properties + :type credentials: + ~azure.mgmt.apimanagement.models.BackendCredentialsContract + :param proxy: Backend Proxy Contract Properties + :type proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract + :param tls: Backend TLS Properties + :type tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties + """ + + _validation = { + 'title': {'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 2000, 'min_length': 1}, + 'resource_id': {'max_length': 2000, 'min_length': 1}, + } + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackendProperties'}, + 'credentials': {'key': 'credentials', 'type': 'BackendCredentialsContract'}, + 'proxy': {'key': 'proxy', 'type': 'BackendProxyContract'}, + 'tls': {'key': 'tls', 'type': 'BackendTlsProperties'}, + } + + def __init__(self, *, title: str=None, description: str=None, resource_id: str=None, properties=None, credentials=None, proxy=None, tls=None, **kwargs) -> None: + super(BackendBaseParameters, self).__init__(**kwargs) + self.title = title + self.description = description + self.resource_id = resource_id + self.properties = properties + self.credentials = credentials + self.proxy = proxy + self.tls = tls diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_contract.py new file mode 100644 index 000000000000..568362361d49 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_contract.py @@ -0,0 +1,89 @@ +# 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 .resource import Resource + + +class BackendContract(Resource): + """Backend details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param title: Backend Title. + :type title: str + :param description: Backend Description. + :type description: str + :param resource_id: Management Uri of the Resource in External System. + This url can be the Arm Resource Id of Logic Apps, Function Apps or Api + Apps. + :type resource_id: str + :param properties: Backend Properties contract + :type properties: ~azure.mgmt.apimanagement.models.BackendProperties + :param credentials: Backend Credentials Contract Properties + :type credentials: + ~azure.mgmt.apimanagement.models.BackendCredentialsContract + :param proxy: Backend Proxy Contract Properties + :type proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract + :param tls: Backend TLS Properties + :type tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties + :param url: Required. Runtime Url of the Backend. + :type url: str + :param protocol: Required. Backend communication protocol. Possible values + include: 'http', 'soap' + :type protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'title': {'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 2000, 'min_length': 1}, + 'resource_id': {'max_length': 2000, 'min_length': 1}, + 'url': {'required': True, 'max_length': 2000, 'min_length': 1}, + 'protocol': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': 'BackendProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'BackendCredentialsContract'}, + 'proxy': {'key': 'properties.proxy', 'type': 'BackendProxyContract'}, + 'tls': {'key': 'properties.tls', 'type': 'BackendTlsProperties'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BackendContract, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.resource_id = kwargs.get('resource_id', None) + self.properties = kwargs.get('properties', None) + self.credentials = kwargs.get('credentials', None) + self.proxy = kwargs.get('proxy', None) + self.tls = kwargs.get('tls', None) + self.url = kwargs.get('url', None) + self.protocol = kwargs.get('protocol', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_contract_paged.py new file mode 100644 index 000000000000..d79a224281a2 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_contract_paged.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 msrest.paging import Paged + + +class BackendContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`BackendContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BackendContract]'} + } + + def __init__(self, *args, **kwargs): + + super(BackendContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_contract_py3.py new file mode 100644 index 000000000000..12871ee6f841 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_contract_py3.py @@ -0,0 +1,89 @@ +# 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 .resource import Resource + + +class BackendContract(Resource): + """Backend details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param title: Backend Title. + :type title: str + :param description: Backend Description. + :type description: str + :param resource_id: Management Uri of the Resource in External System. + This url can be the Arm Resource Id of Logic Apps, Function Apps or Api + Apps. + :type resource_id: str + :param properties: Backend Properties contract + :type properties: ~azure.mgmt.apimanagement.models.BackendProperties + :param credentials: Backend Credentials Contract Properties + :type credentials: + ~azure.mgmt.apimanagement.models.BackendCredentialsContract + :param proxy: Backend Proxy Contract Properties + :type proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract + :param tls: Backend TLS Properties + :type tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties + :param url: Required. Runtime Url of the Backend. + :type url: str + :param protocol: Required. Backend communication protocol. Possible values + include: 'http', 'soap' + :type protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'title': {'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 2000, 'min_length': 1}, + 'resource_id': {'max_length': 2000, 'min_length': 1}, + 'url': {'required': True, 'max_length': 2000, 'min_length': 1}, + 'protocol': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': 'BackendProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'BackendCredentialsContract'}, + 'proxy': {'key': 'properties.proxy', 'type': 'BackendProxyContract'}, + 'tls': {'key': 'properties.tls', 'type': 'BackendTlsProperties'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + } + + def __init__(self, *, url: str, protocol, title: str=None, description: str=None, resource_id: str=None, properties=None, credentials=None, proxy=None, tls=None, **kwargs) -> None: + super(BackendContract, self).__init__(, **kwargs) + self.title = title + self.description = description + self.resource_id = resource_id + self.properties = properties + self.credentials = credentials + self.proxy = proxy + self.tls = tls + self.url = url + self.protocol = protocol diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_credentials_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_credentials_contract.py new file mode 100644 index 000000000000..5a260a612603 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_credentials_contract.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class BackendCredentialsContract(Model): + """Details of the Credentials used to connect to Backend. + + :param certificate: List of Client Certificate Thumbprint. + :type certificate: list[str] + :param query: Query Parameter description. + :type query: dict[str, list[str]] + :param header: Header Parameter description. + :type header: dict[str, list[str]] + :param authorization: Authorization header authentication + :type authorization: + ~azure.mgmt.apimanagement.models.BackendAuthorizationHeaderCredentials + """ + + _validation = { + 'certificate': {'max_items': 32}, + } + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': '[str]'}, + 'query': {'key': 'query', 'type': '{[str]}'}, + 'header': {'key': 'header', 'type': '{[str]}'}, + 'authorization': {'key': 'authorization', 'type': 'BackendAuthorizationHeaderCredentials'}, + } + + def __init__(self, **kwargs): + super(BackendCredentialsContract, self).__init__(**kwargs) + self.certificate = kwargs.get('certificate', None) + self.query = kwargs.get('query', None) + self.header = kwargs.get('header', None) + self.authorization = kwargs.get('authorization', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_credentials_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_credentials_contract_py3.py new file mode 100644 index 000000000000..437317e64592 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_credentials_contract_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class BackendCredentialsContract(Model): + """Details of the Credentials used to connect to Backend. + + :param certificate: List of Client Certificate Thumbprint. + :type certificate: list[str] + :param query: Query Parameter description. + :type query: dict[str, list[str]] + :param header: Header Parameter description. + :type header: dict[str, list[str]] + :param authorization: Authorization header authentication + :type authorization: + ~azure.mgmt.apimanagement.models.BackendAuthorizationHeaderCredentials + """ + + _validation = { + 'certificate': {'max_items': 32}, + } + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': '[str]'}, + 'query': {'key': 'query', 'type': '{[str]}'}, + 'header': {'key': 'header', 'type': '{[str]}'}, + 'authorization': {'key': 'authorization', 'type': 'BackendAuthorizationHeaderCredentials'}, + } + + def __init__(self, *, certificate=None, query=None, header=None, authorization=None, **kwargs) -> None: + super(BackendCredentialsContract, self).__init__(**kwargs) + self.certificate = certificate + self.query = query + self.header = header + self.authorization = authorization diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_properties.py new file mode 100644 index 000000000000..6772b9235485 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_properties.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 msrest.serialization import Model + + +class BackendProperties(Model): + """Properties specific to the Backend Type. + + :param service_fabric_cluster: Backend Service Fabric Cluster Properties + :type service_fabric_cluster: + ~azure.mgmt.apimanagement.models.BackendServiceFabricClusterProperties + """ + + _attribute_map = { + 'service_fabric_cluster': {'key': 'serviceFabricCluster', 'type': 'BackendServiceFabricClusterProperties'}, + } + + def __init__(self, **kwargs): + super(BackendProperties, self).__init__(**kwargs) + self.service_fabric_cluster = kwargs.get('service_fabric_cluster', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_properties_py3.py new file mode 100644 index 000000000000..b84cc3f57d84 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_properties_py3.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 msrest.serialization import Model + + +class BackendProperties(Model): + """Properties specific to the Backend Type. + + :param service_fabric_cluster: Backend Service Fabric Cluster Properties + :type service_fabric_cluster: + ~azure.mgmt.apimanagement.models.BackendServiceFabricClusterProperties + """ + + _attribute_map = { + 'service_fabric_cluster': {'key': 'serviceFabricCluster', 'type': 'BackendServiceFabricClusterProperties'}, + } + + def __init__(self, *, service_fabric_cluster=None, **kwargs) -> None: + super(BackendProperties, self).__init__(**kwargs) + self.service_fabric_cluster = service_fabric_cluster diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_proxy_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_proxy_contract.py new file mode 100644 index 000000000000..d47cd57bbd1c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_proxy_contract.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class BackendProxyContract(Model): + """Details of the Backend WebProxy Server to use in the Request to Backend. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. WebProxy Server AbsoluteUri property which includes + the entire URI stored in the Uri instance, including all fragments and + query strings. + :type url: str + :param username: Username to connect to the WebProxy server + :type username: str + :param password: Password to connect to the WebProxy Server + :type password: str + """ + + _validation = { + 'url': {'required': True, 'max_length': 2000, 'min_length': 1}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BackendProxyContract, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_proxy_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_proxy_contract_py3.py new file mode 100644 index 000000000000..faee560245f7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_proxy_contract_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class BackendProxyContract(Model): + """Details of the Backend WebProxy Server to use in the Request to Backend. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. WebProxy Server AbsoluteUri property which includes + the entire URI stored in the Uri instance, including all fragments and + query strings. + :type url: str + :param username: Username to connect to the WebProxy server + :type username: str + :param password: Password to connect to the WebProxy Server + :type password: str + """ + + _validation = { + 'url': {'required': True, 'max_length': 2000, 'min_length': 1}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, url: str, username: str=None, password: str=None, **kwargs) -> None: + super(BackendProxyContract, self).__init__(**kwargs) + self.url = url + self.username = username + self.password = password diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_reconnect_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_reconnect_contract.py new file mode 100644 index 000000000000..f6dafe9415b3 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_reconnect_contract.py @@ -0,0 +1,47 @@ +# 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 .resource import Resource + + +class BackendReconnectContract(Resource): + """Reconnect request 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 + :ivar type: Resource type for API Management resource. + :vartype type: str + :param after: Duration in ISO8601 format after which reconnect will be + initiated. Minimum duration of the Reconect is PT2M. + :type after: timedelta + """ + + _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'}, + 'after': {'key': 'properties.after', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(BackendReconnectContract, self).__init__(**kwargs) + self.after = kwargs.get('after', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_reconnect_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_reconnect_contract_py3.py new file mode 100644 index 000000000000..0c8c8c8d6044 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_reconnect_contract_py3.py @@ -0,0 +1,47 @@ +# 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 .resource import Resource + + +class BackendReconnectContract(Resource): + """Reconnect request 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 + :ivar type: Resource type for API Management resource. + :vartype type: str + :param after: Duration in ISO8601 format after which reconnect will be + initiated. Minimum duration of the Reconect is PT2M. + :type after: timedelta + """ + + _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'}, + 'after': {'key': 'properties.after', 'type': 'duration'}, + } + + def __init__(self, *, after=None, **kwargs) -> None: + super(BackendReconnectContract, self).__init__(, **kwargs) + self.after = after diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_service_fabric_cluster_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_service_fabric_cluster_properties.py new file mode 100644 index 000000000000..9803fa262959 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_service_fabric_cluster_properties.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class BackendServiceFabricClusterProperties(Model): + """Properties of the Service Fabric Type Backend. + + All required parameters must be populated in order to send to Azure. + + :param client_certificatethumbprint: Required. The client certificate + thumbprint for the management endpoint. + :type client_certificatethumbprint: str + :param max_partition_resolution_retries: Maximum number of retries while + attempting resolve the parition. + :type max_partition_resolution_retries: int + :param management_endpoints: Required. The cluster management endpoint. + :type management_endpoints: list[str] + :param server_certificate_thumbprints: Thumbprints of certificates cluster + management service uses for tls communication + :type server_certificate_thumbprints: list[str] + :param server_x509_names: Server X509 Certificate Names Collection + :type server_x509_names: + list[~azure.mgmt.apimanagement.models.X509CertificateName] + """ + + _validation = { + 'client_certificatethumbprint': {'required': True}, + 'management_endpoints': {'required': True}, + } + + _attribute_map = { + 'client_certificatethumbprint': {'key': 'clientCertificatethumbprint', 'type': 'str'}, + 'max_partition_resolution_retries': {'key': 'maxPartitionResolutionRetries', 'type': 'int'}, + 'management_endpoints': {'key': 'managementEndpoints', 'type': '[str]'}, + 'server_certificate_thumbprints': {'key': 'serverCertificateThumbprints', 'type': '[str]'}, + 'server_x509_names': {'key': 'serverX509Names', 'type': '[X509CertificateName]'}, + } + + def __init__(self, **kwargs): + super(BackendServiceFabricClusterProperties, self).__init__(**kwargs) + self.client_certificatethumbprint = kwargs.get('client_certificatethumbprint', None) + self.max_partition_resolution_retries = kwargs.get('max_partition_resolution_retries', None) + self.management_endpoints = kwargs.get('management_endpoints', None) + self.server_certificate_thumbprints = kwargs.get('server_certificate_thumbprints', None) + self.server_x509_names = kwargs.get('server_x509_names', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_service_fabric_cluster_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_service_fabric_cluster_properties_py3.py new file mode 100644 index 000000000000..d5b0c905bd81 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_service_fabric_cluster_properties_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class BackendServiceFabricClusterProperties(Model): + """Properties of the Service Fabric Type Backend. + + All required parameters must be populated in order to send to Azure. + + :param client_certificatethumbprint: Required. The client certificate + thumbprint for the management endpoint. + :type client_certificatethumbprint: str + :param max_partition_resolution_retries: Maximum number of retries while + attempting resolve the parition. + :type max_partition_resolution_retries: int + :param management_endpoints: Required. The cluster management endpoint. + :type management_endpoints: list[str] + :param server_certificate_thumbprints: Thumbprints of certificates cluster + management service uses for tls communication + :type server_certificate_thumbprints: list[str] + :param server_x509_names: Server X509 Certificate Names Collection + :type server_x509_names: + list[~azure.mgmt.apimanagement.models.X509CertificateName] + """ + + _validation = { + 'client_certificatethumbprint': {'required': True}, + 'management_endpoints': {'required': True}, + } + + _attribute_map = { + 'client_certificatethumbprint': {'key': 'clientCertificatethumbprint', 'type': 'str'}, + 'max_partition_resolution_retries': {'key': 'maxPartitionResolutionRetries', 'type': 'int'}, + 'management_endpoints': {'key': 'managementEndpoints', 'type': '[str]'}, + 'server_certificate_thumbprints': {'key': 'serverCertificateThumbprints', 'type': '[str]'}, + 'server_x509_names': {'key': 'serverX509Names', 'type': '[X509CertificateName]'}, + } + + def __init__(self, *, client_certificatethumbprint: str, management_endpoints, max_partition_resolution_retries: int=None, server_certificate_thumbprints=None, server_x509_names=None, **kwargs) -> None: + super(BackendServiceFabricClusterProperties, self).__init__(**kwargs) + self.client_certificatethumbprint = client_certificatethumbprint + self.max_partition_resolution_retries = max_partition_resolution_retries + self.management_endpoints = management_endpoints + self.server_certificate_thumbprints = server_certificate_thumbprints + self.server_x509_names = server_x509_names diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_tls_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_tls_properties.py new file mode 100644 index 000000000000..8524bf76f66f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_tls_properties.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class BackendTlsProperties(Model): + """Properties controlling TLS Certificate Validation. + + :param validate_certificate_chain: Flag indicating whether SSL certificate + chain validation should be done when using self-signed certificates for + this backend host. Default value: True . + :type validate_certificate_chain: bool + :param validate_certificate_name: Flag indicating whether SSL certificate + name validation should be done when using self-signed certificates for + this backend host. Default value: True . + :type validate_certificate_name: bool + """ + + _attribute_map = { + 'validate_certificate_chain': {'key': 'validateCertificateChain', 'type': 'bool'}, + 'validate_certificate_name': {'key': 'validateCertificateName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BackendTlsProperties, self).__init__(**kwargs) + self.validate_certificate_chain = kwargs.get('validate_certificate_chain', True) + self.validate_certificate_name = kwargs.get('validate_certificate_name', True) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_tls_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_tls_properties_py3.py new file mode 100644 index 000000000000..a9596d94041e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_tls_properties_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class BackendTlsProperties(Model): + """Properties controlling TLS Certificate Validation. + + :param validate_certificate_chain: Flag indicating whether SSL certificate + chain validation should be done when using self-signed certificates for + this backend host. Default value: True . + :type validate_certificate_chain: bool + :param validate_certificate_name: Flag indicating whether SSL certificate + name validation should be done when using self-signed certificates for + this backend host. Default value: True . + :type validate_certificate_name: bool + """ + + _attribute_map = { + 'validate_certificate_chain': {'key': 'validateCertificateChain', 'type': 'bool'}, + 'validate_certificate_name': {'key': 'validateCertificateName', 'type': 'bool'}, + } + + def __init__(self, *, validate_certificate_chain: bool=True, validate_certificate_name: bool=True, **kwargs) -> None: + super(BackendTlsProperties, self).__init__(**kwargs) + self.validate_certificate_chain = validate_certificate_chain + self.validate_certificate_name = validate_certificate_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_update_parameters.py new file mode 100644 index 000000000000..a74bfecb8a4a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_update_parameters.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 msrest.serialization import Model + + +class BackendUpdateParameters(Model): + """Backend update parameters. + + :param title: Backend Title. + :type title: str + :param description: Backend Description. + :type description: str + :param resource_id: Management Uri of the Resource in External System. + This url can be the Arm Resource Id of Logic Apps, Function Apps or Api + Apps. + :type resource_id: str + :param properties: Backend Properties contract + :type properties: ~azure.mgmt.apimanagement.models.BackendProperties + :param credentials: Backend Credentials Contract Properties + :type credentials: + ~azure.mgmt.apimanagement.models.BackendCredentialsContract + :param proxy: Backend Proxy Contract Properties + :type proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract + :param tls: Backend TLS Properties + :type tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties + :param url: Runtime Url of the Backend. + :type url: str + :param protocol: Backend communication protocol. Possible values include: + 'http', 'soap' + :type protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol + """ + + _validation = { + 'title': {'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 2000, 'min_length': 1}, + 'resource_id': {'max_length': 2000, 'min_length': 1}, + 'url': {'max_length': 2000, 'min_length': 1}, + } + + _attribute_map = { + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': 'BackendProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'BackendCredentialsContract'}, + 'proxy': {'key': 'properties.proxy', 'type': 'BackendProxyContract'}, + 'tls': {'key': 'properties.tls', 'type': 'BackendTlsProperties'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BackendUpdateParameters, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.resource_id = kwargs.get('resource_id', None) + self.properties = kwargs.get('properties', None) + self.credentials = kwargs.get('credentials', None) + self.proxy = kwargs.get('proxy', None) + self.tls = kwargs.get('tls', None) + self.url = kwargs.get('url', None) + self.protocol = kwargs.get('protocol', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_update_parameters_py3.py new file mode 100644 index 000000000000..a83a9a55586c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/backend_update_parameters_py3.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 msrest.serialization import Model + + +class BackendUpdateParameters(Model): + """Backend update parameters. + + :param title: Backend Title. + :type title: str + :param description: Backend Description. + :type description: str + :param resource_id: Management Uri of the Resource in External System. + This url can be the Arm Resource Id of Logic Apps, Function Apps or Api + Apps. + :type resource_id: str + :param properties: Backend Properties contract + :type properties: ~azure.mgmt.apimanagement.models.BackendProperties + :param credentials: Backend Credentials Contract Properties + :type credentials: + ~azure.mgmt.apimanagement.models.BackendCredentialsContract + :param proxy: Backend Proxy Contract Properties + :type proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract + :param tls: Backend TLS Properties + :type tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties + :param url: Runtime Url of the Backend. + :type url: str + :param protocol: Backend communication protocol. Possible values include: + 'http', 'soap' + :type protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol + """ + + _validation = { + 'title': {'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 2000, 'min_length': 1}, + 'resource_id': {'max_length': 2000, 'min_length': 1}, + 'url': {'max_length': 2000, 'min_length': 1}, + } + + _attribute_map = { + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': 'BackendProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'BackendCredentialsContract'}, + 'proxy': {'key': 'properties.proxy', 'type': 'BackendProxyContract'}, + 'tls': {'key': 'properties.tls', 'type': 'BackendTlsProperties'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + } + + def __init__(self, *, title: str=None, description: str=None, resource_id: str=None, properties=None, credentials=None, proxy=None, tls=None, url: str=None, protocol=None, **kwargs) -> None: + super(BackendUpdateParameters, self).__init__(**kwargs) + self.title = title + self.description = description + self.resource_id = resource_id + self.properties = properties + self.credentials = credentials + self.proxy = proxy + self.tls = tls + self.url = url + self.protocol = protocol diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_configuration.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_configuration.py new file mode 100644 index 000000000000..0cd2bb9d7e6b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_configuration.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class CertificateConfiguration(Model): + """Certificate configuration which consist of non-trusted intermediates and + root 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 encoded_certificate: Base64 Encoded certificate. + :type encoded_certificate: str + :param certificate_password: Certificate Password. + :type certificate_password: str + :param store_name: Required. The + System.Security.Cryptography.x509certificates.Storename certificate store + location. Only Root and CertificateAuthority are valid locations. Possible + values include: 'CertificateAuthority', 'Root' + :type store_name: str or ~azure.mgmt.apimanagement.models.enum + :ivar certificate: Certificate information. + :vartype certificate: + ~azure.mgmt.apimanagement.models.CertificateInformation + """ + + _validation = { + 'store_name': {'required': True}, + 'certificate': {'readonly': True}, + } + + _attribute_map = { + 'encoded_certificate': {'key': 'encodedCertificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, + 'store_name': {'key': 'storeName', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'CertificateInformation'}, + } + + def __init__(self, **kwargs): + super(CertificateConfiguration, self).__init__(**kwargs) + self.encoded_certificate = kwargs.get('encoded_certificate', None) + self.certificate_password = kwargs.get('certificate_password', None) + self.store_name = kwargs.get('store_name', None) + self.certificate = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_configuration_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_configuration_py3.py new file mode 100644 index 000000000000..9aaee9bd75a5 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_configuration_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class CertificateConfiguration(Model): + """Certificate configuration which consist of non-trusted intermediates and + root 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 encoded_certificate: Base64 Encoded certificate. + :type encoded_certificate: str + :param certificate_password: Certificate Password. + :type certificate_password: str + :param store_name: Required. The + System.Security.Cryptography.x509certificates.Storename certificate store + location. Only Root and CertificateAuthority are valid locations. Possible + values include: 'CertificateAuthority', 'Root' + :type store_name: str or ~azure.mgmt.apimanagement.models.enum + :ivar certificate: Certificate information. + :vartype certificate: + ~azure.mgmt.apimanagement.models.CertificateInformation + """ + + _validation = { + 'store_name': {'required': True}, + 'certificate': {'readonly': True}, + } + + _attribute_map = { + 'encoded_certificate': {'key': 'encodedCertificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, + 'store_name': {'key': 'storeName', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'CertificateInformation'}, + } + + def __init__(self, *, store_name, encoded_certificate: str=None, certificate_password: str=None, **kwargs) -> None: + super(CertificateConfiguration, self).__init__(**kwargs) + self.encoded_certificate = encoded_certificate + self.certificate_password = certificate_password + self.store_name = store_name + self.certificate = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_contract.py new file mode 100644 index 000000000000..af06bb20cf95 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_contract.py @@ -0,0 +1,61 @@ +# 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 .resource import Resource + + +class CertificateContract(Resource): + """Certificate details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param subject: Required. Subject attribute of the certificate. + :type subject: str + :param thumbprint: Required. Thumbprint of the certificate. + :type thumbprint: str + :param expiration_date: Required. Expiration date of the certificate. The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :type expiration_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subject': {'required': True}, + 'thumbprint': {'required': True}, + 'expiration_date': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subject': {'key': 'properties.subject', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(CertificateContract, self).__init__(**kwargs) + self.subject = kwargs.get('subject', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.expiration_date = kwargs.get('expiration_date', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_contract_paged.py new file mode 100644 index 000000000000..e2d7255ecfa6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_contract_paged.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 msrest.paging import Paged + + +class CertificateContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`CertificateContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CertificateContract]'} + } + + def __init__(self, *args, **kwargs): + + super(CertificateContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_contract_py3.py new file mode 100644 index 000000000000..53aac0c14728 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_contract_py3.py @@ -0,0 +1,61 @@ +# 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 .resource import Resource + + +class CertificateContract(Resource): + """Certificate details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param subject: Required. Subject attribute of the certificate. + :type subject: str + :param thumbprint: Required. Thumbprint of the certificate. + :type thumbprint: str + :param expiration_date: Required. Expiration date of the certificate. The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :type expiration_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subject': {'required': True}, + 'thumbprint': {'required': True}, + 'expiration_date': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subject': {'key': 'properties.subject', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, subject: str, thumbprint: str, expiration_date, **kwargs) -> None: + super(CertificateContract, self).__init__(, **kwargs) + self.subject = subject + self.thumbprint = thumbprint + self.expiration_date = expiration_date diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_create_or_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_create_or_update_parameters.py new file mode 100644 index 000000000000..6b195ea702a7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_create_or_update_parameters.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class CertificateCreateOrUpdateParameters(Model): + """Certificate create or update details. + + All required parameters must be populated in order to send to Azure. + + :param data: Required. Base 64 encoded certificate using the + application/x-pkcs12 representation. + :type data: str + :param password: Required. Password for the Certificate + :type password: str + """ + + _validation = { + 'data': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_create_or_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..0a14fa8710ae --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_create_or_update_parameters_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class CertificateCreateOrUpdateParameters(Model): + """Certificate create or update details. + + All required parameters must be populated in order to send to Azure. + + :param data: Required. Base 64 encoded certificate using the + application/x-pkcs12 representation. + :type data: str + :param password: Required. Password for the Certificate + :type password: str + """ + + _validation = { + 'data': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + } + + def __init__(self, *, data: str, password: str, **kwargs) -> None: + super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) + self.data = data + self.password = password diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_information.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_information.py new file mode 100644 index 000000000000..d66883195efe --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_information.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class CertificateInformation(Model): + """SSL certificate information. + + All required parameters must be populated in order to send to Azure. + + :param expiry: Required. Expiration date of the certificate. The date + conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + the ISO 8601 standard. + :type expiry: datetime + :param thumbprint: Required. Thumbprint of the certificate. + :type thumbprint: str + :param subject: Required. Subject of the certificate. + :type subject: str + """ + + _validation = { + 'expiry': {'required': True}, + 'thumbprint': {'required': True}, + 'subject': {'required': True}, + } + + _attribute_map = { + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateInformation, self).__init__(**kwargs) + self.expiry = kwargs.get('expiry', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.subject = kwargs.get('subject', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_information_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_information_py3.py new file mode 100644 index 000000000000..a14d9b1d7756 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/certificate_information_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class CertificateInformation(Model): + """SSL certificate information. + + All required parameters must be populated in order to send to Azure. + + :param expiry: Required. Expiration date of the certificate. The date + conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + the ISO 8601 standard. + :type expiry: datetime + :param thumbprint: Required. Thumbprint of the certificate. + :type thumbprint: str + :param subject: Required. Subject of the certificate. + :type subject: str + """ + + _validation = { + 'expiry': {'required': True}, + 'thumbprint': {'required': True}, + 'subject': {'required': True}, + } + + _attribute_map = { + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + } + + def __init__(self, *, expiry, thumbprint: str, subject: str, **kwargs) -> None: + super(CertificateInformation, self).__init__(**kwargs) + self.expiry = expiry + self.thumbprint = thumbprint + self.subject = subject diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/connectivity_status_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/connectivity_status_contract.py new file mode 100644 index 000000000000..58737990e11f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/connectivity_status_contract.py @@ -0,0 +1,65 @@ +# 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 msrest.serialization import Model + + +class ConnectivityStatusContract(Model): + """Details about connectivity to a resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The hostname of the resource which the service + depends on. This can be the database, storage or any other azure resource + on which the service depends upon. + :type name: str + :param status: Required. Resource Connectivity Status Type identifier. + Possible values include: 'initializing', 'success', 'failure' + :type status: str or + ~azure.mgmt.apimanagement.models.ConnectivityStatusType + :param error: Error details of the connectivity to the resource. + :type error: str + :param last_updated: Required. The date when the resource connectivity + status was last updated. This status should be updated every 15 minutes. + If this status has not been updated, then it means that the service has + lost network connectivity to the resource, from inside the Virtual + Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + as specified by the ISO 8601 standard. + :type last_updated: datetime + :param last_status_change: Required. The date when the resource + connectivity status last Changed from success to failure or vice-versa. + The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + specified by the ISO 8601 standard. + :type last_status_change: datetime + """ + + _validation = { + 'name': {'required': True, 'min_length': 1}, + 'status': {'required': True}, + 'last_updated': {'required': True}, + 'last_status_change': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ConnectivityStatusContract, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + self.last_updated = kwargs.get('last_updated', None) + self.last_status_change = kwargs.get('last_status_change', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/connectivity_status_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/connectivity_status_contract_py3.py new file mode 100644 index 000000000000..4ff86d73dda1 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/connectivity_status_contract_py3.py @@ -0,0 +1,65 @@ +# 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 msrest.serialization import Model + + +class ConnectivityStatusContract(Model): + """Details about connectivity to a resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The hostname of the resource which the service + depends on. This can be the database, storage or any other azure resource + on which the service depends upon. + :type name: str + :param status: Required. Resource Connectivity Status Type identifier. + Possible values include: 'initializing', 'success', 'failure' + :type status: str or + ~azure.mgmt.apimanagement.models.ConnectivityStatusType + :param error: Error details of the connectivity to the resource. + :type error: str + :param last_updated: Required. The date when the resource connectivity + status was last updated. This status should be updated every 15 minutes. + If this status has not been updated, then it means that the service has + lost network connectivity to the resource, from inside the Virtual + Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + as specified by the ISO 8601 standard. + :type last_updated: datetime + :param last_status_change: Required. The date when the resource + connectivity status last Changed from success to failure or vice-versa. + The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + specified by the ISO 8601 standard. + :type last_status_change: datetime + """ + + _validation = { + 'name': {'required': True, 'min_length': 1}, + 'status': {'required': True}, + 'last_updated': {'required': True}, + 'last_status_change': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + } + + def __init__(self, *, name: str, status, last_updated, last_status_change, error: str=None, **kwargs) -> None: + super(ConnectivityStatusContract, self).__init__(**kwargs) + self.name = name + self.status = status + self.error = error + self.last_updated = last_updated + self.last_status_change = last_status_change diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/deploy_configuration_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/deploy_configuration_parameters.py new file mode 100644 index 000000000000..bc5fcb5f2210 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/deploy_configuration_parameters.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class DeployConfigurationParameters(Model): + """Parameters supplied to the Deploy Configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param branch: Required. The name of the Git branch from which the + configuration is to be deployed to the configuration database. + :type branch: str + :param force: The value enforcing deleting subscriptions to products that + are deleted in this update. + :type force: bool + """ + + _validation = { + 'branch': {'required': True}, + } + + _attribute_map = { + 'branch': {'key': 'branch', 'type': 'str'}, + 'force': {'key': 'force', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DeployConfigurationParameters, self).__init__(**kwargs) + self.branch = kwargs.get('branch', None) + self.force = kwargs.get('force', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/deploy_configuration_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/deploy_configuration_parameters_py3.py new file mode 100644 index 000000000000..83ee4ed79834 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/deploy_configuration_parameters_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class DeployConfigurationParameters(Model): + """Parameters supplied to the Deploy Configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param branch: Required. The name of the Git branch from which the + configuration is to be deployed to the configuration database. + :type branch: str + :param force: The value enforcing deleting subscriptions to products that + are deleted in this update. + :type force: bool + """ + + _validation = { + 'branch': {'required': True}, + } + + _attribute_map = { + 'branch': {'key': 'branch', 'type': 'str'}, + 'force': {'key': 'force', 'type': 'bool'}, + } + + def __init__(self, *, branch: str, force: bool=None, **kwargs) -> None: + super(DeployConfigurationParameters, self).__init__(**kwargs) + self.branch = branch + self.force = force diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/diagnostic_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/diagnostic_contract.py new file mode 100644 index 000000000000..323523836bbc --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/diagnostic_contract.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +class DiagnosticContract(Resource): + """Diagnostic details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param enabled: Required. Indicates whether a diagnostic should receive + data or not. + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DiagnosticContract, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/diagnostic_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/diagnostic_contract_paged.py new file mode 100644 index 000000000000..ea142d87269f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/diagnostic_contract_paged.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 msrest.paging import Paged + + +class DiagnosticContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`DiagnosticContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DiagnosticContract]'} + } + + def __init__(self, *args, **kwargs): + + super(DiagnosticContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/diagnostic_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/diagnostic_contract_py3.py new file mode 100644 index 000000000000..d7ce1549a53a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/diagnostic_contract_py3.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +class DiagnosticContract(Resource): + """Diagnostic details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param enabled: Required. Indicates whether a diagnostic should receive + data or not. + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool, **kwargs) -> None: + super(DiagnosticContract, self).__init__(, **kwargs) + self.enabled = enabled diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_contract.py new file mode 100644 index 000000000000..c23ba2c72909 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_contract.py @@ -0,0 +1,74 @@ +# 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 .resource import Resource + + +class EmailTemplateContract(Resource): + """Email Template details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param subject: Required. Subject of the Template. + :type subject: str + :param body: Required. Email Template Body. This should be a valid + XDocument + :type body: str + :param title: Title of the Template. + :type title: str + :param description: Description of the Email Template. + :type description: str + :ivar is_default: Whether the template is the default template provided by + Api Management or has been edited. + :vartype is_default: bool + :param parameters: Email Template Parameter values. + :type parameters: + list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subject': {'required': True, 'max_length': 1000, 'min_length': 1}, + 'body': {'required': True, 'min_length': 1}, + 'is_default': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subject': {'key': 'properties.subject', 'type': 'str'}, + 'body': {'key': 'properties.body', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_default': {'key': 'properties.isDefault', 'type': 'bool'}, + 'parameters': {'key': 'properties.parameters', 'type': '[EmailTemplateParametersContractProperties]'}, + } + + def __init__(self, **kwargs): + super(EmailTemplateContract, self).__init__(**kwargs) + self.subject = kwargs.get('subject', None) + self.body = kwargs.get('body', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.is_default = None + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_contract_paged.py new file mode 100644 index 000000000000..9f137e41d6a8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_contract_paged.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 msrest.paging import Paged + + +class EmailTemplateContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`EmailTemplateContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EmailTemplateContract]'} + } + + def __init__(self, *args, **kwargs): + + super(EmailTemplateContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_contract_py3.py new file mode 100644 index 000000000000..abfc23d34841 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_contract_py3.py @@ -0,0 +1,74 @@ +# 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 .resource import Resource + + +class EmailTemplateContract(Resource): + """Email Template details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param subject: Required. Subject of the Template. + :type subject: str + :param body: Required. Email Template Body. This should be a valid + XDocument + :type body: str + :param title: Title of the Template. + :type title: str + :param description: Description of the Email Template. + :type description: str + :ivar is_default: Whether the template is the default template provided by + Api Management or has been edited. + :vartype is_default: bool + :param parameters: Email Template Parameter values. + :type parameters: + list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subject': {'required': True, 'max_length': 1000, 'min_length': 1}, + 'body': {'required': True, 'min_length': 1}, + 'is_default': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subject': {'key': 'properties.subject', 'type': 'str'}, + 'body': {'key': 'properties.body', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_default': {'key': 'properties.isDefault', 'type': 'bool'}, + 'parameters': {'key': 'properties.parameters', 'type': '[EmailTemplateParametersContractProperties]'}, + } + + def __init__(self, *, subject: str, body: str, title: str=None, description: str=None, parameters=None, **kwargs) -> None: + super(EmailTemplateContract, self).__init__(, **kwargs) + self.subject = subject + self.body = body + self.title = title + self.description = description + self.is_default = None + self.parameters = parameters diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_parameters_contract_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_parameters_contract_properties.py new file mode 100644 index 000000000000..060b64257a7a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_parameters_contract_properties.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class EmailTemplateParametersContractProperties(Model): + """Email Template Parameter contract. + + :param name: Template parameter name. + :type name: str + :param title: Template parameter title. + :type title: str + :param description: Template parameter description. + :type description: str + """ + + _validation = { + 'name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'title': {'max_length': 4096, 'min_length': 1}, + 'description': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EmailTemplateParametersContractProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_parameters_contract_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_parameters_contract_properties_py3.py new file mode 100644 index 000000000000..58cce1c0df98 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_parameters_contract_properties_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class EmailTemplateParametersContractProperties(Model): + """Email Template Parameter contract. + + :param name: Template parameter name. + :type name: str + :param title: Template parameter title. + :type title: str + :param description: Template parameter description. + :type description: str + """ + + _validation = { + 'name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'title': {'max_length': 4096, 'min_length': 1}, + 'description': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, title: str=None, description: str=None, **kwargs) -> None: + super(EmailTemplateParametersContractProperties, self).__init__(**kwargs) + self.name = name + self.title = title + self.description = description diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_update_parameters.py new file mode 100644 index 000000000000..f7a7e5c3b452 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_update_parameters.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class EmailTemplateUpdateParameters(Model): + """Email Template update Parameters. + + :param subject: Subject of the Template. + :type subject: str + :param title: Title of the Template. + :type title: str + :param description: Description of the Email Template. + :type description: str + :param body: Email Template Body. This should be a valid XDocument + :type body: str + :param parameters: Email Template Parameter values. + :type parameters: + list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties] + """ + + _validation = { + 'subject': {'max_length': 1000, 'min_length': 1}, + 'body': {'min_length': 1}, + } + + _attribute_map = { + 'subject': {'key': 'properties.subject', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'body': {'key': 'properties.body', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[EmailTemplateParametersContractProperties]'}, + } + + def __init__(self, **kwargs): + super(EmailTemplateUpdateParameters, self).__init__(**kwargs) + self.subject = kwargs.get('subject', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.body = kwargs.get('body', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_update_parameters_py3.py new file mode 100644 index 000000000000..1907e0c59b21 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/email_template_update_parameters_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class EmailTemplateUpdateParameters(Model): + """Email Template update Parameters. + + :param subject: Subject of the Template. + :type subject: str + :param title: Title of the Template. + :type title: str + :param description: Description of the Email Template. + :type description: str + :param body: Email Template Body. This should be a valid XDocument + :type body: str + :param parameters: Email Template Parameter values. + :type parameters: + list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties] + """ + + _validation = { + 'subject': {'max_length': 1000, 'min_length': 1}, + 'body': {'min_length': 1}, + } + + _attribute_map = { + 'subject': {'key': 'properties.subject', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'body': {'key': 'properties.body', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[EmailTemplateParametersContractProperties]'}, + } + + def __init__(self, *, subject: str=None, title: str=None, description: str=None, body: str=None, parameters=None, **kwargs) -> None: + super(EmailTemplateUpdateParameters, self).__init__(**kwargs) + self.subject = subject + self.title = title + self.description = description + self.body = body + self.parameters = parameters diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_field_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_field_contract.py new file mode 100644 index 000000000000..f376b6292b73 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_field_contract.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ErrorFieldContract(Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_field_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_field_contract_py3.py new file mode 100644 index 000000000000..f5c5e28d94d8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_field_contract_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ErrorFieldContract(Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, **kwargs) -> None: + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_response.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_response.py new file mode 100644 index 000000000000..039c9aa4cb28 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_response.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error Body contract. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_response_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_response_py3.py new file mode 100644 index 000000000000..1fa961c53dcf --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/error_response_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error Body contract. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/generate_sso_url_result.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/generate_sso_url_result.py new file mode 100644 index 000000000000..39df1288be36 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/generate_sso_url_result.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class GenerateSsoUrlResult(Model): + """Generate SSO Url operations response details. + + :param value: Redirect Url containing the SSO URL value. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenerateSsoUrlResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/generate_sso_url_result_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/generate_sso_url_result_py3.py new file mode 100644 index 000000000000..bc5404c9c47f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/generate_sso_url_result_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class GenerateSsoUrlResult(Model): + """Generate SSO Url operations response details. + + :param value: Redirect Url containing the SSO URL value. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, **kwargs) -> None: + super(GenerateSsoUrlResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract.py new file mode 100644 index 000000000000..402856cb4021 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract.py @@ -0,0 +1,73 @@ +# 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 .resource import Resource + + +class GroupContract(Resource): + """Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param display_name: Required. Group name. + :type display_name: str + :param description: Group description. Can contain HTML formatting tags. + :type description: str + :ivar built_in: true if the group is one of the three system groups + (Administrators, Developers, or Guests); otherwise false. + :vartype built_in: bool + :param group_contract_type: Group type. Possible values include: 'custom', + 'system', 'external' + :type group_contract_type: str or + ~azure.mgmt.apimanagement.models.GroupType + :param external_id: For external groups, this property contains the id of + the group from the external identity provider, e.g. for Azure Active + Directory aad://.onmicrosoft.com/groups/; + otherwise the value is null. + :type external_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 1000}, + 'built_in': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'built_in': {'key': 'properties.builtIn', 'type': 'bool'}, + 'group_contract_type': {'key': 'properties.type', 'type': 'GroupType'}, + 'external_id': {'key': 'properties.externalId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GroupContract, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.built_in = None + self.group_contract_type = kwargs.get('group_contract_type', None) + self.external_id = kwargs.get('external_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_paged.py new file mode 100644 index 000000000000..04133d76cef6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_paged.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 msrest.paging import Paged + + +class GroupContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`GroupContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GroupContract]'} + } + + def __init__(self, *args, **kwargs): + + super(GroupContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_properties.py new file mode 100644 index 000000000000..afc509e6305d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_properties.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class GroupContractProperties(Model): + """Group contract 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 display_name: Required. Group name. + :type display_name: str + :param description: Group description. Can contain HTML formatting tags. + :type description: str + :ivar built_in: true if the group is one of the three system groups + (Administrators, Developers, or Guests); otherwise false. + :vartype built_in: bool + :param type: Group type. Possible values include: 'custom', 'system', + 'external' + :type type: str or ~azure.mgmt.apimanagement.models.GroupType + :param external_id: For external groups, this property contains the id of + the group from the external identity provider, e.g. for Azure Active + Directory aad://.onmicrosoft.com/groups/; + otherwise the value is null. + :type external_id: str + """ + + _validation = { + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 1000}, + 'built_in': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'built_in': {'key': 'builtIn', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'GroupType'}, + 'external_id': {'key': 'externalId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GroupContractProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.built_in = None + self.type = kwargs.get('type', None) + self.external_id = kwargs.get('external_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_properties_py3.py new file mode 100644 index 000000000000..ea1ff22a7932 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_properties_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class GroupContractProperties(Model): + """Group contract 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 display_name: Required. Group name. + :type display_name: str + :param description: Group description. Can contain HTML formatting tags. + :type description: str + :ivar built_in: true if the group is one of the three system groups + (Administrators, Developers, or Guests); otherwise false. + :vartype built_in: bool + :param type: Group type. Possible values include: 'custom', 'system', + 'external' + :type type: str or ~azure.mgmt.apimanagement.models.GroupType + :param external_id: For external groups, this property contains the id of + the group from the external identity provider, e.g. for Azure Active + Directory aad://.onmicrosoft.com/groups/; + otherwise the value is null. + :type external_id: str + """ + + _validation = { + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 1000}, + 'built_in': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'built_in': {'key': 'builtIn', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'GroupType'}, + 'external_id': {'key': 'externalId', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, description: str=None, type=None, external_id: str=None, **kwargs) -> None: + super(GroupContractProperties, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.built_in = None + self.type = type + self.external_id = external_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_py3.py new file mode 100644 index 000000000000..ca4dd4c57b4e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_contract_py3.py @@ -0,0 +1,73 @@ +# 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 .resource import Resource + + +class GroupContract(Resource): + """Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param display_name: Required. Group name. + :type display_name: str + :param description: Group description. Can contain HTML formatting tags. + :type description: str + :ivar built_in: true if the group is one of the three system groups + (Administrators, Developers, or Guests); otherwise false. + :vartype built_in: bool + :param group_contract_type: Group type. Possible values include: 'custom', + 'system', 'external' + :type group_contract_type: str or + ~azure.mgmt.apimanagement.models.GroupType + :param external_id: For external groups, this property contains the id of + the group from the external identity provider, e.g. for Azure Active + Directory aad://.onmicrosoft.com/groups/; + otherwise the value is null. + :type external_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + 'description': {'max_length': 1000}, + 'built_in': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'built_in': {'key': 'properties.builtIn', 'type': 'bool'}, + 'group_contract_type': {'key': 'properties.type', 'type': 'GroupType'}, + 'external_id': {'key': 'properties.externalId', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, description: str=None, group_contract_type=None, external_id: str=None, **kwargs) -> None: + super(GroupContract, self).__init__(, **kwargs) + self.display_name = display_name + self.description = description + self.built_in = None + self.group_contract_type = group_contract_type + self.external_id = external_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_create_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_create_parameters.py new file mode 100644 index 000000000000..81c6d9664912 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_create_parameters.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class GroupCreateParameters(Model): + """Parameters supplied to the Create Group operation. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Required. Group name. + :type display_name: str + :param description: Group description. + :type description: str + :param type: Group type. Possible values include: 'custom', 'system', + 'external' + :type type: str or ~azure.mgmt.apimanagement.models.GroupType + :param external_id: Identifier of the external groups, this property + contains the id of the group from the external identity provider, e.g. for + Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. + :type external_id: str + """ + + _validation = { + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'GroupType'}, + 'external_id': {'key': 'properties.externalId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GroupCreateParameters, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.type = kwargs.get('type', None) + self.external_id = kwargs.get('external_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_create_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_create_parameters_py3.py new file mode 100644 index 000000000000..b02e7b7137aa --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_create_parameters_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class GroupCreateParameters(Model): + """Parameters supplied to the Create Group operation. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Required. Group name. + :type display_name: str + :param description: Group description. + :type description: str + :param type: Group type. Possible values include: 'custom', 'system', + 'external' + :type type: str or ~azure.mgmt.apimanagement.models.GroupType + :param external_id: Identifier of the external groups, this property + contains the id of the group from the external identity provider, e.g. for + Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. + :type external_id: str + """ + + _validation = { + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'GroupType'}, + 'external_id': {'key': 'properties.externalId', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, description: str=None, type=None, external_id: str=None, **kwargs) -> None: + super(GroupCreateParameters, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.type = type + self.external_id = external_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_update_parameters.py new file mode 100644 index 000000000000..0eec52761c7c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_update_parameters.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class GroupUpdateParameters(Model): + """Parameters supplied to the Update Group operation. + + :param display_name: Group name. + :type display_name: str + :param description: Group description. + :type description: str + :param type: Group type. Possible values include: 'custom', 'system', + 'external' + :type type: str or ~azure.mgmt.apimanagement.models.GroupType + :param external_id: Identifier of the external groups, this property + contains the id of the group from the external identity provider, e.g. for + Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. + :type external_id: str + """ + + _validation = { + 'display_name': {'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'GroupType'}, + 'external_id': {'key': 'properties.externalId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GroupUpdateParameters, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.type = kwargs.get('type', None) + self.external_id = kwargs.get('external_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_update_parameters_py3.py new file mode 100644 index 000000000000..697f14db0b9d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/group_update_parameters_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class GroupUpdateParameters(Model): + """Parameters supplied to the Update Group operation. + + :param display_name: Group name. + :type display_name: str + :param description: Group description. + :type description: str + :param type: Group type. Possible values include: 'custom', 'system', + 'external' + :type type: str or ~azure.mgmt.apimanagement.models.GroupType + :param external_id: Identifier of the external groups, this property + contains the id of the group from the external identity provider, e.g. for + Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. + :type external_id: str + """ + + _validation = { + 'display_name': {'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'GroupType'}, + 'external_id': {'key': 'properties.externalId', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, description: str=None, type=None, external_id: str=None, **kwargs) -> None: + super(GroupUpdateParameters, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.type = type + self.external_id = external_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration.py new file mode 100644 index 000000000000..8b4c64b522cb --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration.py @@ -0,0 +1,81 @@ +# 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 msrest.serialization import Model + + +class HostnameConfiguration(Model): + """Custom hostname configuration. + + Variables are only 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 type: Required. Hostname type. Possible values include: 'Proxy', + 'Portal', 'Management', 'Scm' + :type type: str or ~azure.mgmt.apimanagement.models.HostnameType + :param host_name: Required. Hostname to configure on the Api Management + service. + :type host_name: str + :param key_vault_id: Url to the KeyVault Secret containing the Ssl + Certificate. If absolute Url containing version is provided, auto-update + of ssl certificate will not work. This requires Api Management service to + be configured with MSI. The secret should be of type + *application/x-pkcs12* + :type key_vault_id: str + :param encoded_certificate: Base64 Encoded certificate. + :type encoded_certificate: str + :param certificate_password: Certificate Password. + :type certificate_password: str + :param default_ssl_binding: Specify true to setup the certificate + associated with this Hostname as the Default SSL Certificate. If a client + does not send the SNI header, then this will be the certificate that will + be challenged. The property is useful if a service has multiple custom + hostname enabled and it needs to decide on the default ssl certificate. + The setting only applied to Proxy Hostname Type. Default value: False . + :type default_ssl_binding: bool + :param negotiate_client_certificate: Specify true to always negotiate + client certificate on the hostname. Default Value is false. Default value: + False . + :type negotiate_client_certificate: bool + :ivar certificate: Certificate information. + :vartype certificate: + ~azure.mgmt.apimanagement.models.CertificateInformation + """ + + _validation = { + 'type': {'required': True}, + 'host_name': {'required': True}, + 'certificate': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'HostnameType'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'encoded_certificate': {'key': 'encodedCertificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, + 'default_ssl_binding': {'key': 'defaultSslBinding', 'type': 'bool'}, + 'negotiate_client_certificate': {'key': 'negotiateClientCertificate', 'type': 'bool'}, + 'certificate': {'key': 'certificate', 'type': 'CertificateInformation'}, + } + + def __init__(self, **kwargs): + super(HostnameConfiguration, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.host_name = kwargs.get('host_name', None) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.encoded_certificate = kwargs.get('encoded_certificate', None) + self.certificate_password = kwargs.get('certificate_password', None) + self.default_ssl_binding = kwargs.get('default_ssl_binding', False) + self.negotiate_client_certificate = kwargs.get('negotiate_client_certificate', False) + self.certificate = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration_old.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration_old.py new file mode 100644 index 000000000000..0dc3ab2d270a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration_old.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class HostnameConfigurationOld(Model): + """Custom hostname configuration. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Hostname type. Possible values include: 'Proxy', + 'Portal', 'Management', 'Scm' + :type type: str or ~azure.mgmt.apimanagement.models.HostnameType + :param hostname: Required. Hostname to configure. + :type hostname: str + :param certificate: Required. Certificate information. + :type certificate: ~azure.mgmt.apimanagement.models.CertificateInformation + """ + + _validation = { + 'type': {'required': True}, + 'hostname': {'required': True}, + 'certificate': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'HostnameType'}, + 'hostname': {'key': 'hostname', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'CertificateInformation'}, + } + + def __init__(self, **kwargs): + super(HostnameConfigurationOld, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.hostname = kwargs.get('hostname', None) + self.certificate = kwargs.get('certificate', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration_old_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration_old_py3.py new file mode 100644 index 000000000000..121e9708258f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration_old_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class HostnameConfigurationOld(Model): + """Custom hostname configuration. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Hostname type. Possible values include: 'Proxy', + 'Portal', 'Management', 'Scm' + :type type: str or ~azure.mgmt.apimanagement.models.HostnameType + :param hostname: Required. Hostname to configure. + :type hostname: str + :param certificate: Required. Certificate information. + :type certificate: ~azure.mgmt.apimanagement.models.CertificateInformation + """ + + _validation = { + 'type': {'required': True}, + 'hostname': {'required': True}, + 'certificate': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'HostnameType'}, + 'hostname': {'key': 'hostname', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'CertificateInformation'}, + } + + def __init__(self, *, type, hostname: str, certificate, **kwargs) -> None: + super(HostnameConfigurationOld, self).__init__(**kwargs) + self.type = type + self.hostname = hostname + self.certificate = certificate diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration_py3.py new file mode 100644 index 000000000000..fb1497b52806 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/hostname_configuration_py3.py @@ -0,0 +1,81 @@ +# 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 msrest.serialization import Model + + +class HostnameConfiguration(Model): + """Custom hostname configuration. + + Variables are only 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 type: Required. Hostname type. Possible values include: 'Proxy', + 'Portal', 'Management', 'Scm' + :type type: str or ~azure.mgmt.apimanagement.models.HostnameType + :param host_name: Required. Hostname to configure on the Api Management + service. + :type host_name: str + :param key_vault_id: Url to the KeyVault Secret containing the Ssl + Certificate. If absolute Url containing version is provided, auto-update + of ssl certificate will not work. This requires Api Management service to + be configured with MSI. The secret should be of type + *application/x-pkcs12* + :type key_vault_id: str + :param encoded_certificate: Base64 Encoded certificate. + :type encoded_certificate: str + :param certificate_password: Certificate Password. + :type certificate_password: str + :param default_ssl_binding: Specify true to setup the certificate + associated with this Hostname as the Default SSL Certificate. If a client + does not send the SNI header, then this will be the certificate that will + be challenged. The property is useful if a service has multiple custom + hostname enabled and it needs to decide on the default ssl certificate. + The setting only applied to Proxy Hostname Type. Default value: False . + :type default_ssl_binding: bool + :param negotiate_client_certificate: Specify true to always negotiate + client certificate on the hostname. Default Value is false. Default value: + False . + :type negotiate_client_certificate: bool + :ivar certificate: Certificate information. + :vartype certificate: + ~azure.mgmt.apimanagement.models.CertificateInformation + """ + + _validation = { + 'type': {'required': True}, + 'host_name': {'required': True}, + 'certificate': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'HostnameType'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'encoded_certificate': {'key': 'encodedCertificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, + 'default_ssl_binding': {'key': 'defaultSslBinding', 'type': 'bool'}, + 'negotiate_client_certificate': {'key': 'negotiateClientCertificate', 'type': 'bool'}, + 'certificate': {'key': 'certificate', 'type': 'CertificateInformation'}, + } + + def __init__(self, *, type, host_name: str, key_vault_id: str=None, encoded_certificate: str=None, certificate_password: str=None, default_ssl_binding: bool=False, negotiate_client_certificate: bool=False, **kwargs) -> None: + super(HostnameConfiguration, self).__init__(**kwargs) + self.type = type + self.host_name = host_name + self.key_vault_id = key_vault_id + self.encoded_certificate = encoded_certificate + self.certificate_password = certificate_password + self.default_ssl_binding = default_ssl_binding + self.negotiate_client_certificate = negotiate_client_certificate + self.certificate = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_base_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_base_parameters.py new file mode 100644 index 000000000000..dab55bcd8709 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_base_parameters.py @@ -0,0 +1,62 @@ +# 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 msrest.serialization import Model + + +class IdentityProviderBaseParameters(Model): + """Identity Provider Base Parameter Properties. + + :param type: Identity Provider Type identifier. Possible values include: + 'facebook', 'google', 'microsoft', 'twitter', 'aad', 'aadB2C' + :type type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType + :param allowed_tenants: List of Allowed Tenants when configuring Azure + Active Directory login. + :type allowed_tenants: list[str] + :param signup_policy_name: Signup Policy Name. Only applies to AAD B2C + Identity Provider. + :type signup_policy_name: str + :param signin_policy_name: Signin Policy Name. Only applies to AAD B2C + Identity Provider. + :type signin_policy_name: str + :param profile_editing_policy_name: Profile Editing Policy Name. Only + applies to AAD B2C Identity Provider. + :type profile_editing_policy_name: str + :param password_reset_policy_name: Password Reset Policy Name. Only + applies to AAD B2C Identity Provider. + :type password_reset_policy_name: str + """ + + _validation = { + 'allowed_tenants': {'max_items': 32}, + 'signup_policy_name': {'min_length': 1}, + 'signin_policy_name': {'min_length': 1}, + 'profile_editing_policy_name': {'min_length': 1}, + 'password_reset_policy_name': {'min_length': 1}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'allowed_tenants': {'key': 'allowedTenants', 'type': '[str]'}, + 'signup_policy_name': {'key': 'signupPolicyName', 'type': 'str'}, + 'signin_policy_name': {'key': 'signinPolicyName', 'type': 'str'}, + 'profile_editing_policy_name': {'key': 'profileEditingPolicyName', 'type': 'str'}, + 'password_reset_policy_name': {'key': 'passwordResetPolicyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityProviderBaseParameters, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.allowed_tenants = kwargs.get('allowed_tenants', None) + self.signup_policy_name = kwargs.get('signup_policy_name', None) + self.signin_policy_name = kwargs.get('signin_policy_name', None) + self.profile_editing_policy_name = kwargs.get('profile_editing_policy_name', None) + self.password_reset_policy_name = kwargs.get('password_reset_policy_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_base_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_base_parameters_py3.py new file mode 100644 index 000000000000..859112aa287e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_base_parameters_py3.py @@ -0,0 +1,62 @@ +# 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 msrest.serialization import Model + + +class IdentityProviderBaseParameters(Model): + """Identity Provider Base Parameter Properties. + + :param type: Identity Provider Type identifier. Possible values include: + 'facebook', 'google', 'microsoft', 'twitter', 'aad', 'aadB2C' + :type type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType + :param allowed_tenants: List of Allowed Tenants when configuring Azure + Active Directory login. + :type allowed_tenants: list[str] + :param signup_policy_name: Signup Policy Name. Only applies to AAD B2C + Identity Provider. + :type signup_policy_name: str + :param signin_policy_name: Signin Policy Name. Only applies to AAD B2C + Identity Provider. + :type signin_policy_name: str + :param profile_editing_policy_name: Profile Editing Policy Name. Only + applies to AAD B2C Identity Provider. + :type profile_editing_policy_name: str + :param password_reset_policy_name: Password Reset Policy Name. Only + applies to AAD B2C Identity Provider. + :type password_reset_policy_name: str + """ + + _validation = { + 'allowed_tenants': {'max_items': 32}, + 'signup_policy_name': {'min_length': 1}, + 'signin_policy_name': {'min_length': 1}, + 'profile_editing_policy_name': {'min_length': 1}, + 'password_reset_policy_name': {'min_length': 1}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'allowed_tenants': {'key': 'allowedTenants', 'type': '[str]'}, + 'signup_policy_name': {'key': 'signupPolicyName', 'type': 'str'}, + 'signin_policy_name': {'key': 'signinPolicyName', 'type': 'str'}, + 'profile_editing_policy_name': {'key': 'profileEditingPolicyName', 'type': 'str'}, + 'password_reset_policy_name': {'key': 'passwordResetPolicyName', 'type': 'str'}, + } + + def __init__(self, *, type=None, allowed_tenants=None, signup_policy_name: str=None, signin_policy_name: str=None, profile_editing_policy_name: str=None, password_reset_policy_name: str=None, **kwargs) -> None: + super(IdentityProviderBaseParameters, self).__init__(**kwargs) + self.type = type + self.allowed_tenants = allowed_tenants + self.signup_policy_name = signup_policy_name + self.signin_policy_name = signin_policy_name + self.profile_editing_policy_name = profile_editing_policy_name + self.password_reset_policy_name = password_reset_policy_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_contract.py new file mode 100644 index 000000000000..662e6ad9dad6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_contract.py @@ -0,0 +1,96 @@ +# 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 .resource import Resource + + +class IdentityProviderContract(Resource): + """Identity Provider details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param identity_provider_contract_type: Identity Provider Type identifier. + Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + 'aad', 'aadB2C' + :type identity_provider_contract_type: str or + ~azure.mgmt.apimanagement.models.IdentityProviderType + :param allowed_tenants: List of Allowed Tenants when configuring Azure + Active Directory login. + :type allowed_tenants: list[str] + :param signup_policy_name: Signup Policy Name. Only applies to AAD B2C + Identity Provider. + :type signup_policy_name: str + :param signin_policy_name: Signin Policy Name. Only applies to AAD B2C + Identity Provider. + :type signin_policy_name: str + :param profile_editing_policy_name: Profile Editing Policy Name. Only + applies to AAD B2C Identity Provider. + :type profile_editing_policy_name: str + :param password_reset_policy_name: Password Reset Policy Name. Only + applies to AAD B2C Identity Provider. + :type password_reset_policy_name: str + :param client_id: Required. Client Id of the Application in the external + Identity Provider. It is App ID for Facebook login, Client ID for Google + login, App ID for Microsoft. + :type client_id: str + :param client_secret: Required. Client secret of the Application in + external Identity Provider, used to authenticate login request. For + example, it is App Secret for Facebook login, API Key for Google login, + Public Key for Microsoft. + :type client_secret: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'allowed_tenants': {'max_items': 32}, + 'signup_policy_name': {'min_length': 1}, + 'signin_policy_name': {'min_length': 1}, + 'profile_editing_policy_name': {'min_length': 1}, + 'password_reset_policy_name': {'min_length': 1}, + 'client_id': {'required': True, 'min_length': 1}, + 'client_secret': {'required': True, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity_provider_contract_type': {'key': 'properties.type', 'type': 'str'}, + 'allowed_tenants': {'key': 'properties.allowedTenants', 'type': '[str]'}, + 'signup_policy_name': {'key': 'properties.signupPolicyName', 'type': 'str'}, + 'signin_policy_name': {'key': 'properties.signinPolicyName', 'type': 'str'}, + 'profile_editing_policy_name': {'key': 'properties.profileEditingPolicyName', 'type': 'str'}, + 'password_reset_policy_name': {'key': 'properties.passwordResetPolicyName', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityProviderContract, self).__init__(**kwargs) + self.identity_provider_contract_type = kwargs.get('identity_provider_contract_type', None) + self.allowed_tenants = kwargs.get('allowed_tenants', None) + self.signup_policy_name = kwargs.get('signup_policy_name', None) + self.signin_policy_name = kwargs.get('signin_policy_name', None) + self.profile_editing_policy_name = kwargs.get('profile_editing_policy_name', None) + self.password_reset_policy_name = kwargs.get('password_reset_policy_name', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_contract_paged.py new file mode 100644 index 000000000000..4c47b9094fc3 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_contract_paged.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 msrest.paging import Paged + + +class IdentityProviderContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`IdentityProviderContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IdentityProviderContract]'} + } + + def __init__(self, *args, **kwargs): + + super(IdentityProviderContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_contract_py3.py new file mode 100644 index 000000000000..61d0050f11d6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_contract_py3.py @@ -0,0 +1,96 @@ +# 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 .resource import Resource + + +class IdentityProviderContract(Resource): + """Identity Provider details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param identity_provider_contract_type: Identity Provider Type identifier. + Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + 'aad', 'aadB2C' + :type identity_provider_contract_type: str or + ~azure.mgmt.apimanagement.models.IdentityProviderType + :param allowed_tenants: List of Allowed Tenants when configuring Azure + Active Directory login. + :type allowed_tenants: list[str] + :param signup_policy_name: Signup Policy Name. Only applies to AAD B2C + Identity Provider. + :type signup_policy_name: str + :param signin_policy_name: Signin Policy Name. Only applies to AAD B2C + Identity Provider. + :type signin_policy_name: str + :param profile_editing_policy_name: Profile Editing Policy Name. Only + applies to AAD B2C Identity Provider. + :type profile_editing_policy_name: str + :param password_reset_policy_name: Password Reset Policy Name. Only + applies to AAD B2C Identity Provider. + :type password_reset_policy_name: str + :param client_id: Required. Client Id of the Application in the external + Identity Provider. It is App ID for Facebook login, Client ID for Google + login, App ID for Microsoft. + :type client_id: str + :param client_secret: Required. Client secret of the Application in + external Identity Provider, used to authenticate login request. For + example, it is App Secret for Facebook login, API Key for Google login, + Public Key for Microsoft. + :type client_secret: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'allowed_tenants': {'max_items': 32}, + 'signup_policy_name': {'min_length': 1}, + 'signin_policy_name': {'min_length': 1}, + 'profile_editing_policy_name': {'min_length': 1}, + 'password_reset_policy_name': {'min_length': 1}, + 'client_id': {'required': True, 'min_length': 1}, + 'client_secret': {'required': True, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity_provider_contract_type': {'key': 'properties.type', 'type': 'str'}, + 'allowed_tenants': {'key': 'properties.allowedTenants', 'type': '[str]'}, + 'signup_policy_name': {'key': 'properties.signupPolicyName', 'type': 'str'}, + 'signin_policy_name': {'key': 'properties.signinPolicyName', 'type': 'str'}, + 'profile_editing_policy_name': {'key': 'properties.profileEditingPolicyName', 'type': 'str'}, + 'password_reset_policy_name': {'key': 'properties.passwordResetPolicyName', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + } + + def __init__(self, *, client_id: str, client_secret: str, identity_provider_contract_type=None, allowed_tenants=None, signup_policy_name: str=None, signin_policy_name: str=None, profile_editing_policy_name: str=None, password_reset_policy_name: str=None, **kwargs) -> None: + super(IdentityProviderContract, self).__init__(, **kwargs) + self.identity_provider_contract_type = identity_provider_contract_type + self.allowed_tenants = allowed_tenants + self.signup_policy_name = signup_policy_name + self.signin_policy_name = signin_policy_name + self.profile_editing_policy_name = profile_editing_policy_name + self.password_reset_policy_name = password_reset_policy_name + self.client_id = client_id + self.client_secret = client_secret diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_update_parameters.py new file mode 100644 index 000000000000..deb45fefcb36 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_update_parameters.py @@ -0,0 +1,77 @@ +# 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 msrest.serialization import Model + + +class IdentityProviderUpdateParameters(Model): + """Parameters supplied to update Identity Provider. + + :param type: Identity Provider Type identifier. Possible values include: + 'facebook', 'google', 'microsoft', 'twitter', 'aad', 'aadB2C' + :type type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType + :param allowed_tenants: List of Allowed Tenants when configuring Azure + Active Directory login. + :type allowed_tenants: list[str] + :param signup_policy_name: Signup Policy Name. Only applies to AAD B2C + Identity Provider. + :type signup_policy_name: str + :param signin_policy_name: Signin Policy Name. Only applies to AAD B2C + Identity Provider. + :type signin_policy_name: str + :param profile_editing_policy_name: Profile Editing Policy Name. Only + applies to AAD B2C Identity Provider. + :type profile_editing_policy_name: str + :param password_reset_policy_name: Password Reset Policy Name. Only + applies to AAD B2C Identity Provider. + :type password_reset_policy_name: str + :param client_id: Client Id of the Application in the external Identity + Provider. It is App ID for Facebook login, Client ID for Google login, App + ID for Microsoft. + :type client_id: str + :param client_secret: Client secret of the Application in external + Identity Provider, used to authenticate login request. For example, it is + App Secret for Facebook login, API Key for Google login, Public Key for + Microsoft. + :type client_secret: str + """ + + _validation = { + 'allowed_tenants': {'max_items': 32}, + 'signup_policy_name': {'min_length': 1}, + 'signin_policy_name': {'min_length': 1}, + 'profile_editing_policy_name': {'min_length': 1}, + 'password_reset_policy_name': {'min_length': 1}, + 'client_id': {'min_length': 1}, + 'client_secret': {'min_length': 1}, + } + + _attribute_map = { + 'type': {'key': 'properties.type', 'type': 'str'}, + 'allowed_tenants': {'key': 'properties.allowedTenants', 'type': '[str]'}, + 'signup_policy_name': {'key': 'properties.signupPolicyName', 'type': 'str'}, + 'signin_policy_name': {'key': 'properties.signinPolicyName', 'type': 'str'}, + 'profile_editing_policy_name': {'key': 'properties.profileEditingPolicyName', 'type': 'str'}, + 'password_reset_policy_name': {'key': 'properties.passwordResetPolicyName', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityProviderUpdateParameters, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.allowed_tenants = kwargs.get('allowed_tenants', None) + self.signup_policy_name = kwargs.get('signup_policy_name', None) + self.signin_policy_name = kwargs.get('signin_policy_name', None) + self.profile_editing_policy_name = kwargs.get('profile_editing_policy_name', None) + self.password_reset_policy_name = kwargs.get('password_reset_policy_name', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_update_parameters_py3.py new file mode 100644 index 000000000000..4d2aaeb14ff1 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/identity_provider_update_parameters_py3.py @@ -0,0 +1,77 @@ +# 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 msrest.serialization import Model + + +class IdentityProviderUpdateParameters(Model): + """Parameters supplied to update Identity Provider. + + :param type: Identity Provider Type identifier. Possible values include: + 'facebook', 'google', 'microsoft', 'twitter', 'aad', 'aadB2C' + :type type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType + :param allowed_tenants: List of Allowed Tenants when configuring Azure + Active Directory login. + :type allowed_tenants: list[str] + :param signup_policy_name: Signup Policy Name. Only applies to AAD B2C + Identity Provider. + :type signup_policy_name: str + :param signin_policy_name: Signin Policy Name. Only applies to AAD B2C + Identity Provider. + :type signin_policy_name: str + :param profile_editing_policy_name: Profile Editing Policy Name. Only + applies to AAD B2C Identity Provider. + :type profile_editing_policy_name: str + :param password_reset_policy_name: Password Reset Policy Name. Only + applies to AAD B2C Identity Provider. + :type password_reset_policy_name: str + :param client_id: Client Id of the Application in the external Identity + Provider. It is App ID for Facebook login, Client ID for Google login, App + ID for Microsoft. + :type client_id: str + :param client_secret: Client secret of the Application in external + Identity Provider, used to authenticate login request. For example, it is + App Secret for Facebook login, API Key for Google login, Public Key for + Microsoft. + :type client_secret: str + """ + + _validation = { + 'allowed_tenants': {'max_items': 32}, + 'signup_policy_name': {'min_length': 1}, + 'signin_policy_name': {'min_length': 1}, + 'profile_editing_policy_name': {'min_length': 1}, + 'password_reset_policy_name': {'min_length': 1}, + 'client_id': {'min_length': 1}, + 'client_secret': {'min_length': 1}, + } + + _attribute_map = { + 'type': {'key': 'properties.type', 'type': 'str'}, + 'allowed_tenants': {'key': 'properties.allowedTenants', 'type': '[str]'}, + 'signup_policy_name': {'key': 'properties.signupPolicyName', 'type': 'str'}, + 'signin_policy_name': {'key': 'properties.signinPolicyName', 'type': 'str'}, + 'profile_editing_policy_name': {'key': 'properties.profileEditingPolicyName', 'type': 'str'}, + 'password_reset_policy_name': {'key': 'properties.passwordResetPolicyName', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + } + + def __init__(self, *, type=None, allowed_tenants=None, signup_policy_name: str=None, signin_policy_name: str=None, profile_editing_policy_name: str=None, password_reset_policy_name: str=None, client_id: str=None, client_secret: str=None, **kwargs) -> None: + super(IdentityProviderUpdateParameters, self).__init__(**kwargs) + self.type = type + self.allowed_tenants = allowed_tenants + self.signup_policy_name = signup_policy_name + self.signin_policy_name = signin_policy_name + self.profile_editing_policy_name = profile_editing_policy_name + self.password_reset_policy_name = password_reset_policy_name + self.client_id = client_id + self.client_secret = client_secret diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_contract.py new file mode 100644 index 000000000000..d73d8fba23ec --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_contract.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 .resource import Resource + + +class LoggerContract(Resource): + """Logger details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param logger_type: Required. Logger type. Possible values include: + 'azureEventHub', 'applicationInsights' + :type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType + :param description: Logger description. + :type description: str + :param credentials: Required. The name and SendRule connection string of + the event hub for azureEventHub logger. + Instrumentation key for applicationInsights logger. + :type credentials: dict[str, str] + :param is_buffered: Whether records are buffered in the logger before + publishing. Default is assumed to be true. + :type is_buffered: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'logger_type': {'required': True}, + 'description': {'max_length': 256}, + 'credentials': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'logger_type': {'key': 'properties.loggerType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': '{str}'}, + 'is_buffered': {'key': 'properties.isBuffered', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(LoggerContract, self).__init__(**kwargs) + self.logger_type = kwargs.get('logger_type', None) + self.description = kwargs.get('description', None) + self.credentials = kwargs.get('credentials', None) + self.is_buffered = kwargs.get('is_buffered', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_contract_paged.py new file mode 100644 index 000000000000..e43659aa7736 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_contract_paged.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 msrest.paging import Paged + + +class LoggerContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`LoggerContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LoggerContract]'} + } + + def __init__(self, *args, **kwargs): + + super(LoggerContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_contract_py3.py new file mode 100644 index 000000000000..9e7321aa2c91 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_contract_py3.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 .resource import Resource + + +class LoggerContract(Resource): + """Logger details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param logger_type: Required. Logger type. Possible values include: + 'azureEventHub', 'applicationInsights' + :type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType + :param description: Logger description. + :type description: str + :param credentials: Required. The name and SendRule connection string of + the event hub for azureEventHub logger. + Instrumentation key for applicationInsights logger. + :type credentials: dict[str, str] + :param is_buffered: Whether records are buffered in the logger before + publishing. Default is assumed to be true. + :type is_buffered: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'logger_type': {'required': True}, + 'description': {'max_length': 256}, + 'credentials': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'logger_type': {'key': 'properties.loggerType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': '{str}'}, + 'is_buffered': {'key': 'properties.isBuffered', 'type': 'bool'}, + } + + def __init__(self, *, logger_type, credentials, description: str=None, is_buffered: bool=None, **kwargs) -> None: + super(LoggerContract, self).__init__(, **kwargs) + self.logger_type = logger_type + self.description = description + self.credentials = credentials + self.is_buffered = is_buffered diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_update_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_update_contract.py new file mode 100644 index 000000000000..addfa18e243f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_update_contract.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class LoggerUpdateContract(Model): + """Logger update contract. + + :param logger_type: Logger type. Possible values include: 'azureEventHub', + 'applicationInsights' + :type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType + :param description: Logger description. + :type description: str + :param credentials: Logger credentials. + :type credentials: dict[str, str] + :param is_buffered: Whether records are buffered in the logger before + publishing. Default is assumed to be true. + :type is_buffered: bool + """ + + _attribute_map = { + 'logger_type': {'key': 'properties.loggerType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': '{str}'}, + 'is_buffered': {'key': 'properties.isBuffered', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(LoggerUpdateContract, self).__init__(**kwargs) + self.logger_type = kwargs.get('logger_type', None) + self.description = kwargs.get('description', None) + self.credentials = kwargs.get('credentials', None) + self.is_buffered = kwargs.get('is_buffered', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_update_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_update_contract_py3.py new file mode 100644 index 000000000000..c87234102e67 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/logger_update_contract_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class LoggerUpdateContract(Model): + """Logger update contract. + + :param logger_type: Logger type. Possible values include: 'azureEventHub', + 'applicationInsights' + :type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType + :param description: Logger description. + :type description: str + :param credentials: Logger credentials. + :type credentials: dict[str, str] + :param is_buffered: Whether records are buffered in the logger before + publishing. Default is assumed to be true. + :type is_buffered: bool + """ + + _attribute_map = { + 'logger_type': {'key': 'properties.loggerType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': '{str}'}, + 'is_buffered': {'key': 'properties.isBuffered', 'type': 'bool'}, + } + + def __init__(self, *, logger_type=None, description: str=None, credentials=None, is_buffered: bool=None, **kwargs) -> None: + super(LoggerUpdateContract, self).__init__(**kwargs) + self.logger_type = logger_type + self.description = description + self.credentials = credentials + self.is_buffered = is_buffered diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract.py new file mode 100644 index 000000000000..93d8cadb8452 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class NetworkStatusContract(Model): + """Network Status details. + + All required parameters must be populated in order to send to Azure. + + :param dns_servers: Required. Gets the list of DNS servers IPV4 addresses. + :type dns_servers: list[str] + :param connectivity_status: Required. Gets the list of Connectivity Status + to the Resources on which the service depends upon. + :type connectivity_status: + list[~azure.mgmt.apimanagement.models.ConnectivityStatusContract] + """ + + _validation = { + 'dns_servers': {'required': True}, + 'connectivity_status': {'required': True}, + } + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'connectivity_status': {'key': 'connectivityStatus', 'type': '[ConnectivityStatusContract]'}, + } + + def __init__(self, **kwargs): + super(NetworkStatusContract, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.connectivity_status = kwargs.get('connectivity_status', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract_by_location.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract_by_location.py new file mode 100644 index 000000000000..d7268e2806dc --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract_by_location.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class NetworkStatusContractByLocation(Model): + """Network Status in the Location. + + :param location: Location of service + :type location: str + :param network_status: Network status in Location + :type network_status: + ~azure.mgmt.apimanagement.models.NetworkStatusContract + """ + + _validation = { + 'location': {'min_length': 1}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'network_status': {'key': 'networkStatus', 'type': 'NetworkStatusContract'}, + } + + def __init__(self, **kwargs): + super(NetworkStatusContractByLocation, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.network_status = kwargs.get('network_status', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract_by_location_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract_by_location_py3.py new file mode 100644 index 000000000000..8179a33cc8bb --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract_by_location_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class NetworkStatusContractByLocation(Model): + """Network Status in the Location. + + :param location: Location of service + :type location: str + :param network_status: Network status in Location + :type network_status: + ~azure.mgmt.apimanagement.models.NetworkStatusContract + """ + + _validation = { + 'location': {'min_length': 1}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'network_status': {'key': 'networkStatus', 'type': 'NetworkStatusContract'}, + } + + def __init__(self, *, location: str=None, network_status=None, **kwargs) -> None: + super(NetworkStatusContractByLocation, self).__init__(**kwargs) + self.location = location + self.network_status = network_status diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract_py3.py new file mode 100644 index 000000000000..42847b9bee85 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/network_status_contract_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class NetworkStatusContract(Model): + """Network Status details. + + All required parameters must be populated in order to send to Azure. + + :param dns_servers: Required. Gets the list of DNS servers IPV4 addresses. + :type dns_servers: list[str] + :param connectivity_status: Required. Gets the list of Connectivity Status + to the Resources on which the service depends upon. + :type connectivity_status: + list[~azure.mgmt.apimanagement.models.ConnectivityStatusContract] + """ + + _validation = { + 'dns_servers': {'required': True}, + 'connectivity_status': {'required': True}, + } + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'connectivity_status': {'key': 'connectivityStatus', 'type': '[ConnectivityStatusContract]'}, + } + + def __init__(self, *, dns_servers, connectivity_status, **kwargs) -> None: + super(NetworkStatusContract, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.connectivity_status = connectivity_status diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/notification_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/notification_contract.py new file mode 100644 index 000000000000..0a61e503deae --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/notification_contract.py @@ -0,0 +1,58 @@ +# 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 .resource import Resource + + +class NotificationContract(Resource): + """Notification details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param title: Required. Title of the Notification. + :type title: str + :param description: Description of the Notification. + :type description: str + :param recipients: Recipient Parameter values. + :type recipients: + ~azure.mgmt.apimanagement.models.RecipientsContractProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'title': {'required': True, 'max_length': 1000, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'recipients': {'key': 'properties.recipients', 'type': 'RecipientsContractProperties'}, + } + + def __init__(self, **kwargs): + super(NotificationContract, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.recipients = kwargs.get('recipients', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/notification_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/notification_contract_paged.py new file mode 100644 index 000000000000..be23f722f720 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/notification_contract_paged.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 msrest.paging import Paged + + +class NotificationContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`NotificationContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NotificationContract]'} + } + + def __init__(self, *args, **kwargs): + + super(NotificationContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/notification_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/notification_contract_py3.py new file mode 100644 index 000000000000..102452a02849 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/notification_contract_py3.py @@ -0,0 +1,58 @@ +# 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 .resource import Resource + + +class NotificationContract(Resource): + """Notification details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param title: Required. Title of the Notification. + :type title: str + :param description: Description of the Notification. + :type description: str + :param recipients: Recipient Parameter values. + :type recipients: + ~azure.mgmt.apimanagement.models.RecipientsContractProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'title': {'required': True, 'max_length': 1000, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'recipients': {'key': 'properties.recipients', 'type': 'RecipientsContractProperties'}, + } + + def __init__(self, *, title: str, description: str=None, recipients=None, **kwargs) -> None: + super(NotificationContract, self).__init__(, **kwargs) + self.title = title + self.description = description + self.recipients = recipients diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/oauth2_authentication_settings_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/oauth2_authentication_settings_contract.py new file mode 100644 index 000000000000..ed8482767874 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/oauth2_authentication_settings_contract.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class OAuth2AuthenticationSettingsContract(Model): + """API OAuth2 Authentication settings details. + + :param authorization_server_id: OAuth authorization server identifier. + :type authorization_server_id: str + :param scope: operations scope. + :type scope: str + """ + + _attribute_map = { + 'authorization_server_id': {'key': 'authorizationServerId', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OAuth2AuthenticationSettingsContract, self).__init__(**kwargs) + self.authorization_server_id = kwargs.get('authorization_server_id', None) + self.scope = kwargs.get('scope', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/oauth2_authentication_settings_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/oauth2_authentication_settings_contract_py3.py new file mode 100644 index 000000000000..f0a1eac4ca71 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/oauth2_authentication_settings_contract_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class OAuth2AuthenticationSettingsContract(Model): + """API OAuth2 Authentication settings details. + + :param authorization_server_id: OAuth authorization server identifier. + :type authorization_server_id: str + :param scope: operations scope. + :type scope: str + """ + + _attribute_map = { + 'authorization_server_id': {'key': 'authorizationServerId', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + } + + def __init__(self, *, authorization_server_id: str=None, scope: str=None, **kwargs) -> None: + super(OAuth2AuthenticationSettingsContract, self).__init__(**kwargs) + self.authorization_server_id = authorization_server_id + self.scope = scope diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_contract.py new file mode 100644 index 000000000000..0ac98bb10f48 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_contract.py @@ -0,0 +1,69 @@ +# 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 .resource import Resource + + +class OpenidConnectProviderContract(Resource): + """OpenId Connect Provider details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param display_name: Required. User-friendly OpenID Connect Provider name. + :type display_name: str + :param description: User-friendly description of OpenID Connect Provider. + :type description: str + :param metadata_endpoint: Required. Metadata endpoint URI. + :type metadata_endpoint: str + :param client_id: Required. Client ID of developer console which is the + client application. + :type client_id: str + :param client_secret: Client Secret of developer console which is the + client application. + :type client_secret: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True, 'max_length': 50}, + 'metadata_endpoint': {'required': True}, + 'client_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'metadata_endpoint': {'key': 'properties.metadataEndpoint', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OpenidConnectProviderContract, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.metadata_endpoint = kwargs.get('metadata_endpoint', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_contract_paged.py new file mode 100644 index 000000000000..ade0ae119282 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_contract_paged.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 msrest.paging import Paged + + +class OpenidConnectProviderContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`OpenidConnectProviderContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OpenidConnectProviderContract]'} + } + + def __init__(self, *args, **kwargs): + + super(OpenidConnectProviderContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_contract_py3.py new file mode 100644 index 000000000000..7afadba32341 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_contract_py3.py @@ -0,0 +1,69 @@ +# 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 .resource import Resource + + +class OpenidConnectProviderContract(Resource): + """OpenId Connect Provider details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param display_name: Required. User-friendly OpenID Connect Provider name. + :type display_name: str + :param description: User-friendly description of OpenID Connect Provider. + :type description: str + :param metadata_endpoint: Required. Metadata endpoint URI. + :type metadata_endpoint: str + :param client_id: Required. Client ID of developer console which is the + client application. + :type client_id: str + :param client_secret: Client Secret of developer console which is the + client application. + :type client_secret: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True, 'max_length': 50}, + 'metadata_endpoint': {'required': True}, + 'client_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'metadata_endpoint': {'key': 'properties.metadataEndpoint', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, metadata_endpoint: str, client_id: str, description: str=None, client_secret: str=None, **kwargs) -> None: + super(OpenidConnectProviderContract, self).__init__(, **kwargs) + self.display_name = display_name + self.description = description + self.metadata_endpoint = metadata_endpoint + self.client_id = client_id + self.client_secret = client_secret diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_update_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_update_contract.py new file mode 100644 index 000000000000..ff37d87ccedd --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_update_contract.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class OpenidConnectProviderUpdateContract(Model): + """Parameters supplied to the Update OpenID Connect Provider operation. + + :param display_name: User-friendly OpenID Connect Provider name. + :type display_name: str + :param description: User-friendly description of OpenID Connect Provider. + :type description: str + :param metadata_endpoint: Metadata endpoint URI. + :type metadata_endpoint: str + :param client_id: Client ID of developer console which is the client + application. + :type client_id: str + :param client_secret: Client Secret of developer console which is the + client application. + :type client_secret: str + """ + + _validation = { + 'display_name': {'max_length': 50}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'metadata_endpoint': {'key': 'properties.metadataEndpoint', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OpenidConnectProviderUpdateContract, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.metadata_endpoint = kwargs.get('metadata_endpoint', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_update_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_update_contract_py3.py new file mode 100644 index 000000000000..0acdde07011a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/openid_connect_provider_update_contract_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class OpenidConnectProviderUpdateContract(Model): + """Parameters supplied to the Update OpenID Connect Provider operation. + + :param display_name: User-friendly OpenID Connect Provider name. + :type display_name: str + :param description: User-friendly description of OpenID Connect Provider. + :type description: str + :param metadata_endpoint: Metadata endpoint URI. + :type metadata_endpoint: str + :param client_id: Client ID of developer console which is the client + application. + :type client_id: str + :param client_secret: Client Secret of developer console which is the + client application. + :type client_secret: str + """ + + _validation = { + 'display_name': {'max_length': 50}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'metadata_endpoint': {'key': 'properties.metadataEndpoint', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, description: str=None, metadata_endpoint: str=None, client_id: str=None, client_secret: str=None, **kwargs) -> None: + super(OpenidConnectProviderUpdateContract, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.metadata_endpoint = metadata_endpoint + self.client_id = client_id + self.client_secret = client_secret diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation.py new file mode 100644 index 000000000000..9b403bad2fcf --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that describes the operation. + :type display: ~azure.mgmt.apimanagement.models.OperationDisplay + :param origin: The operation origin. + :type origin: str + :param properties: The operation properties. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + 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.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_contract.py new file mode 100644 index 000000000000..cf9b5b4a3ff0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_contract.py @@ -0,0 +1,85 @@ +# 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 .resource import Resource + + +class OperationContract(Resource): + """Api Operation details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param template_parameters: Collection of URL template parameters. + :type template_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + :param description: Description of the operation. May include HTML + formatting tags. + :type description: str + :param request: An entity containing request details. + :type request: ~azure.mgmt.apimanagement.models.RequestContract + :param responses: Array of Operation responses. + :type responses: list[~azure.mgmt.apimanagement.models.ResponseContract] + :param policies: Operation Policies + :type policies: str + :param display_name: Required. Operation Name. + :type display_name: str + :param method: Required. A Valid HTTP Operation Method. Typical Http + Methods like GET, PUT, POST but not limited by only them. + :type method: str + :param url_template: Required. Relative URL template identifying the + target resource for this operation. May include parameters. Example: + /customers/{cid}/orders/{oid}/?date={date} + :type url_template: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'max_length': 1000}, + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + 'method': {'required': True}, + 'url_template': {'required': True, 'max_length': 1000, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'template_parameters': {'key': 'properties.templateParameters', 'type': '[ParameterContract]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'request': {'key': 'properties.request', 'type': 'RequestContract'}, + 'responses': {'key': 'properties.responses', 'type': '[ResponseContract]'}, + 'policies': {'key': 'properties.policies', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'method': {'key': 'properties.method', 'type': 'str'}, + 'url_template': {'key': 'properties.urlTemplate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationContract, self).__init__(**kwargs) + self.template_parameters = kwargs.get('template_parameters', None) + self.description = kwargs.get('description', None) + self.request = kwargs.get('request', None) + self.responses = kwargs.get('responses', None) + self.policies = kwargs.get('policies', None) + self.display_name = kwargs.get('display_name', None) + self.method = kwargs.get('method', None) + self.url_template = kwargs.get('url_template', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_contract_paged.py new file mode 100644 index 000000000000..d26188bf9f3b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_contract_paged.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 msrest.paging import Paged + + +class OperationContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationContract]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_contract_py3.py new file mode 100644 index 000000000000..225b02348be6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_contract_py3.py @@ -0,0 +1,85 @@ +# 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 .resource import Resource + + +class OperationContract(Resource): + """Api Operation details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param template_parameters: Collection of URL template parameters. + :type template_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + :param description: Description of the operation. May include HTML + formatting tags. + :type description: str + :param request: An entity containing request details. + :type request: ~azure.mgmt.apimanagement.models.RequestContract + :param responses: Array of Operation responses. + :type responses: list[~azure.mgmt.apimanagement.models.ResponseContract] + :param policies: Operation Policies + :type policies: str + :param display_name: Required. Operation Name. + :type display_name: str + :param method: Required. A Valid HTTP Operation Method. Typical Http + Methods like GET, PUT, POST but not limited by only them. + :type method: str + :param url_template: Required. Relative URL template identifying the + target resource for this operation. May include parameters. Example: + /customers/{cid}/orders/{oid}/?date={date} + :type url_template: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'max_length': 1000}, + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + 'method': {'required': True}, + 'url_template': {'required': True, 'max_length': 1000, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'template_parameters': {'key': 'properties.templateParameters', 'type': '[ParameterContract]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'request': {'key': 'properties.request', 'type': 'RequestContract'}, + 'responses': {'key': 'properties.responses', 'type': '[ResponseContract]'}, + 'policies': {'key': 'properties.policies', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'method': {'key': 'properties.method', 'type': 'str'}, + 'url_template': {'key': 'properties.urlTemplate', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, method: str, url_template: str, template_parameters=None, description: str=None, request=None, responses=None, policies: str=None, **kwargs) -> None: + super(OperationContract, self).__init__(, **kwargs) + self.template_parameters = template_parameters + self.description = description + self.request = request + self.responses = responses + self.policies = policies + self.display_name = display_name + self.method = method + self.url_template = url_template diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_display.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_display.py new file mode 100644 index 000000000000..d0fde0c4a0b9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_display.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that describes the operation. + + :param provider: Friendly name of the resource provider + :type provider: str + :param operation: Operation type: read, write, delete, listKeys/action, + etc. + :type operation: str + :param resource: Resource type on which the operation is performed. + :type resource: str + :param description: Friendly name of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.operation = kwargs.get('operation', None) + self.resource = kwargs.get('resource', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_display_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_display_py3.py new file mode 100644 index 000000000000..37858ea03adb --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_display_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that describes the operation. + + :param provider: Friendly name of the resource provider + :type provider: str + :param operation: Operation type: read, write, delete, listKeys/action, + etc. + :type operation: str + :param resource: Resource type on which the operation is performed. + :type resource: str + :param description: Friendly name of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, operation: str=None, resource: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.operation = operation + self.resource = resource + self.description = description diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_entity_base_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_entity_base_contract.py new file mode 100644 index 000000000000..bc0a8f41ace2 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_entity_base_contract.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class OperationEntityBaseContract(Model): + """Api Operation Entity Base Contract details. + + :param template_parameters: Collection of URL template parameters. + :type template_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + :param description: Description of the operation. May include HTML + formatting tags. + :type description: str + :param request: An entity containing request details. + :type request: ~azure.mgmt.apimanagement.models.RequestContract + :param responses: Array of Operation responses. + :type responses: list[~azure.mgmt.apimanagement.models.ResponseContract] + :param policies: Operation Policies + :type policies: str + """ + + _validation = { + 'description': {'max_length': 1000}, + } + + _attribute_map = { + 'template_parameters': {'key': 'templateParameters', 'type': '[ParameterContract]'}, + 'description': {'key': 'description', 'type': 'str'}, + 'request': {'key': 'request', 'type': 'RequestContract'}, + 'responses': {'key': 'responses', 'type': '[ResponseContract]'}, + 'policies': {'key': 'policies', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationEntityBaseContract, self).__init__(**kwargs) + self.template_parameters = kwargs.get('template_parameters', None) + self.description = kwargs.get('description', None) + self.request = kwargs.get('request', None) + self.responses = kwargs.get('responses', None) + self.policies = kwargs.get('policies', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_entity_base_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_entity_base_contract_py3.py new file mode 100644 index 000000000000..62d409a210db --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_entity_base_contract_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class OperationEntityBaseContract(Model): + """Api Operation Entity Base Contract details. + + :param template_parameters: Collection of URL template parameters. + :type template_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + :param description: Description of the operation. May include HTML + formatting tags. + :type description: str + :param request: An entity containing request details. + :type request: ~azure.mgmt.apimanagement.models.RequestContract + :param responses: Array of Operation responses. + :type responses: list[~azure.mgmt.apimanagement.models.ResponseContract] + :param policies: Operation Policies + :type policies: str + """ + + _validation = { + 'description': {'max_length': 1000}, + } + + _attribute_map = { + 'template_parameters': {'key': 'templateParameters', 'type': '[ParameterContract]'}, + 'description': {'key': 'description', 'type': 'str'}, + 'request': {'key': 'request', 'type': 'RequestContract'}, + 'responses': {'key': 'responses', 'type': '[ResponseContract]'}, + 'policies': {'key': 'policies', 'type': 'str'}, + } + + def __init__(self, *, template_parameters=None, description: str=None, request=None, responses=None, policies: str=None, **kwargs) -> None: + super(OperationEntityBaseContract, self).__init__(**kwargs) + self.template_parameters = template_parameters + self.description = description + self.request = request + self.responses = responses + self.policies = policies diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_paged.py new file mode 100644 index 000000000000..950b8acd7466 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_paged.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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_py3.py new file mode 100644 index 000000000000..eb38d162365a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that describes the operation. + :type display: ~azure.mgmt.apimanagement.models.OperationDisplay + :param origin: The operation origin. + :type origin: str + :param properties: The operation properties. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_contract.py new file mode 100644 index 000000000000..14e39327b281 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_contract.py @@ -0,0 +1,68 @@ +# 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 msrest.serialization import Model + + +class OperationResultContract(Model): + """Operation Result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Operation result identifier. + :type id: str + :param status: Status of an async operation. Possible values include: + 'Started', 'InProgress', 'Succeeded', 'Failed' + :type status: str or ~azure.mgmt.apimanagement.models.AsyncOperationStatus + :param started: Start time of an async operation. The date conforms to the + following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :type started: datetime + :param updated: Last update time of an async operation. The date conforms + to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + 8601 standard. + :type updated: datetime + :param result_info: Optional result info. + :type result_info: str + :param error: Error Body Contract + :type error: ~azure.mgmt.apimanagement.models.ErrorResponse + :ivar action_log: This property if only provided as part of the + TenantConfiguration_Validate operation. It contains the log the entities + which will be updated/created/deleted as part of the + TenantConfiguration_Deploy operation. + :vartype action_log: + list[~azure.mgmt.apimanagement.models.OperationResultLogItemContract] + """ + + _validation = { + 'action_log': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'AsyncOperationStatus'}, + 'started': {'key': 'started', 'type': 'iso-8601'}, + 'updated': {'key': 'updated', 'type': 'iso-8601'}, + 'result_info': {'key': 'resultInfo', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'action_log': {'key': 'actionLog', 'type': '[OperationResultLogItemContract]'}, + } + + def __init__(self, **kwargs): + super(OperationResultContract, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.status = kwargs.get('status', None) + self.started = kwargs.get('started', None) + self.updated = kwargs.get('updated', None) + self.result_info = kwargs.get('result_info', None) + self.error = kwargs.get('error', None) + self.action_log = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_contract_py3.py new file mode 100644 index 000000000000..ec429753d4db --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_contract_py3.py @@ -0,0 +1,68 @@ +# 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 msrest.serialization import Model + + +class OperationResultContract(Model): + """Operation Result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Operation result identifier. + :type id: str + :param status: Status of an async operation. Possible values include: + 'Started', 'InProgress', 'Succeeded', 'Failed' + :type status: str or ~azure.mgmt.apimanagement.models.AsyncOperationStatus + :param started: Start time of an async operation. The date conforms to the + following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :type started: datetime + :param updated: Last update time of an async operation. The date conforms + to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + 8601 standard. + :type updated: datetime + :param result_info: Optional result info. + :type result_info: str + :param error: Error Body Contract + :type error: ~azure.mgmt.apimanagement.models.ErrorResponse + :ivar action_log: This property if only provided as part of the + TenantConfiguration_Validate operation. It contains the log the entities + which will be updated/created/deleted as part of the + TenantConfiguration_Deploy operation. + :vartype action_log: + list[~azure.mgmt.apimanagement.models.OperationResultLogItemContract] + """ + + _validation = { + 'action_log': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'AsyncOperationStatus'}, + 'started': {'key': 'started', 'type': 'iso-8601'}, + 'updated': {'key': 'updated', 'type': 'iso-8601'}, + 'result_info': {'key': 'resultInfo', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'action_log': {'key': 'actionLog', 'type': '[OperationResultLogItemContract]'}, + } + + def __init__(self, *, id: str=None, status=None, started=None, updated=None, result_info: str=None, error=None, **kwargs) -> None: + super(OperationResultContract, self).__init__(**kwargs) + self.id = id + self.status = status + self.started = started + self.updated = updated + self.result_info = result_info + self.error = error + self.action_log = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_log_item_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_log_item_contract.py new file mode 100644 index 000000000000..7c6f2c63c7c0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_log_item_contract.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OperationResultLogItemContract(Model): + """Log of the entity being created, updated or deleted. + + :param object_type: The type of entity contract. + :type object_type: str + :param action: Action like create/update/delete. + :type action: str + :param object_key: Identifier of the entity being created/updated/deleted. + :type object_key: str + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'object_key': {'key': 'objectKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationResultLogItemContract, self).__init__(**kwargs) + self.object_type = kwargs.get('object_type', None) + self.action = kwargs.get('action', None) + self.object_key = kwargs.get('object_key', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_log_item_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_log_item_contract_py3.py new file mode 100644 index 000000000000..e89f3615cae4 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_result_log_item_contract_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OperationResultLogItemContract(Model): + """Log of the entity being created, updated or deleted. + + :param object_type: The type of entity contract. + :type object_type: str + :param action: Action like create/update/delete. + :type action: str + :param object_key: Identifier of the entity being created/updated/deleted. + :type object_key: str + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'object_key': {'key': 'objectKey', 'type': 'str'}, + } + + def __init__(self, *, object_type: str=None, action: str=None, object_key: str=None, **kwargs) -> None: + super(OperationResultLogItemContract, self).__init__(**kwargs) + self.object_type = object_type + self.action = action + self.object_key = object_key diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_tag_resource_contract_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_tag_resource_contract_properties.py new file mode 100644 index 000000000000..c8d6e0a6d9f1 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_tag_resource_contract_properties.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class OperationTagResourceContractProperties(Model): + """Operation Entity contract Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Identifier of the operation in form /operations/{operationId}. + :type id: str + :ivar name: Operation name. + :vartype name: str + :ivar api_name: Api Name. + :vartype api_name: str + :ivar api_revision: Api Revision. + :vartype api_revision: str + :ivar api_version: Api Version. + :vartype api_version: str + :ivar description: Operation Description. + :vartype description: str + :ivar method: A Valid HTTP Operation Method. Typical Http Methods like + GET, PUT, POST but not limited by only them. + :vartype method: str + :ivar url_template: Relative URL template identifying the target resource + for this operation. May include parameters. Example: + /customers/{cid}/orders/{oid}/?date={date} + :vartype url_template: str + """ + + _validation = { + 'name': {'readonly': True}, + 'api_name': {'readonly': True}, + 'api_revision': {'readonly': True}, + 'api_version': {'readonly': True}, + 'description': {'readonly': True}, + 'method': {'readonly': True}, + 'url_template': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'api_name': {'key': 'apiName', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'url_template': {'key': 'urlTemplate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationTagResourceContractProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.api_name = None + self.api_revision = None + self.api_version = None + self.description = None + self.method = None + self.url_template = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_tag_resource_contract_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_tag_resource_contract_properties_py3.py new file mode 100644 index 000000000000..8ec9c0cb0f3b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_tag_resource_contract_properties_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class OperationTagResourceContractProperties(Model): + """Operation Entity contract Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Identifier of the operation in form /operations/{operationId}. + :type id: str + :ivar name: Operation name. + :vartype name: str + :ivar api_name: Api Name. + :vartype api_name: str + :ivar api_revision: Api Revision. + :vartype api_revision: str + :ivar api_version: Api Version. + :vartype api_version: str + :ivar description: Operation Description. + :vartype description: str + :ivar method: A Valid HTTP Operation Method. Typical Http Methods like + GET, PUT, POST but not limited by only them. + :vartype method: str + :ivar url_template: Relative URL template identifying the target resource + for this operation. May include parameters. Example: + /customers/{cid}/orders/{oid}/?date={date} + :vartype url_template: str + """ + + _validation = { + 'name': {'readonly': True}, + 'api_name': {'readonly': True}, + 'api_revision': {'readonly': True}, + 'api_version': {'readonly': True}, + 'description': {'readonly': True}, + 'method': {'readonly': True}, + 'url_template': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'api_name': {'key': 'apiName', 'type': 'str'}, + 'api_revision': {'key': 'apiRevision', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'url_template': {'key': 'urlTemplate', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(OperationTagResourceContractProperties, self).__init__(**kwargs) + self.id = id + self.name = None + self.api_name = None + self.api_revision = None + self.api_version = None + self.description = None + self.method = None + self.url_template = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_update_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_update_contract.py new file mode 100644 index 000000000000..b4b17f1dab95 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_update_contract.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 msrest.serialization import Model + + +class OperationUpdateContract(Model): + """Api Operation Update Contract details. + + :param template_parameters: Collection of URL template parameters. + :type template_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + :param description: Description of the operation. May include HTML + formatting tags. + :type description: str + :param request: An entity containing request details. + :type request: ~azure.mgmt.apimanagement.models.RequestContract + :param responses: Array of Operation responses. + :type responses: list[~azure.mgmt.apimanagement.models.ResponseContract] + :param policies: Operation Policies + :type policies: str + :param display_name: Operation Name. + :type display_name: str + :param method: A Valid HTTP Operation Method. Typical Http Methods like + GET, PUT, POST but not limited by only them. + :type method: str + :param url_template: Relative URL template identifying the target resource + for this operation. May include parameters. Example: + /customers/{cid}/orders/{oid}/?date={date} + :type url_template: str + """ + + _validation = { + 'description': {'max_length': 1000}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'url_template': {'max_length': 1000, 'min_length': 1}, + } + + _attribute_map = { + 'template_parameters': {'key': 'properties.templateParameters', 'type': '[ParameterContract]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'request': {'key': 'properties.request', 'type': 'RequestContract'}, + 'responses': {'key': 'properties.responses', 'type': '[ResponseContract]'}, + 'policies': {'key': 'properties.policies', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'method': {'key': 'properties.method', 'type': 'str'}, + 'url_template': {'key': 'properties.urlTemplate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationUpdateContract, self).__init__(**kwargs) + self.template_parameters = kwargs.get('template_parameters', None) + self.description = kwargs.get('description', None) + self.request = kwargs.get('request', None) + self.responses = kwargs.get('responses', None) + self.policies = kwargs.get('policies', None) + self.display_name = kwargs.get('display_name', None) + self.method = kwargs.get('method', None) + self.url_template = kwargs.get('url_template', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_update_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_update_contract_py3.py new file mode 100644 index 000000000000..ad070cb9c980 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/operation_update_contract_py3.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 msrest.serialization import Model + + +class OperationUpdateContract(Model): + """Api Operation Update Contract details. + + :param template_parameters: Collection of URL template parameters. + :type template_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + :param description: Description of the operation. May include HTML + formatting tags. + :type description: str + :param request: An entity containing request details. + :type request: ~azure.mgmt.apimanagement.models.RequestContract + :param responses: Array of Operation responses. + :type responses: list[~azure.mgmt.apimanagement.models.ResponseContract] + :param policies: Operation Policies + :type policies: str + :param display_name: Operation Name. + :type display_name: str + :param method: A Valid HTTP Operation Method. Typical Http Methods like + GET, PUT, POST but not limited by only them. + :type method: str + :param url_template: Relative URL template identifying the target resource + for this operation. May include parameters. Example: + /customers/{cid}/orders/{oid}/?date={date} + :type url_template: str + """ + + _validation = { + 'description': {'max_length': 1000}, + 'display_name': {'max_length': 300, 'min_length': 1}, + 'url_template': {'max_length': 1000, 'min_length': 1}, + } + + _attribute_map = { + 'template_parameters': {'key': 'properties.templateParameters', 'type': '[ParameterContract]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'request': {'key': 'properties.request', 'type': 'RequestContract'}, + 'responses': {'key': 'properties.responses', 'type': '[ResponseContract]'}, + 'policies': {'key': 'properties.policies', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'method': {'key': 'properties.method', 'type': 'str'}, + 'url_template': {'key': 'properties.urlTemplate', 'type': 'str'}, + } + + def __init__(self, *, template_parameters=None, description: str=None, request=None, responses=None, policies: str=None, display_name: str=None, method: str=None, url_template: str=None, **kwargs) -> None: + super(OperationUpdateContract, self).__init__(**kwargs) + self.template_parameters = template_parameters + self.description = description + self.request = request + self.responses = responses + self.policies = policies + self.display_name = display_name + self.method = method + self.url_template = url_template diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/parameter_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/parameter_contract.py new file mode 100644 index 000000000000..031f708372d9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/parameter_contract.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class ParameterContract(Model): + """Operation parameters details. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Parameter name. + :type name: str + :param description: Parameter description. + :type description: str + :param type: Required. Parameter type. + :type type: str + :param default_value: Default parameter value. + :type default_value: str + :param required: whether parameter is required or not. + :type required: bool + :param values: Parameter values. + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + 'required': {'key': 'required', 'type': 'bool'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ParameterContract, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.type = kwargs.get('type', None) + self.default_value = kwargs.get('default_value', None) + self.required = kwargs.get('required', None) + self.values = kwargs.get('values', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/parameter_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/parameter_contract_py3.py new file mode 100644 index 000000000000..34a0c66a77d5 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/parameter_contract_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class ParameterContract(Model): + """Operation parameters details. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Parameter name. + :type name: str + :param description: Parameter description. + :type description: str + :param type: Required. Parameter type. + :type type: str + :param default_value: Default parameter value. + :type default_value: str + :param required: whether parameter is required or not. + :type required: bool + :param values: Parameter values. + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + 'required': {'key': 'required', 'type': 'bool'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, *, name: str, type: str, description: str=None, default_value: str=None, required: bool=None, values=None, **kwargs) -> None: + super(ParameterContract, self).__init__(**kwargs) + self.name = name + self.description = description + self.type = type + self.default_value = default_value + self.required = required + self.values = values diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_collection.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_collection.py new file mode 100644 index 000000000000..4e983e14003b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_collection.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class PolicyCollection(Model): + """The response of the list policy operation. + + :param value: Policy Contract value. + :type value: list[~azure.mgmt.apimanagement.models.PolicyContract] + :param next_link: Next page link if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PolicyContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PolicyCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_collection_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_collection_py3.py new file mode 100644 index 000000000000..c48d44838266 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_collection_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class PolicyCollection(Model): + """The response of the list policy operation. + + :param value: Policy Contract value. + :type value: list[~azure.mgmt.apimanagement.models.PolicyContract] + :param next_link: Next page link if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PolicyContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(PolicyCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract.py new file mode 100644 index 000000000000..3f9ee1431ee0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract.py @@ -0,0 +1,56 @@ +# 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 .resource import Resource + + +class PolicyContract(Resource): + """Policy Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param policy_content: Required. Json escaped Xml Encoded contents of the + Policy. + :type policy_content: str + :param content_format: Format of the policyContent. Possible values + include: 'xml', 'xml-link'. Default value: "xml" . + :type content_format: str or + ~azure.mgmt.apimanagement.models.PolicyContentFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_content': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_content': {'key': 'properties.policyContent', 'type': 'str'}, + 'content_format': {'key': 'properties.contentFormat', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PolicyContract, self).__init__(**kwargs) + self.policy_content = kwargs.get('policy_content', None) + self.content_format = kwargs.get('content_format', "xml") diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract_py3.py new file mode 100644 index 000000000000..49fecdc49cf9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract_py3.py @@ -0,0 +1,56 @@ +# 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 .resource import Resource + + +class PolicyContract(Resource): + """Policy Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param policy_content: Required. Json escaped Xml Encoded contents of the + Policy. + :type policy_content: str + :param content_format: Format of the policyContent. Possible values + include: 'xml', 'xml-link'. Default value: "xml" . + :type content_format: str or + ~azure.mgmt.apimanagement.models.PolicyContentFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_content': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_content': {'key': 'properties.policyContent', 'type': 'str'}, + 'content_format': {'key': 'properties.contentFormat', 'type': 'str'}, + } + + def __init__(self, *, policy_content: str, content_format="xml", **kwargs) -> None: + super(PolicyContract, self).__init__(, **kwargs) + self.policy_content = policy_content + self.content_format = content_format diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippet_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippet_contract.py new file mode 100644 index 000000000000..e9317d9566c6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippet_contract.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class PolicySnippetContract(Model): + """Policy snippet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Snippet name. + :vartype name: str + :ivar content: Snippet content. + :vartype content: str + :ivar tool_tip: Snippet toolTip. + :vartype tool_tip: str + :ivar scope: Binary OR value of the Snippet scope. + :vartype scope: int + """ + + _validation = { + 'name': {'readonly': True}, + 'content': {'readonly': True}, + 'tool_tip': {'readonly': True}, + 'scope': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + 'tool_tip': {'key': 'toolTip', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(PolicySnippetContract, self).__init__(**kwargs) + self.name = None + self.content = None + self.tool_tip = None + self.scope = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippet_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippet_contract_py3.py new file mode 100644 index 000000000000..8bc7494b939f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippet_contract_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class PolicySnippetContract(Model): + """Policy snippet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Snippet name. + :vartype name: str + :ivar content: Snippet content. + :vartype content: str + :ivar tool_tip: Snippet toolTip. + :vartype tool_tip: str + :ivar scope: Binary OR value of the Snippet scope. + :vartype scope: int + """ + + _validation = { + 'name': {'readonly': True}, + 'content': {'readonly': True}, + 'tool_tip': {'readonly': True}, + 'scope': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + 'tool_tip': {'key': 'toolTip', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(PolicySnippetContract, self).__init__(**kwargs) + self.name = None + self.content = None + self.tool_tip = None + self.scope = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippets_collection.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippets_collection.py new file mode 100644 index 000000000000..84129684df80 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippets_collection.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class PolicySnippetsCollection(Model): + """The response of the list policy snippets operation. + + :param value: Policy snippet value. + :type value: list[~azure.mgmt.apimanagement.models.PolicySnippetContract] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PolicySnippetContract]'}, + } + + def __init__(self, **kwargs): + super(PolicySnippetsCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippets_collection_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippets_collection_py3.py new file mode 100644 index 000000000000..0744acea8038 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_snippets_collection_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class PolicySnippetsCollection(Model): + """The response of the list policy snippets operation. + + :param value: Policy snippet value. + :type value: list[~azure.mgmt.apimanagement.models.PolicySnippetContract] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PolicySnippetContract]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(PolicySnippetsCollection, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_delegation_settings.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_delegation_settings.py new file mode 100644 index 000000000000..12afb1d73450 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_delegation_settings.py @@ -0,0 +1,61 @@ +# 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 .resource import Resource + + +class PortalDelegationSettings(Resource): + """Delegation settings for a developer portal. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param url: A delegation Url. + :type url: str + :param validation_key: A base64-encoded validation key to validate, that a + request is coming from Azure API Management. + :type validation_key: str + :param subscriptions: Subscriptions delegation settings. + :type subscriptions: + ~azure.mgmt.apimanagement.models.SubscriptionsDelegationSettingsProperties + :param user_registration: User registration delegation settings. + :type user_registration: + ~azure.mgmt.apimanagement.models.RegistrationDelegationSettingsProperties + """ + + _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'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'validation_key': {'key': 'properties.validationKey', 'type': 'str'}, + 'subscriptions': {'key': 'properties.subscriptions', 'type': 'SubscriptionsDelegationSettingsProperties'}, + 'user_registration': {'key': 'properties.userRegistration', 'type': 'RegistrationDelegationSettingsProperties'}, + } + + def __init__(self, **kwargs): + super(PortalDelegationSettings, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + self.validation_key = kwargs.get('validation_key', None) + self.subscriptions = kwargs.get('subscriptions', None) + self.user_registration = kwargs.get('user_registration', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_delegation_settings_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_delegation_settings_py3.py new file mode 100644 index 000000000000..fd155ae3833a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_delegation_settings_py3.py @@ -0,0 +1,61 @@ +# 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 .resource import Resource + + +class PortalDelegationSettings(Resource): + """Delegation settings for a developer portal. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param url: A delegation Url. + :type url: str + :param validation_key: A base64-encoded validation key to validate, that a + request is coming from Azure API Management. + :type validation_key: str + :param subscriptions: Subscriptions delegation settings. + :type subscriptions: + ~azure.mgmt.apimanagement.models.SubscriptionsDelegationSettingsProperties + :param user_registration: User registration delegation settings. + :type user_registration: + ~azure.mgmt.apimanagement.models.RegistrationDelegationSettingsProperties + """ + + _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'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'validation_key': {'key': 'properties.validationKey', 'type': 'str'}, + 'subscriptions': {'key': 'properties.subscriptions', 'type': 'SubscriptionsDelegationSettingsProperties'}, + 'user_registration': {'key': 'properties.userRegistration', 'type': 'RegistrationDelegationSettingsProperties'}, + } + + def __init__(self, *, url: str=None, validation_key: str=None, subscriptions=None, user_registration=None, **kwargs) -> None: + super(PortalDelegationSettings, self).__init__(, **kwargs) + self.url = url + self.validation_key = validation_key + self.subscriptions = subscriptions + self.user_registration = user_registration diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signin_settings.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signin_settings.py new file mode 100644 index 000000000000..b8f376395a0e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signin_settings.py @@ -0,0 +1,46 @@ +# 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 .resource import Resource + + +class PortalSigninSettings(Resource): + """Sign-In settings for the Developer Portal. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param enabled: Redirect Anonymous users to the Sign-In page. + :type enabled: bool + """ + + _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'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PortalSigninSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signin_settings_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signin_settings_py3.py new file mode 100644 index 000000000000..14cf69f08394 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signin_settings_py3.py @@ -0,0 +1,46 @@ +# 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 .resource import Resource + + +class PortalSigninSettings(Resource): + """Sign-In settings for the Developer Portal. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param enabled: Redirect Anonymous users to the Sign-In page. + :type enabled: bool + """ + + _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'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(PortalSigninSettings, self).__init__(, **kwargs) + self.enabled = enabled diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signup_settings.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signup_settings.py new file mode 100644 index 000000000000..ed58574923bd --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signup_settings.py @@ -0,0 +1,51 @@ +# 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 .resource import Resource + + +class PortalSignupSettings(Resource): + """Sign-Up settings for a developer portal. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param enabled: Allow users to sign up on a developer portal. + :type enabled: bool + :param terms_of_service: Terms of service contract properties. + :type terms_of_service: + ~azure.mgmt.apimanagement.models.TermsOfServiceProperties + """ + + _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'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'terms_of_service': {'key': 'properties.termsOfService', 'type': 'TermsOfServiceProperties'}, + } + + def __init__(self, **kwargs): + super(PortalSignupSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.terms_of_service = kwargs.get('terms_of_service', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signup_settings_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signup_settings_py3.py new file mode 100644 index 000000000000..916e500667f9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/portal_signup_settings_py3.py @@ -0,0 +1,51 @@ +# 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 .resource import Resource + + +class PortalSignupSettings(Resource): + """Sign-Up settings for a developer portal. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param enabled: Allow users to sign up on a developer portal. + :type enabled: bool + :param terms_of_service: Terms of service contract properties. + :type terms_of_service: + ~azure.mgmt.apimanagement.models.TermsOfServiceProperties + """ + + _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'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'terms_of_service': {'key': 'properties.termsOfService', 'type': 'TermsOfServiceProperties'}, + } + + def __init__(self, *, enabled: bool=None, terms_of_service=None, **kwargs) -> None: + super(PortalSignupSettings, self).__init__(, **kwargs) + self.enabled = enabled + self.terms_of_service = terms_of_service diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_contract.py new file mode 100644 index 000000000000..82bde48700b9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_contract.py @@ -0,0 +1,93 @@ +# 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 .resource import Resource + + +class ProductContract(Resource): + """Product details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param description: Product description. May include HTML formatting tags. + :type description: str + :param terms: Product terms of use. Developers trying to subscribe to the + product will be presented and required to accept these terms before they + can complete the subscription process. + :type terms: str + :param subscription_required: Whether a product subscription is required + for accessing APIs included in this product. If true, the product is + referred to as "protected" and a valid subscription key is required for a + request to an API included in the product to succeed. If false, the + product is referred to as "open" and requests to an API included in the + product can be made without a subscription key. If property is omitted + when creating a new product it's value is assumed to be true. + :type subscription_required: bool + :param approval_required: whether subscription approval is required. If + false, new subscriptions will be approved automatically enabling + developers to call the product’s APIs immediately after subscribing. If + true, administrators must manually approve the subscription before the + developer can any of the product’s APIs. Can be present only if + subscriptionRequired property is present and has a value of false. + :type approval_required: bool + :param subscriptions_limit: Whether the number of subscriptions a user can + have to this product at the same time. Set to null or omit to allow + unlimited per user subscriptions. Can be present only if + subscriptionRequired property is present and has a value of false. + :type subscriptions_limit: int + :param state: whether product is published or not. Published products are + discoverable by users of developer portal. Non published products are + visible only to administrators. Default state of Product is notPublished. + Possible values include: 'notPublished', 'published' + :type state: str or ~azure.mgmt.apimanagement.models.ProductState + :param display_name: Required. Product name. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'max_length': 1000, 'min_length': 1}, + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'terms': {'key': 'properties.terms', 'type': 'str'}, + 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'approval_required': {'key': 'properties.approvalRequired', 'type': 'bool'}, + 'subscriptions_limit': {'key': 'properties.subscriptionsLimit', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'ProductState'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.terms = kwargs.get('terms', None) + self.subscription_required = kwargs.get('subscription_required', None) + self.approval_required = kwargs.get('approval_required', None) + self.subscriptions_limit = kwargs.get('subscriptions_limit', None) + self.state = kwargs.get('state', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_contract_paged.py new file mode 100644 index 000000000000..ed575a6564cb --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_contract_paged.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 msrest.paging import Paged + + +class ProductContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`ProductContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ProductContract]'} + } + + def __init__(self, *args, **kwargs): + + super(ProductContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_contract_py3.py new file mode 100644 index 000000000000..7234b3836868 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_contract_py3.py @@ -0,0 +1,93 @@ +# 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 .resource import Resource + + +class ProductContract(Resource): + """Product details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param description: Product description. May include HTML formatting tags. + :type description: str + :param terms: Product terms of use. Developers trying to subscribe to the + product will be presented and required to accept these terms before they + can complete the subscription process. + :type terms: str + :param subscription_required: Whether a product subscription is required + for accessing APIs included in this product. If true, the product is + referred to as "protected" and a valid subscription key is required for a + request to an API included in the product to succeed. If false, the + product is referred to as "open" and requests to an API included in the + product can be made without a subscription key. If property is omitted + when creating a new product it's value is assumed to be true. + :type subscription_required: bool + :param approval_required: whether subscription approval is required. If + false, new subscriptions will be approved automatically enabling + developers to call the product’s APIs immediately after subscribing. If + true, administrators must manually approve the subscription before the + developer can any of the product’s APIs. Can be present only if + subscriptionRequired property is present and has a value of false. + :type approval_required: bool + :param subscriptions_limit: Whether the number of subscriptions a user can + have to this product at the same time. Set to null or omit to allow + unlimited per user subscriptions. Can be present only if + subscriptionRequired property is present and has a value of false. + :type subscriptions_limit: int + :param state: whether product is published or not. Published products are + discoverable by users of developer portal. Non published products are + visible only to administrators. Default state of Product is notPublished. + Possible values include: 'notPublished', 'published' + :type state: str or ~azure.mgmt.apimanagement.models.ProductState + :param display_name: Required. Product name. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'max_length': 1000, 'min_length': 1}, + 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'terms': {'key': 'properties.terms', 'type': 'str'}, + 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'approval_required': {'key': 'properties.approvalRequired', 'type': 'bool'}, + 'subscriptions_limit': {'key': 'properties.subscriptionsLimit', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'ProductState'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, description: str=None, terms: str=None, subscription_required: bool=None, approval_required: bool=None, subscriptions_limit: int=None, state=None, **kwargs) -> None: + super(ProductContract, self).__init__(, **kwargs) + self.description = description + self.terms = terms + self.subscription_required = subscription_required + self.approval_required = approval_required + self.subscriptions_limit = subscriptions_limit + self.state = state + self.display_name = display_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_entity_base_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_entity_base_parameters.py new file mode 100644 index 000000000000..25ab8d74a8c1 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_entity_base_parameters.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 msrest.serialization import Model + + +class ProductEntityBaseParameters(Model): + """Product Entity Base Parameters. + + :param description: Product description. May include HTML formatting tags. + :type description: str + :param terms: Product terms of use. Developers trying to subscribe to the + product will be presented and required to accept these terms before they + can complete the subscription process. + :type terms: str + :param subscription_required: Whether a product subscription is required + for accessing APIs included in this product. If true, the product is + referred to as "protected" and a valid subscription key is required for a + request to an API included in the product to succeed. If false, the + product is referred to as "open" and requests to an API included in the + product can be made without a subscription key. If property is omitted + when creating a new product it's value is assumed to be true. + :type subscription_required: bool + :param approval_required: whether subscription approval is required. If + false, new subscriptions will be approved automatically enabling + developers to call the product’s APIs immediately after subscribing. If + true, administrators must manually approve the subscription before the + developer can any of the product’s APIs. Can be present only if + subscriptionRequired property is present and has a value of false. + :type approval_required: bool + :param subscriptions_limit: Whether the number of subscriptions a user can + have to this product at the same time. Set to null or omit to allow + unlimited per user subscriptions. Can be present only if + subscriptionRequired property is present and has a value of false. + :type subscriptions_limit: int + :param state: whether product is published or not. Published products are + discoverable by users of developer portal. Non published products are + visible only to administrators. Default state of Product is notPublished. + Possible values include: 'notPublished', 'published' + :type state: str or ~azure.mgmt.apimanagement.models.ProductState + """ + + _validation = { + 'description': {'max_length': 1000, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'terms': {'key': 'terms', 'type': 'str'}, + 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'approval_required': {'key': 'approvalRequired', 'type': 'bool'}, + 'subscriptions_limit': {'key': 'subscriptionsLimit', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'ProductState'}, + } + + def __init__(self, **kwargs): + super(ProductEntityBaseParameters, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.terms = kwargs.get('terms', None) + self.subscription_required = kwargs.get('subscription_required', None) + self.approval_required = kwargs.get('approval_required', None) + self.subscriptions_limit = kwargs.get('subscriptions_limit', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_entity_base_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_entity_base_parameters_py3.py new file mode 100644 index 000000000000..df6476ffa2cd --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_entity_base_parameters_py3.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 msrest.serialization import Model + + +class ProductEntityBaseParameters(Model): + """Product Entity Base Parameters. + + :param description: Product description. May include HTML formatting tags. + :type description: str + :param terms: Product terms of use. Developers trying to subscribe to the + product will be presented and required to accept these terms before they + can complete the subscription process. + :type terms: str + :param subscription_required: Whether a product subscription is required + for accessing APIs included in this product. If true, the product is + referred to as "protected" and a valid subscription key is required for a + request to an API included in the product to succeed. If false, the + product is referred to as "open" and requests to an API included in the + product can be made without a subscription key. If property is omitted + when creating a new product it's value is assumed to be true. + :type subscription_required: bool + :param approval_required: whether subscription approval is required. If + false, new subscriptions will be approved automatically enabling + developers to call the product’s APIs immediately after subscribing. If + true, administrators must manually approve the subscription before the + developer can any of the product’s APIs. Can be present only if + subscriptionRequired property is present and has a value of false. + :type approval_required: bool + :param subscriptions_limit: Whether the number of subscriptions a user can + have to this product at the same time. Set to null or omit to allow + unlimited per user subscriptions. Can be present only if + subscriptionRequired property is present and has a value of false. + :type subscriptions_limit: int + :param state: whether product is published or not. Published products are + discoverable by users of developer portal. Non published products are + visible only to administrators. Default state of Product is notPublished. + Possible values include: 'notPublished', 'published' + :type state: str or ~azure.mgmt.apimanagement.models.ProductState + """ + + _validation = { + 'description': {'max_length': 1000, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'terms': {'key': 'terms', 'type': 'str'}, + 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'approval_required': {'key': 'approvalRequired', 'type': 'bool'}, + 'subscriptions_limit': {'key': 'subscriptionsLimit', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'ProductState'}, + } + + def __init__(self, *, description: str=None, terms: str=None, subscription_required: bool=None, approval_required: bool=None, subscriptions_limit: int=None, state=None, **kwargs) -> None: + super(ProductEntityBaseParameters, self).__init__(**kwargs) + self.description = description + self.terms = terms + self.subscription_required = subscription_required + self.approval_required = approval_required + self.subscriptions_limit = subscriptions_limit + self.state = state diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_tag_resource_contract_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_tag_resource_contract_properties.py new file mode 100644 index 000000000000..ee62ee30fd43 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_tag_resource_contract_properties.py @@ -0,0 +1,76 @@ +# 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 .product_entity_base_parameters import ProductEntityBaseParameters + + +class ProductTagResourceContractProperties(ProductEntityBaseParameters): + """Product profile. + + All required parameters must be populated in order to send to Azure. + + :param description: Product description. May include HTML formatting tags. + :type description: str + :param terms: Product terms of use. Developers trying to subscribe to the + product will be presented and required to accept these terms before they + can complete the subscription process. + :type terms: str + :param subscription_required: Whether a product subscription is required + for accessing APIs included in this product. If true, the product is + referred to as "protected" and a valid subscription key is required for a + request to an API included in the product to succeed. If false, the + product is referred to as "open" and requests to an API included in the + product can be made without a subscription key. If property is omitted + when creating a new product it's value is assumed to be true. + :type subscription_required: bool + :param approval_required: whether subscription approval is required. If + false, new subscriptions will be approved automatically enabling + developers to call the product’s APIs immediately after subscribing. If + true, administrators must manually approve the subscription before the + developer can any of the product’s APIs. Can be present only if + subscriptionRequired property is present and has a value of false. + :type approval_required: bool + :param subscriptions_limit: Whether the number of subscriptions a user can + have to this product at the same time. Set to null or omit to allow + unlimited per user subscriptions. Can be present only if + subscriptionRequired property is present and has a value of false. + :type subscriptions_limit: int + :param state: whether product is published or not. Published products are + discoverable by users of developer portal. Non published products are + visible only to administrators. Default state of Product is notPublished. + Possible values include: 'notPublished', 'published' + :type state: str or ~azure.mgmt.apimanagement.models.ProductState + :param id: Identifier of the product in the form of /products/{productId} + :type id: str + :param name: Required. Product name. + :type name: str + """ + + _validation = { + 'description': {'max_length': 1000, 'min_length': 1}, + 'name': {'required': True, 'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'terms': {'key': 'terms', 'type': 'str'}, + 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'approval_required': {'key': 'approvalRequired', 'type': 'bool'}, + 'subscriptions_limit': {'key': 'subscriptionsLimit', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'ProductState'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductTagResourceContractProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_tag_resource_contract_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_tag_resource_contract_properties_py3.py new file mode 100644 index 000000000000..16fbd3bf17d4 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_tag_resource_contract_properties_py3.py @@ -0,0 +1,76 @@ +# 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 .product_entity_base_parameters import ProductEntityBaseParameters + + +class ProductTagResourceContractProperties(ProductEntityBaseParameters): + """Product profile. + + All required parameters must be populated in order to send to Azure. + + :param description: Product description. May include HTML formatting tags. + :type description: str + :param terms: Product terms of use. Developers trying to subscribe to the + product will be presented and required to accept these terms before they + can complete the subscription process. + :type terms: str + :param subscription_required: Whether a product subscription is required + for accessing APIs included in this product. If true, the product is + referred to as "protected" and a valid subscription key is required for a + request to an API included in the product to succeed. If false, the + product is referred to as "open" and requests to an API included in the + product can be made without a subscription key. If property is omitted + when creating a new product it's value is assumed to be true. + :type subscription_required: bool + :param approval_required: whether subscription approval is required. If + false, new subscriptions will be approved automatically enabling + developers to call the product’s APIs immediately after subscribing. If + true, administrators must manually approve the subscription before the + developer can any of the product’s APIs. Can be present only if + subscriptionRequired property is present and has a value of false. + :type approval_required: bool + :param subscriptions_limit: Whether the number of subscriptions a user can + have to this product at the same time. Set to null or omit to allow + unlimited per user subscriptions. Can be present only if + subscriptionRequired property is present and has a value of false. + :type subscriptions_limit: int + :param state: whether product is published or not. Published products are + discoverable by users of developer portal. Non published products are + visible only to administrators. Default state of Product is notPublished. + Possible values include: 'notPublished', 'published' + :type state: str or ~azure.mgmt.apimanagement.models.ProductState + :param id: Identifier of the product in the form of /products/{productId} + :type id: str + :param name: Required. Product name. + :type name: str + """ + + _validation = { + 'description': {'max_length': 1000, 'min_length': 1}, + 'name': {'required': True, 'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'terms': {'key': 'terms', 'type': 'str'}, + 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'approval_required': {'key': 'approvalRequired', 'type': 'bool'}, + 'subscriptions_limit': {'key': 'subscriptionsLimit', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'ProductState'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, description: str=None, terms: str=None, subscription_required: bool=None, approval_required: bool=None, subscriptions_limit: int=None, state=None, id: str=None, **kwargs) -> None: + super(ProductTagResourceContractProperties, self).__init__(description=description, terms=terms, subscription_required=subscription_required, approval_required=approval_required, subscriptions_limit=subscriptions_limit, state=state, **kwargs) + self.id = id + self.name = name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_update_parameters.py new file mode 100644 index 000000000000..3d71fde94ca9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_update_parameters.py @@ -0,0 +1,76 @@ +# 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 msrest.serialization import Model + + +class ProductUpdateParameters(Model): + """Product Update parameters. + + :param description: Product description. May include HTML formatting tags. + :type description: str + :param terms: Product terms of use. Developers trying to subscribe to the + product will be presented and required to accept these terms before they + can complete the subscription process. + :type terms: str + :param subscription_required: Whether a product subscription is required + for accessing APIs included in this product. If true, the product is + referred to as "protected" and a valid subscription key is required for a + request to an API included in the product to succeed. If false, the + product is referred to as "open" and requests to an API included in the + product can be made without a subscription key. If property is omitted + when creating a new product it's value is assumed to be true. + :type subscription_required: bool + :param approval_required: whether subscription approval is required. If + false, new subscriptions will be approved automatically enabling + developers to call the product’s APIs immediately after subscribing. If + true, administrators must manually approve the subscription before the + developer can any of the product’s APIs. Can be present only if + subscriptionRequired property is present and has a value of false. + :type approval_required: bool + :param subscriptions_limit: Whether the number of subscriptions a user can + have to this product at the same time. Set to null or omit to allow + unlimited per user subscriptions. Can be present only if + subscriptionRequired property is present and has a value of false. + :type subscriptions_limit: int + :param state: whether product is published or not. Published products are + discoverable by users of developer portal. Non published products are + visible only to administrators. Default state of Product is notPublished. + Possible values include: 'notPublished', 'published' + :type state: str or ~azure.mgmt.apimanagement.models.ProductState + :param display_name: Product name. + :type display_name: str + """ + + _validation = { + 'description': {'max_length': 1000, 'min_length': 1}, + 'display_name': {'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'terms': {'key': 'properties.terms', 'type': 'str'}, + 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'approval_required': {'key': 'properties.approvalRequired', 'type': 'bool'}, + 'subscriptions_limit': {'key': 'properties.subscriptionsLimit', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'ProductState'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductUpdateParameters, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.terms = kwargs.get('terms', None) + self.subscription_required = kwargs.get('subscription_required', None) + self.approval_required = kwargs.get('approval_required', None) + self.subscriptions_limit = kwargs.get('subscriptions_limit', None) + self.state = kwargs.get('state', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_update_parameters_py3.py new file mode 100644 index 000000000000..76d097f2f94c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/product_update_parameters_py3.py @@ -0,0 +1,76 @@ +# 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 msrest.serialization import Model + + +class ProductUpdateParameters(Model): + """Product Update parameters. + + :param description: Product description. May include HTML formatting tags. + :type description: str + :param terms: Product terms of use. Developers trying to subscribe to the + product will be presented and required to accept these terms before they + can complete the subscription process. + :type terms: str + :param subscription_required: Whether a product subscription is required + for accessing APIs included in this product. If true, the product is + referred to as "protected" and a valid subscription key is required for a + request to an API included in the product to succeed. If false, the + product is referred to as "open" and requests to an API included in the + product can be made without a subscription key. If property is omitted + when creating a new product it's value is assumed to be true. + :type subscription_required: bool + :param approval_required: whether subscription approval is required. If + false, new subscriptions will be approved automatically enabling + developers to call the product’s APIs immediately after subscribing. If + true, administrators must manually approve the subscription before the + developer can any of the product’s APIs. Can be present only if + subscriptionRequired property is present and has a value of false. + :type approval_required: bool + :param subscriptions_limit: Whether the number of subscriptions a user can + have to this product at the same time. Set to null or omit to allow + unlimited per user subscriptions. Can be present only if + subscriptionRequired property is present and has a value of false. + :type subscriptions_limit: int + :param state: whether product is published or not. Published products are + discoverable by users of developer portal. Non published products are + visible only to administrators. Default state of Product is notPublished. + Possible values include: 'notPublished', 'published' + :type state: str or ~azure.mgmt.apimanagement.models.ProductState + :param display_name: Product name. + :type display_name: str + """ + + _validation = { + 'description': {'max_length': 1000, 'min_length': 1}, + 'display_name': {'max_length': 300, 'min_length': 1}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'terms': {'key': 'properties.terms', 'type': 'str'}, + 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'approval_required': {'key': 'properties.approvalRequired', 'type': 'bool'}, + 'subscriptions_limit': {'key': 'properties.subscriptionsLimit', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'ProductState'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, terms: str=None, subscription_required: bool=None, approval_required: bool=None, subscriptions_limit: int=None, state=None, display_name: str=None, **kwargs) -> None: + super(ProductUpdateParameters, self).__init__(**kwargs) + self.description = description + self.terms = terms + self.subscription_required = subscription_required + self.approval_required = approval_required + self.subscriptions_limit = subscriptions_limit + self.state = state + self.display_name = display_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_contract.py new file mode 100644 index 000000000000..aed61008da89 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_contract.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 .resource import Resource + + +class PropertyContract(Resource): + """Property details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param tags: Optional tags that when provided can be used to filter the + property list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + :param display_name: Required. Unique name of Property. It may contain + only letters, digits, period, dash, and underscore characters. + :type display_name: str + :param value: Required. Value of the property. Can contain policy + expressions. It may not be empty or consist only of whitespace. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'max_items': 32}, + 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'value': {'required': True, 'max_length': 4096, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'secret': {'key': 'properties.secret', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PropertyContract, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.secret = kwargs.get('secret', None) + self.display_name = kwargs.get('display_name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_contract_paged.py new file mode 100644 index 000000000000..da50c40cf02a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_contract_paged.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 msrest.paging import Paged + + +class PropertyContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`PropertyContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PropertyContract]'} + } + + def __init__(self, *args, **kwargs): + + super(PropertyContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_contract_py3.py new file mode 100644 index 000000000000..2e60eb7ebcd0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_contract_py3.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 .resource import Resource + + +class PropertyContract(Resource): + """Property details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param tags: Optional tags that when provided can be used to filter the + property list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + :param display_name: Required. Unique name of Property. It may contain + only letters, digits, period, dash, and underscore characters. + :type display_name: str + :param value: Required. Value of the property. Can contain policy + expressions. It may not be empty or consist only of whitespace. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'max_items': 32}, + 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'value': {'required': True, 'max_length': 4096, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'secret': {'key': 'properties.secret', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, value: str, tags=None, secret: bool=None, **kwargs) -> None: + super(PropertyContract, self).__init__(, **kwargs) + self.tags = tags + self.secret = secret + self.display_name = display_name + self.value = value diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_entity_base_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_entity_base_parameters.py new file mode 100644 index 000000000000..7666d3463f19 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_entity_base_parameters.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class PropertyEntityBaseParameters(Model): + """Property Entity Base Parameters set. + + :param tags: Optional tags that when provided can be used to filter the + property list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + """ + + _validation = { + 'tags': {'max_items': 32}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '[str]'}, + 'secret': {'key': 'secret', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PropertyEntityBaseParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.secret = kwargs.get('secret', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_entity_base_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_entity_base_parameters_py3.py new file mode 100644 index 000000000000..e01077848439 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_entity_base_parameters_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class PropertyEntityBaseParameters(Model): + """Property Entity Base Parameters set. + + :param tags: Optional tags that when provided can be used to filter the + property list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + """ + + _validation = { + 'tags': {'max_items': 32}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '[str]'}, + 'secret': {'key': 'secret', 'type': 'bool'}, + } + + def __init__(self, *, tags=None, secret: bool=None, **kwargs) -> None: + super(PropertyEntityBaseParameters, self).__init__(**kwargs) + self.tags = tags + self.secret = secret diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_update_parameters.py new file mode 100644 index 000000000000..5a21c08aa09e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_update_parameters.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class PropertyUpdateParameters(Model): + """Property update Parameters. + + :param tags: Optional tags that when provided can be used to filter the + property list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + :param display_name: Unique name of Property. It may contain only letters, + digits, period, dash, and underscore characters. + :type display_name: str + :param value: Value of the property. Can contain policy expressions. It + may not be empty or consist only of whitespace. + :type value: str + """ + + _validation = { + 'tags': {'max_items': 32}, + 'display_name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'value': {'max_length': 4096, 'min_length': 1}, + } + + _attribute_map = { + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'secret': {'key': 'properties.secret', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PropertyUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.secret = kwargs.get('secret', None) + self.display_name = kwargs.get('display_name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_update_parameters_py3.py new file mode 100644 index 000000000000..18a8e255b6c4 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/property_update_parameters_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class PropertyUpdateParameters(Model): + """Property update Parameters. + + :param tags: Optional tags that when provided can be used to filter the + property list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + :param display_name: Unique name of Property. It may contain only letters, + digits, period, dash, and underscore characters. + :type display_name: str + :param value: Value of the property. Can contain policy expressions. It + may not be empty or consist only of whitespace. + :type value: str + """ + + _validation = { + 'tags': {'max_items': 32}, + 'display_name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'value': {'max_length': 4096, 'min_length': 1}, + } + + _attribute_map = { + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'secret': {'key': 'properties.secret', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__(self, *, tags=None, secret: bool=None, display_name: str=None, value: str=None, **kwargs) -> None: + super(PropertyUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.secret = secret + self.display_name = display_name + self.value = value diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_collection.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_collection.py new file mode 100644 index 000000000000..6785ba44e42a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_collection.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class QuotaCounterCollection(Model): + """Paged Quota Counter list representation. + + :param value: Quota counter values. + :type value: list[~azure.mgmt.apimanagement.models.QuotaCounterContract] + :param count: Total record count number across all pages. + :type count: long + :param next_link: Next page link if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaCounterContract]'}, + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuotaCounterCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_collection_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_collection_py3.py new file mode 100644 index 000000000000..498623ce8b55 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_collection_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class QuotaCounterCollection(Model): + """Paged Quota Counter list representation. + + :param value: Quota counter values. + :type value: list[~azure.mgmt.apimanagement.models.QuotaCounterContract] + :param count: Total record count number across all pages. + :type count: long + :param next_link: Next page link if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaCounterContract]'}, + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, count: int=None, next_link: str=None, **kwargs) -> None: + super(QuotaCounterCollection, self).__init__(**kwargs) + self.value = value + self.count = count + self.next_link = next_link diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_contract.py new file mode 100644 index 000000000000..ce05718d13f9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_contract.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class QuotaCounterContract(Model): + """Quota counter details. + + All required parameters must be populated in order to send to Azure. + + :param counter_key: Required. The Key value of the Counter. Must not be + empty. + :type counter_key: str + :param period_key: Required. Identifier of the Period for which the + counter was collected. Must not be empty. + :type period_key: str + :param period_start_time: Required. The date of the start of Counter + Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + as specified by the ISO 8601 standard. + :type period_start_time: datetime + :param period_end_time: Required. The date of the end of Counter Period. + The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + specified by the ISO 8601 standard. + :type period_end_time: datetime + :param value: Quota Value Properties + :type value: + ~azure.mgmt.apimanagement.models.QuotaCounterValueContractProperties + """ + + _validation = { + 'counter_key': {'required': True, 'min_length': 1}, + 'period_key': {'required': True, 'min_length': 1}, + 'period_start_time': {'required': True}, + 'period_end_time': {'required': True}, + } + + _attribute_map = { + 'counter_key': {'key': 'counterKey', 'type': 'str'}, + 'period_key': {'key': 'periodKey', 'type': 'str'}, + 'period_start_time': {'key': 'periodStartTime', 'type': 'iso-8601'}, + 'period_end_time': {'key': 'periodEndTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'QuotaCounterValueContractProperties'}, + } + + def __init__(self, **kwargs): + super(QuotaCounterContract, self).__init__(**kwargs) + self.counter_key = kwargs.get('counter_key', None) + self.period_key = kwargs.get('period_key', None) + self.period_start_time = kwargs.get('period_start_time', None) + self.period_end_time = kwargs.get('period_end_time', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_contract_py3.py new file mode 100644 index 000000000000..d3469173ad8b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_contract_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class QuotaCounterContract(Model): + """Quota counter details. + + All required parameters must be populated in order to send to Azure. + + :param counter_key: Required. The Key value of the Counter. Must not be + empty. + :type counter_key: str + :param period_key: Required. Identifier of the Period for which the + counter was collected. Must not be empty. + :type period_key: str + :param period_start_time: Required. The date of the start of Counter + Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + as specified by the ISO 8601 standard. + :type period_start_time: datetime + :param period_end_time: Required. The date of the end of Counter Period. + The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + specified by the ISO 8601 standard. + :type period_end_time: datetime + :param value: Quota Value Properties + :type value: + ~azure.mgmt.apimanagement.models.QuotaCounterValueContractProperties + """ + + _validation = { + 'counter_key': {'required': True, 'min_length': 1}, + 'period_key': {'required': True, 'min_length': 1}, + 'period_start_time': {'required': True}, + 'period_end_time': {'required': True}, + } + + _attribute_map = { + 'counter_key': {'key': 'counterKey', 'type': 'str'}, + 'period_key': {'key': 'periodKey', 'type': 'str'}, + 'period_start_time': {'key': 'periodStartTime', 'type': 'iso-8601'}, + 'period_end_time': {'key': 'periodEndTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'QuotaCounterValueContractProperties'}, + } + + def __init__(self, *, counter_key: str, period_key: str, period_start_time, period_end_time, value=None, **kwargs) -> None: + super(QuotaCounterContract, self).__init__(**kwargs) + self.counter_key = counter_key + self.period_key = period_key + self.period_start_time = period_start_time + self.period_end_time = period_end_time + self.value = value diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract.py new file mode 100644 index 000000000000..b09ad9d57dba --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class QuotaCounterValueContract(Model): + """Quota counter value details. + + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + """ + + _attribute_map = { + 'calls_count': {'key': 'value.callsCount', 'type': 'int'}, + 'kb_transferred': {'key': 'value.kbTransferred', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(QuotaCounterValueContract, self).__init__(**kwargs) + self.calls_count = kwargs.get('calls_count', None) + self.kb_transferred = kwargs.get('kb_transferred', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract_properties.py new file mode 100644 index 000000000000..f3109571e5a2 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract_properties.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class QuotaCounterValueContractProperties(Model): + """Quota counter value details. + + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + """ + + _attribute_map = { + 'calls_count': {'key': 'callsCount', 'type': 'int'}, + 'kb_transferred': {'key': 'kbTransferred', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(QuotaCounterValueContractProperties, self).__init__(**kwargs) + self.calls_count = kwargs.get('calls_count', None) + self.kb_transferred = kwargs.get('kb_transferred', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract_properties_py3.py new file mode 100644 index 000000000000..d425c680cab8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract_properties_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class QuotaCounterValueContractProperties(Model): + """Quota counter value details. + + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + """ + + _attribute_map = { + 'calls_count': {'key': 'callsCount', 'type': 'int'}, + 'kb_transferred': {'key': 'kbTransferred', 'type': 'float'}, + } + + def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwargs) -> None: + super(QuotaCounterValueContractProperties, self).__init__(**kwargs) + self.calls_count = calls_count + self.kb_transferred = kb_transferred diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract_py3.py new file mode 100644 index 000000000000..2a2d0b9216e9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/quota_counter_value_contract_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class QuotaCounterValueContract(Model): + """Quota counter value details. + + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + """ + + _attribute_map = { + 'calls_count': {'key': 'value.callsCount', 'type': 'int'}, + 'kb_transferred': {'key': 'value.kbTransferred', 'type': 'float'}, + } + + def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwargs) -> None: + super(QuotaCounterValueContract, self).__init__(**kwargs) + self.calls_count = calls_count + self.kb_transferred = kb_transferred diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_collection.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_collection.py new file mode 100644 index 000000000000..e56dbf2f3a19 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_collection.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class RecipientEmailCollection(Model): + """Paged Recipient User list representation. + + :param value: Page values. + :type value: list[~azure.mgmt.apimanagement.models.RecipientEmailContract] + :param next_link: Next page link if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RecipientEmailContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RecipientEmailCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_collection_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_collection_py3.py new file mode 100644 index 000000000000..20592d1ac7ce --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_collection_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class RecipientEmailCollection(Model): + """Paged Recipient User list representation. + + :param value: Page values. + :type value: list[~azure.mgmt.apimanagement.models.RecipientEmailContract] + :param next_link: Next page link if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RecipientEmailContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(RecipientEmailCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_contract.py new file mode 100644 index 000000000000..862e3f09c0f1 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_contract.py @@ -0,0 +1,46 @@ +# 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 .resource import Resource + + +class RecipientEmailContract(Resource): + """Recipient Email details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param email: User Email subscribed to notification. + :type email: 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'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RecipientEmailContract, self).__init__(**kwargs) + self.email = kwargs.get('email', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_contract_py3.py new file mode 100644 index 000000000000..aafd9c5572f0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_email_contract_py3.py @@ -0,0 +1,46 @@ +# 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 .resource import Resource + + +class RecipientEmailContract(Resource): + """Recipient Email details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param email: User Email subscribed to notification. + :type email: 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'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + } + + def __init__(self, *, email: str=None, **kwargs) -> None: + super(RecipientEmailContract, self).__init__(, **kwargs) + self.email = email diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_collection.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_collection.py new file mode 100644 index 000000000000..8555f416e541 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_collection.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class RecipientUserCollection(Model): + """Paged Recipient User list representation. + + :param value: Page values. + :type value: list[~azure.mgmt.apimanagement.models.RecipientUserContract] + :param next_link: Next page link if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RecipientUserContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RecipientUserCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_collection_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_collection_py3.py new file mode 100644 index 000000000000..1efa3a09c093 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_collection_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class RecipientUserCollection(Model): + """Paged Recipient User list representation. + + :param value: Page values. + :type value: list[~azure.mgmt.apimanagement.models.RecipientUserContract] + :param next_link: Next page link if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RecipientUserContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(RecipientUserCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_contract.py new file mode 100644 index 000000000000..d357cd431be5 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_contract.py @@ -0,0 +1,46 @@ +# 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 .resource import Resource + + +class RecipientUserContract(Resource): + """Recipient User details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param user_id: API Management UserId subscribed to notification. + :type user_id: 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'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RecipientUserContract, self).__init__(**kwargs) + self.user_id = kwargs.get('user_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_contract_py3.py new file mode 100644 index 000000000000..3e457976f76f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipient_user_contract_py3.py @@ -0,0 +1,46 @@ +# 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 .resource import Resource + + +class RecipientUserContract(Resource): + """Recipient User details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param user_id: API Management UserId subscribed to notification. + :type user_id: 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'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + } + + def __init__(self, *, user_id: str=None, **kwargs) -> None: + super(RecipientUserContract, self).__init__(, **kwargs) + self.user_id = user_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipients_contract_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipients_contract_properties.py new file mode 100644 index 000000000000..ec3457181ae8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipients_contract_properties.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class RecipientsContractProperties(Model): + """Notification Parameter contract. + + :param emails: List of Emails subscribed for the notification. + :type emails: list[str] + :param users: List of Users subscribed for the notification. + :type users: list[str] + """ + + _attribute_map = { + 'emails': {'key': 'emails', 'type': '[str]'}, + 'users': {'key': 'users', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(RecipientsContractProperties, self).__init__(**kwargs) + self.emails = kwargs.get('emails', None) + self.users = kwargs.get('users', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipients_contract_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipients_contract_properties_py3.py new file mode 100644 index 000000000000..4ee05780273d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/recipients_contract_properties_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class RecipientsContractProperties(Model): + """Notification Parameter contract. + + :param emails: List of Emails subscribed for the notification. + :type emails: list[str] + :param users: List of Users subscribed for the notification. + :type users: list[str] + """ + + _attribute_map = { + 'emails': {'key': 'emails', 'type': '[str]'}, + 'users': {'key': 'users', 'type': '[str]'}, + } + + def __init__(self, *, emails=None, users=None, **kwargs) -> None: + super(RecipientsContractProperties, self).__init__(**kwargs) + self.emails = emails + self.users = users diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/region_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/region_contract.py new file mode 100644 index 000000000000..b45ef72db4c0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/region_contract.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class RegionContract(Model): + """Region profile. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Region name. + :vartype name: str + :param is_master_region: whether Region is the master region. + :type is_master_region: bool + :param is_deleted: whether Region is deleted. + :type is_deleted: bool + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_master_region': {'key': 'isMasterRegion', 'type': 'bool'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(RegionContract, self).__init__(**kwargs) + self.name = None + self.is_master_region = kwargs.get('is_master_region', None) + self.is_deleted = kwargs.get('is_deleted', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/region_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/region_contract_paged.py new file mode 100644 index 000000000000..d2d31024ffdd --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/region_contract_paged.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 msrest.paging import Paged + + +class RegionContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`RegionContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RegionContract]'} + } + + def __init__(self, *args, **kwargs): + + super(RegionContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/region_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/region_contract_py3.py new file mode 100644 index 000000000000..6818fd3baca6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/region_contract_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class RegionContract(Model): + """Region profile. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Region name. + :vartype name: str + :param is_master_region: whether Region is the master region. + :type is_master_region: bool + :param is_deleted: whether Region is deleted. + :type is_deleted: bool + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_master_region': {'key': 'isMasterRegion', 'type': 'bool'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + } + + def __init__(self, *, is_master_region: bool=None, is_deleted: bool=None, **kwargs) -> None: + super(RegionContract, self).__init__(**kwargs) + self.name = None + self.is_master_region = is_master_region + self.is_deleted = is_deleted diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/registration_delegation_settings_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/registration_delegation_settings_properties.py new file mode 100644 index 000000000000..d104cb341470 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/registration_delegation_settings_properties.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class RegistrationDelegationSettingsProperties(Model): + """User registration delegation settings properties. + + :param enabled: Enable or disable delegation for user registration. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(RegistrationDelegationSettingsProperties, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/registration_delegation_settings_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/registration_delegation_settings_properties_py3.py new file mode 100644 index 000000000000..26b410a0720b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/registration_delegation_settings_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class RegistrationDelegationSettingsProperties(Model): + """User registration delegation settings properties. + + :param enabled: Enable or disable delegation for user registration. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(RegistrationDelegationSettingsProperties, self).__init__(**kwargs) + self.enabled = enabled diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/report_record_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/report_record_contract.py new file mode 100644 index 000000000000..6ed8bca51d0c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/report_record_contract.py @@ -0,0 +1,153 @@ +# 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 msrest.serialization import Model + + +class ReportRecordContract(Model): + """Report data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Name depending on report endpoint specifies product, API, + operation or developer name. + :type name: str + :param timestamp: Start of aggregation period. The date conforms to the + following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :type timestamp: datetime + :param interval: Length of agregation period. Interval must be multiple + of 15 minutes and may not be zero. The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations). + :type interval: str + :param country: Country to which this record data is related. + :type country: str + :param region: Country region to which this record data is related. + :type region: str + :param zip: Zip code to which this record data is related. + :type zip: str + :ivar user_id: User identifier path. /users/{userId} + :vartype user_id: str + :ivar product_id: Product identifier path. /products/{productId} + :vartype product_id: str + :param api_id: API identifier path. /apis/{apiId} + :type api_id: str + :param operation_id: Operation identifier path. + /apis/{apiId}/operations/{operationId} + :type operation_id: str + :param api_region: API region identifier. + :type api_region: str + :param subscription_id: Subscription identifier path. + /subscriptions/{subscriptionId} + :type subscription_id: str + :param call_count_success: Number of succesful calls. This includes calls + returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and + HttpStatusCode.TemporaryRedirect + :type call_count_success: int + :param call_count_blocked: Number of calls blocked due to invalid + credentials. This includes calls returning HttpStatusCode.Unauthorize and + HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests + :type call_count_blocked: int + :param call_count_failed: Number of calls failed due to proxy or backend + errors. This includes calls returning HttpStatusCode.BadRequest(400) and + any Code between HttpStatusCode.InternalServerError (500) and 600 + :type call_count_failed: int + :param call_count_other: Number of other calls. + :type call_count_other: int + :param call_count_total: Total number of calls. + :type call_count_total: int + :param bandwidth: Bandwidth consumed. + :type bandwidth: long + :param cache_hit_count: Number of times when content was served from cache + policy. + :type cache_hit_count: int + :param cache_miss_count: Number of times content was fetched from backend. + :type cache_miss_count: int + :param api_time_avg: Average time it took to process request. + :type api_time_avg: float + :param api_time_min: Minimum time it took to process request. + :type api_time_min: float + :param api_time_max: Maximum time it took to process request. + :type api_time_max: float + :param service_time_avg: Average time it took to process request on + backend. + :type service_time_avg: float + :param service_time_min: Minimum time it took to process request on + backend. + :type service_time_min: float + :param service_time_max: Maximum time it took to process request on + backend. + :type service_time_max: float + """ + + _validation = { + 'user_id': {'readonly': True}, + 'product_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'interval': {'key': 'interval', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'zip': {'key': 'zip', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'api_id': {'key': 'apiId', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'api_region': {'key': 'apiRegion', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'call_count_success': {'key': 'callCountSuccess', 'type': 'int'}, + 'call_count_blocked': {'key': 'callCountBlocked', 'type': 'int'}, + 'call_count_failed': {'key': 'callCountFailed', 'type': 'int'}, + 'call_count_other': {'key': 'callCountOther', 'type': 'int'}, + 'call_count_total': {'key': 'callCountTotal', 'type': 'int'}, + 'bandwidth': {'key': 'bandwidth', 'type': 'long'}, + 'cache_hit_count': {'key': 'cacheHitCount', 'type': 'int'}, + 'cache_miss_count': {'key': 'cacheMissCount', 'type': 'int'}, + 'api_time_avg': {'key': 'apiTimeAvg', 'type': 'float'}, + 'api_time_min': {'key': 'apiTimeMin', 'type': 'float'}, + 'api_time_max': {'key': 'apiTimeMax', 'type': 'float'}, + 'service_time_avg': {'key': 'serviceTimeAvg', 'type': 'float'}, + 'service_time_min': {'key': 'serviceTimeMin', 'type': 'float'}, + 'service_time_max': {'key': 'serviceTimeMax', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ReportRecordContract, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.timestamp = kwargs.get('timestamp', None) + self.interval = kwargs.get('interval', None) + self.country = kwargs.get('country', None) + self.region = kwargs.get('region', None) + self.zip = kwargs.get('zip', None) + self.user_id = None + self.product_id = None + self.api_id = kwargs.get('api_id', None) + self.operation_id = kwargs.get('operation_id', None) + self.api_region = kwargs.get('api_region', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.call_count_success = kwargs.get('call_count_success', None) + self.call_count_blocked = kwargs.get('call_count_blocked', None) + self.call_count_failed = kwargs.get('call_count_failed', None) + self.call_count_other = kwargs.get('call_count_other', None) + self.call_count_total = kwargs.get('call_count_total', None) + self.bandwidth = kwargs.get('bandwidth', None) + self.cache_hit_count = kwargs.get('cache_hit_count', None) + self.cache_miss_count = kwargs.get('cache_miss_count', None) + self.api_time_avg = kwargs.get('api_time_avg', None) + self.api_time_min = kwargs.get('api_time_min', None) + self.api_time_max = kwargs.get('api_time_max', None) + self.service_time_avg = kwargs.get('service_time_avg', None) + self.service_time_min = kwargs.get('service_time_min', None) + self.service_time_max = kwargs.get('service_time_max', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/report_record_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/report_record_contract_paged.py new file mode 100644 index 000000000000..94a23d6b3fd8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/report_record_contract_paged.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 msrest.paging import Paged + + +class ReportRecordContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`ReportRecordContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ReportRecordContract]'} + } + + def __init__(self, *args, **kwargs): + + super(ReportRecordContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/report_record_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/report_record_contract_py3.py new file mode 100644 index 000000000000..7d28515dcfa4 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/report_record_contract_py3.py @@ -0,0 +1,153 @@ +# 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 msrest.serialization import Model + + +class ReportRecordContract(Model): + """Report data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Name depending on report endpoint specifies product, API, + operation or developer name. + :type name: str + :param timestamp: Start of aggregation period. The date conforms to the + following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :type timestamp: datetime + :param interval: Length of agregation period. Interval must be multiple + of 15 minutes and may not be zero. The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations). + :type interval: str + :param country: Country to which this record data is related. + :type country: str + :param region: Country region to which this record data is related. + :type region: str + :param zip: Zip code to which this record data is related. + :type zip: str + :ivar user_id: User identifier path. /users/{userId} + :vartype user_id: str + :ivar product_id: Product identifier path. /products/{productId} + :vartype product_id: str + :param api_id: API identifier path. /apis/{apiId} + :type api_id: str + :param operation_id: Operation identifier path. + /apis/{apiId}/operations/{operationId} + :type operation_id: str + :param api_region: API region identifier. + :type api_region: str + :param subscription_id: Subscription identifier path. + /subscriptions/{subscriptionId} + :type subscription_id: str + :param call_count_success: Number of succesful calls. This includes calls + returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and + HttpStatusCode.TemporaryRedirect + :type call_count_success: int + :param call_count_blocked: Number of calls blocked due to invalid + credentials. This includes calls returning HttpStatusCode.Unauthorize and + HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests + :type call_count_blocked: int + :param call_count_failed: Number of calls failed due to proxy or backend + errors. This includes calls returning HttpStatusCode.BadRequest(400) and + any Code between HttpStatusCode.InternalServerError (500) and 600 + :type call_count_failed: int + :param call_count_other: Number of other calls. + :type call_count_other: int + :param call_count_total: Total number of calls. + :type call_count_total: int + :param bandwidth: Bandwidth consumed. + :type bandwidth: long + :param cache_hit_count: Number of times when content was served from cache + policy. + :type cache_hit_count: int + :param cache_miss_count: Number of times content was fetched from backend. + :type cache_miss_count: int + :param api_time_avg: Average time it took to process request. + :type api_time_avg: float + :param api_time_min: Minimum time it took to process request. + :type api_time_min: float + :param api_time_max: Maximum time it took to process request. + :type api_time_max: float + :param service_time_avg: Average time it took to process request on + backend. + :type service_time_avg: float + :param service_time_min: Minimum time it took to process request on + backend. + :type service_time_min: float + :param service_time_max: Maximum time it took to process request on + backend. + :type service_time_max: float + """ + + _validation = { + 'user_id': {'readonly': True}, + 'product_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'interval': {'key': 'interval', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'zip': {'key': 'zip', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'api_id': {'key': 'apiId', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'api_region': {'key': 'apiRegion', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'call_count_success': {'key': 'callCountSuccess', 'type': 'int'}, + 'call_count_blocked': {'key': 'callCountBlocked', 'type': 'int'}, + 'call_count_failed': {'key': 'callCountFailed', 'type': 'int'}, + 'call_count_other': {'key': 'callCountOther', 'type': 'int'}, + 'call_count_total': {'key': 'callCountTotal', 'type': 'int'}, + 'bandwidth': {'key': 'bandwidth', 'type': 'long'}, + 'cache_hit_count': {'key': 'cacheHitCount', 'type': 'int'}, + 'cache_miss_count': {'key': 'cacheMissCount', 'type': 'int'}, + 'api_time_avg': {'key': 'apiTimeAvg', 'type': 'float'}, + 'api_time_min': {'key': 'apiTimeMin', 'type': 'float'}, + 'api_time_max': {'key': 'apiTimeMax', 'type': 'float'}, + 'service_time_avg': {'key': 'serviceTimeAvg', 'type': 'float'}, + 'service_time_min': {'key': 'serviceTimeMin', 'type': 'float'}, + 'service_time_max': {'key': 'serviceTimeMax', 'type': 'float'}, + } + + def __init__(self, *, name: str=None, timestamp=None, interval: str=None, country: str=None, region: str=None, zip: str=None, api_id: str=None, operation_id: str=None, api_region: str=None, subscription_id: str=None, call_count_success: int=None, call_count_blocked: int=None, call_count_failed: int=None, call_count_other: int=None, call_count_total: int=None, bandwidth: int=None, cache_hit_count: int=None, cache_miss_count: int=None, api_time_avg: float=None, api_time_min: float=None, api_time_max: float=None, service_time_avg: float=None, service_time_min: float=None, service_time_max: float=None, **kwargs) -> None: + super(ReportRecordContract, self).__init__(**kwargs) + self.name = name + self.timestamp = timestamp + self.interval = interval + self.country = country + self.region = region + self.zip = zip + self.user_id = None + self.product_id = None + self.api_id = api_id + self.operation_id = operation_id + self.api_region = api_region + self.subscription_id = subscription_id + self.call_count_success = call_count_success + self.call_count_blocked = call_count_blocked + self.call_count_failed = call_count_failed + self.call_count_other = call_count_other + self.call_count_total = call_count_total + self.bandwidth = bandwidth + self.cache_hit_count = cache_hit_count + self.cache_miss_count = cache_miss_count + self.api_time_avg = api_time_avg + self.api_time_min = api_time_min + self.api_time_max = api_time_max + self.service_time_avg = service_time_avg + self.service_time_min = service_time_min + self.service_time_max = service_time_max diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/representation_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/representation_contract.py new file mode 100644 index 000000000000..3bdfe5e8581e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/representation_contract.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class RepresentationContract(Model): + """Operation request/response representation details. + + All required parameters must be populated in order to send to Azure. + + :param content_type: Required. Specifies a registered or custom content + type for this representation, e.g. application/xml. + :type content_type: str + :param sample: An example of the representation. + :type sample: str + :param schema_id: Schema identifier. Applicable only if 'contentType' + value is neither 'application/x-www-form-urlencoded' nor + 'multipart/form-data'. + :type schema_id: str + :param type_name: Type name defined by the schema. Applicable only if + 'contentType' value is neither 'application/x-www-form-urlencoded' nor + 'multipart/form-data'. + :type type_name: str + :param form_parameters: Collection of form parameters. Required if + 'contentType' value is either 'application/x-www-form-urlencoded' or + 'multipart/form-data'.. + :type form_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + """ + + _validation = { + 'content_type': {'required': True}, + } + + _attribute_map = { + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'sample': {'key': 'sample', 'type': 'str'}, + 'schema_id': {'key': 'schemaId', 'type': 'str'}, + 'type_name': {'key': 'typeName', 'type': 'str'}, + 'form_parameters': {'key': 'formParameters', 'type': '[ParameterContract]'}, + } + + def __init__(self, **kwargs): + super(RepresentationContract, self).__init__(**kwargs) + self.content_type = kwargs.get('content_type', None) + self.sample = kwargs.get('sample', None) + self.schema_id = kwargs.get('schema_id', None) + self.type_name = kwargs.get('type_name', None) + self.form_parameters = kwargs.get('form_parameters', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/representation_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/representation_contract_py3.py new file mode 100644 index 000000000000..2dc5be839fe4 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/representation_contract_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class RepresentationContract(Model): + """Operation request/response representation details. + + All required parameters must be populated in order to send to Azure. + + :param content_type: Required. Specifies a registered or custom content + type for this representation, e.g. application/xml. + :type content_type: str + :param sample: An example of the representation. + :type sample: str + :param schema_id: Schema identifier. Applicable only if 'contentType' + value is neither 'application/x-www-form-urlencoded' nor + 'multipart/form-data'. + :type schema_id: str + :param type_name: Type name defined by the schema. Applicable only if + 'contentType' value is neither 'application/x-www-form-urlencoded' nor + 'multipart/form-data'. + :type type_name: str + :param form_parameters: Collection of form parameters. Required if + 'contentType' value is either 'application/x-www-form-urlencoded' or + 'multipart/form-data'.. + :type form_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + """ + + _validation = { + 'content_type': {'required': True}, + } + + _attribute_map = { + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'sample': {'key': 'sample', 'type': 'str'}, + 'schema_id': {'key': 'schemaId', 'type': 'str'}, + 'type_name': {'key': 'typeName', 'type': 'str'}, + 'form_parameters': {'key': 'formParameters', 'type': '[ParameterContract]'}, + } + + def __init__(self, *, content_type: str, sample: str=None, schema_id: str=None, type_name: str=None, form_parameters=None, **kwargs) -> None: + super(RepresentationContract, self).__init__(**kwargs) + self.content_type = content_type + self.sample = sample + self.schema_id = schema_id + self.type_name = type_name + self.form_parameters = form_parameters diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_contract.py new file mode 100644 index 000000000000..c576288d0328 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_contract.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class RequestContract(Model): + """Operation request details. + + :param description: Operation request description. + :type description: str + :param query_parameters: Collection of operation request query parameters. + :type query_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + :param headers: Collection of operation request headers. + :type headers: list[~azure.mgmt.apimanagement.models.ParameterContract] + :param representations: Collection of operation request representations. + :type representations: + list[~azure.mgmt.apimanagement.models.RepresentationContract] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'query_parameters': {'key': 'queryParameters', 'type': '[ParameterContract]'}, + 'headers': {'key': 'headers', 'type': '[ParameterContract]'}, + 'representations': {'key': 'representations', 'type': '[RepresentationContract]'}, + } + + def __init__(self, **kwargs): + super(RequestContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.query_parameters = kwargs.get('query_parameters', None) + self.headers = kwargs.get('headers', None) + self.representations = kwargs.get('representations', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_contract_py3.py new file mode 100644 index 000000000000..b2d8810a7be0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_contract_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class RequestContract(Model): + """Operation request details. + + :param description: Operation request description. + :type description: str + :param query_parameters: Collection of operation request query parameters. + :type query_parameters: + list[~azure.mgmt.apimanagement.models.ParameterContract] + :param headers: Collection of operation request headers. + :type headers: list[~azure.mgmt.apimanagement.models.ParameterContract] + :param representations: Collection of operation request representations. + :type representations: + list[~azure.mgmt.apimanagement.models.RepresentationContract] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'query_parameters': {'key': 'queryParameters', 'type': '[ParameterContract]'}, + 'headers': {'key': 'headers', 'type': '[ParameterContract]'}, + 'representations': {'key': 'representations', 'type': '[RepresentationContract]'}, + } + + def __init__(self, *, description: str=None, query_parameters=None, headers=None, representations=None, **kwargs) -> None: + super(RequestContract, self).__init__(**kwargs) + self.description = description + self.query_parameters = query_parameters + self.headers = headers + self.representations = representations diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_report_record_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_report_record_contract.py new file mode 100644 index 000000000000..53ca85a21c55 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_report_record_contract.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 msrest.serialization import Model + + +class RequestReportRecordContract(Model): + """Request Report data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param api_id: API identifier path. /apis/{apiId} + :type api_id: str + :param operation_id: Operation identifier path. + /apis/{apiId}/operations/{operationId} + :type operation_id: str + :ivar product_id: Product identifier path. /products/{productId} + :vartype product_id: str + :ivar user_id: User identifier path. /users/{userId} + :vartype user_id: str + :param method: The HTTP method associated with this request.. + :type method: str + :param url: The full URL associated with this request. + :type url: str + :param ip_address: The client IP address associated with this request. + :type ip_address: str + :param backend_response_code: The HTTP status code received by the gateway + as a result of forwarding this request to the backend. + :type backend_response_code: str + :param response_code: The HTTP status code returned by the gateway. + :type response_code: int + :param response_size: The size of the response returned by the gateway. + :type response_size: int + :param timestamp: The date and time when this request was received by the + gateway in ISO 8601 format. + :type timestamp: datetime + :param cache: Specifies if response cache was involved in generating the + response. If the value is none, the cache was not used. If the value is + hit, cached response was returned. If the value is miss, the cache was + used but lookup resulted in a miss and request was fullfilled by the + backend. + :type cache: str + :param api_time: The total time it took to process this request. + :type api_time: float + :param service_time: he time it took to forward this request to the + backend and get the response back. + :type service_time: float + :param api_region: Azure region where the gateway that processed this + request is located. + :type api_region: str + :param subscription_id: Subscription identifier path. + /subscriptions/{subscriptionId} + :type subscription_id: str + :param request_id: Request Identifier. + :type request_id: str + :param request_size: The size of this request.. + :type request_size: int + """ + + _validation = { + 'product_id': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'api_id': {'key': 'apiId', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'backend_response_code': {'key': 'backendResponseCode', 'type': 'str'}, + 'response_code': {'key': 'responseCode', 'type': 'int'}, + 'response_size': {'key': 'responseSize', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'cache': {'key': 'cache', 'type': 'str'}, + 'api_time': {'key': 'apiTime', 'type': 'float'}, + 'service_time': {'key': 'serviceTime', 'type': 'float'}, + 'api_region': {'key': 'apiRegion', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'request_size': {'key': 'requestSize', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RequestReportRecordContract, self).__init__(**kwargs) + self.api_id = kwargs.get('api_id', None) + self.operation_id = kwargs.get('operation_id', None) + self.product_id = None + self.user_id = None + self.method = kwargs.get('method', None) + self.url = kwargs.get('url', None) + self.ip_address = kwargs.get('ip_address', None) + self.backend_response_code = kwargs.get('backend_response_code', None) + self.response_code = kwargs.get('response_code', None) + self.response_size = kwargs.get('response_size', None) + self.timestamp = kwargs.get('timestamp', None) + self.cache = kwargs.get('cache', None) + self.api_time = kwargs.get('api_time', None) + self.service_time = kwargs.get('service_time', None) + self.api_region = kwargs.get('api_region', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.request_id = kwargs.get('request_id', None) + self.request_size = kwargs.get('request_size', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_report_record_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_report_record_contract_paged.py new file mode 100644 index 000000000000..f5cc659ead9e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_report_record_contract_paged.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 msrest.paging import Paged + + +class RequestReportRecordContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`RequestReportRecordContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RequestReportRecordContract]'} + } + + def __init__(self, *args, **kwargs): + + super(RequestReportRecordContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_report_record_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_report_record_contract_py3.py new file mode 100644 index 000000000000..5b6a4653c6cd --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/request_report_record_contract_py3.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 msrest.serialization import Model + + +class RequestReportRecordContract(Model): + """Request Report data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param api_id: API identifier path. /apis/{apiId} + :type api_id: str + :param operation_id: Operation identifier path. + /apis/{apiId}/operations/{operationId} + :type operation_id: str + :ivar product_id: Product identifier path. /products/{productId} + :vartype product_id: str + :ivar user_id: User identifier path. /users/{userId} + :vartype user_id: str + :param method: The HTTP method associated with this request.. + :type method: str + :param url: The full URL associated with this request. + :type url: str + :param ip_address: The client IP address associated with this request. + :type ip_address: str + :param backend_response_code: The HTTP status code received by the gateway + as a result of forwarding this request to the backend. + :type backend_response_code: str + :param response_code: The HTTP status code returned by the gateway. + :type response_code: int + :param response_size: The size of the response returned by the gateway. + :type response_size: int + :param timestamp: The date and time when this request was received by the + gateway in ISO 8601 format. + :type timestamp: datetime + :param cache: Specifies if response cache was involved in generating the + response. If the value is none, the cache was not used. If the value is + hit, cached response was returned. If the value is miss, the cache was + used but lookup resulted in a miss and request was fullfilled by the + backend. + :type cache: str + :param api_time: The total time it took to process this request. + :type api_time: float + :param service_time: he time it took to forward this request to the + backend and get the response back. + :type service_time: float + :param api_region: Azure region where the gateway that processed this + request is located. + :type api_region: str + :param subscription_id: Subscription identifier path. + /subscriptions/{subscriptionId} + :type subscription_id: str + :param request_id: Request Identifier. + :type request_id: str + :param request_size: The size of this request.. + :type request_size: int + """ + + _validation = { + 'product_id': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'api_id': {'key': 'apiId', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'backend_response_code': {'key': 'backendResponseCode', 'type': 'str'}, + 'response_code': {'key': 'responseCode', 'type': 'int'}, + 'response_size': {'key': 'responseSize', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'cache': {'key': 'cache', 'type': 'str'}, + 'api_time': {'key': 'apiTime', 'type': 'float'}, + 'service_time': {'key': 'serviceTime', 'type': 'float'}, + 'api_region': {'key': 'apiRegion', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'request_size': {'key': 'requestSize', 'type': 'int'}, + } + + def __init__(self, *, api_id: str=None, operation_id: str=None, method: str=None, url: str=None, ip_address: str=None, backend_response_code: str=None, response_code: int=None, response_size: int=None, timestamp=None, cache: str=None, api_time: float=None, service_time: float=None, api_region: str=None, subscription_id: str=None, request_id: str=None, request_size: int=None, **kwargs) -> None: + super(RequestReportRecordContract, self).__init__(**kwargs) + self.api_id = api_id + self.operation_id = operation_id + self.product_id = None + self.user_id = None + self.method = method + self.url = url + self.ip_address = ip_address + self.backend_response_code = backend_response_code + self.response_code = response_code + self.response_size = response_size + self.timestamp = timestamp + self.cache = cache + self.api_time = api_time + self.service_time = service_time + self.api_region = api_region + self.subscription_id = subscription_id + self.request_id = request_id + self.request_size = request_size diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/resource.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/resource.py new file mode 100644 index 000000000000..228f9a4bad1a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/resource.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Resource(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 for API Management resource. + :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 diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/resource_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/resource_py3.py new file mode 100644 index 000000000000..d847e3f57d60 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Resource(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 for API Management resource. + :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) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/response_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/response_contract.py new file mode 100644 index 000000000000..511adab1f030 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/response_contract.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class ResponseContract(Model): + """Operation response details. + + All required parameters must be populated in order to send to Azure. + + :param status_code: Required. Operation response HTTP status code. + :type status_code: int + :param description: Operation response description. + :type description: str + :param representations: Collection of operation response representations. + :type representations: + list[~azure.mgmt.apimanagement.models.RepresentationContract] + :param headers: Collection of operation response headers. + :type headers: list[~azure.mgmt.apimanagement.models.ParameterContract] + """ + + _validation = { + 'status_code': {'required': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'representations': {'key': 'representations', 'type': '[RepresentationContract]'}, + 'headers': {'key': 'headers', 'type': '[ParameterContract]'}, + } + + def __init__(self, **kwargs): + super(ResponseContract, self).__init__(**kwargs) + self.status_code = kwargs.get('status_code', None) + self.description = kwargs.get('description', None) + self.representations = kwargs.get('representations', None) + self.headers = kwargs.get('headers', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/response_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/response_contract_py3.py new file mode 100644 index 000000000000..e2101f5e2c26 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/response_contract_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class ResponseContract(Model): + """Operation response details. + + All required parameters must be populated in order to send to Azure. + + :param status_code: Required. Operation response HTTP status code. + :type status_code: int + :param description: Operation response description. + :type description: str + :param representations: Collection of operation response representations. + :type representations: + list[~azure.mgmt.apimanagement.models.RepresentationContract] + :param headers: Collection of operation response headers. + :type headers: list[~azure.mgmt.apimanagement.models.ParameterContract] + """ + + _validation = { + 'status_code': {'required': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'representations': {'key': 'representations', 'type': '[RepresentationContract]'}, + 'headers': {'key': 'headers', 'type': '[ParameterContract]'}, + } + + def __init__(self, *, status_code: int, description: str=None, representations=None, headers=None, **kwargs) -> None: + super(ResponseContract, self).__init__(**kwargs) + self.status_code = status_code + self.description = description + self.representations = representations + self.headers = headers diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/save_configuration_parameter.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/save_configuration_parameter.py new file mode 100644 index 000000000000..77d0e9db41c5 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/save_configuration_parameter.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class SaveConfigurationParameter(Model): + """Parameters supplied to the Save Tenant Configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param branch: Required. The name of the Git branch in which to commit the + current configuration snapshot. + :type branch: str + :param force: The value if true, the current configuration database is + committed to the Git repository, even if the Git repository has newer + changes that would be overwritten. + :type force: bool + """ + + _validation = { + 'branch': {'required': True}, + } + + _attribute_map = { + 'branch': {'key': 'branch', 'type': 'str'}, + 'force': {'key': 'force', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SaveConfigurationParameter, self).__init__(**kwargs) + self.branch = kwargs.get('branch', None) + self.force = kwargs.get('force', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/save_configuration_parameter_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/save_configuration_parameter_py3.py new file mode 100644 index 000000000000..3c887ae64b03 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/save_configuration_parameter_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class SaveConfigurationParameter(Model): + """Parameters supplied to the Save Tenant Configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param branch: Required. The name of the Git branch in which to commit the + current configuration snapshot. + :type branch: str + :param force: The value if true, the current configuration database is + committed to the Git repository, even if the Git repository has newer + changes that would be overwritten. + :type force: bool + """ + + _validation = { + 'branch': {'required': True}, + } + + _attribute_map = { + 'branch': {'key': 'branch', 'type': 'str'}, + 'force': {'key': 'force', 'type': 'bool'}, + } + + def __init__(self, *, branch: str, force: bool=None, **kwargs) -> None: + super(SaveConfigurationParameter, self).__init__(**kwargs) + self.branch = branch + self.force = force diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract.py new file mode 100644 index 000000000000..731db63de91c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract.py @@ -0,0 +1,56 @@ +# 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 .resource import Resource + + +class SchemaContract(Resource): + """Schema Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param content_type: Required. Must be a valid a media type used in a + Content-Type header as defined in the RFC 2616. Media type of the schema + document (e.g. application/json, application/xml). + :type content_type: str + :param value: Json escaped string defining the document representing the + Schema. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'content_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'value': {'key': 'properties.document.value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SchemaContract, self).__init__(**kwargs) + self.content_type = kwargs.get('content_type', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_paged.py new file mode 100644 index 000000000000..7c89d8c021ee --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_paged.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 msrest.paging import Paged + + +class SchemaContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`SchemaContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SchemaContract]'} + } + + def __init__(self, *args, **kwargs): + + super(SchemaContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_py3.py new file mode 100644 index 000000000000..1bf2ed19ad71 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_py3.py @@ -0,0 +1,56 @@ +# 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 .resource import Resource + + +class SchemaContract(Resource): + """Schema Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param content_type: Required. Must be a valid a media type used in a + Content-Type header as defined in the RFC 2616. Media type of the schema + document (e.g. application/json, application/xml). + :type content_type: str + :param value: Json escaped string defining the document representing the + Schema. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'content_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'value': {'key': 'properties.document.value', 'type': 'str'}, + } + + def __init__(self, *, content_type: str, value: str=None, **kwargs) -> None: + super(SchemaContract, self).__init__(, **kwargs) + self.content_type = content_type + self.value = value diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_contract.py new file mode 100644 index 000000000000..ad74a6e536c2 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_contract.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 .resource import Resource + + +class SubscriptionContract(Resource): + """Subscription details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param user_id: Required. The user resource identifier of the subscription + owner. The value is a valid relative URL in the format of /users/{uid} + where {uid} is a user identifier. + :type user_id: str + :param product_id: Required. The product resource identifier of the + subscribed product. The value is a valid relative URL in the format of + /products/{productId} where {productId} is a product identifier. + :type product_id: str + :param display_name: The name of the subscription, or null if the + subscription has no name. + :type display_name: str + :param state: Required. Subscription state. Possible states are * active – + the subscription is active, * suspended – the subscription is blocked, and + the subscriber cannot call any APIs of the product, * submitted – the + subscription request has been made by the developer, but has not yet been + approved or rejected, * rejected – the subscription request has been + denied by an administrator, * cancelled – the subscription has been + cancelled by the developer or administrator, * expired – the subscription + reached its expiration date and was deactivated. Possible values include: + 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' + :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState + :ivar created_date: Subscription creation date. The date conforms to the + following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :vartype created_date: datetime + :param start_date: Subscription activation date. The setting is for audit + purposes only and the subscription is not automatically activated. The + subscription lifecycle can be managed by using the `state` property. The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :type start_date: datetime + :param expiration_date: Subscription expiration date. The setting is for + audit purposes only and the subscription is not automatically expired. The + subscription lifecycle can be managed by using the `state` property. The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :type expiration_date: datetime + :param end_date: Date when subscription was cancelled or expired. The + setting is for audit purposes only and the subscription is not + automatically cancelled. The subscription lifecycle can be managed by + using the `state` property. The date conforms to the following format: + `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + :type end_date: datetime + :param notification_date: Upcoming subscription expiration notification + date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + specified by the ISO 8601 standard. + :type notification_date: datetime + :param primary_key: Required. Subscription primary key. + :type primary_key: str + :param secondary_key: Required. Subscription secondary key. + :type secondary_key: str + :param state_comment: Optional subscription comment added by an + administrator. + :type state_comment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_id': {'required': True}, + 'product_id': {'required': True}, + 'display_name': {'max_length': 100, 'min_length': 0}, + 'state': {'required': True}, + 'created_date': {'readonly': True}, + 'primary_key': {'required': True, 'max_length': 256, 'min_length': 1}, + 'secondary_key': {'required': True, 'max_length': 256, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'SubscriptionState'}, + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'notification_date': {'key': 'properties.notificationDate', 'type': 'iso-8601'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'state_comment': {'key': 'properties.stateComment', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubscriptionContract, self).__init__(**kwargs) + self.user_id = kwargs.get('user_id', None) + self.product_id = kwargs.get('product_id', None) + self.display_name = kwargs.get('display_name', None) + self.state = kwargs.get('state', None) + self.created_date = None + self.start_date = kwargs.get('start_date', None) + self.expiration_date = kwargs.get('expiration_date', None) + self.end_date = kwargs.get('end_date', None) + self.notification_date = kwargs.get('notification_date', None) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.state_comment = kwargs.get('state_comment', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_contract_paged.py new file mode 100644 index 000000000000..b781048674f1 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_contract_paged.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 msrest.paging import Paged + + +class SubscriptionContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`SubscriptionContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SubscriptionContract]'} + } + + def __init__(self, *args, **kwargs): + + super(SubscriptionContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_contract_py3.py new file mode 100644 index 000000000000..af2df80f58ea --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_contract_py3.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 .resource import Resource + + +class SubscriptionContract(Resource): + """Subscription details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param user_id: Required. The user resource identifier of the subscription + owner. The value is a valid relative URL in the format of /users/{uid} + where {uid} is a user identifier. + :type user_id: str + :param product_id: Required. The product resource identifier of the + subscribed product. The value is a valid relative URL in the format of + /products/{productId} where {productId} is a product identifier. + :type product_id: str + :param display_name: The name of the subscription, or null if the + subscription has no name. + :type display_name: str + :param state: Required. Subscription state. Possible states are * active – + the subscription is active, * suspended – the subscription is blocked, and + the subscriber cannot call any APIs of the product, * submitted – the + subscription request has been made by the developer, but has not yet been + approved or rejected, * rejected – the subscription request has been + denied by an administrator, * cancelled – the subscription has been + cancelled by the developer or administrator, * expired – the subscription + reached its expiration date and was deactivated. Possible values include: + 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' + :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState + :ivar created_date: Subscription creation date. The date conforms to the + following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :vartype created_date: datetime + :param start_date: Subscription activation date. The setting is for audit + purposes only and the subscription is not automatically activated. The + subscription lifecycle can be managed by using the `state` property. The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :type start_date: datetime + :param expiration_date: Subscription expiration date. The setting is for + audit purposes only and the subscription is not automatically expired. The + subscription lifecycle can be managed by using the `state` property. The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :type expiration_date: datetime + :param end_date: Date when subscription was cancelled or expired. The + setting is for audit purposes only and the subscription is not + automatically cancelled. The subscription lifecycle can be managed by + using the `state` property. The date conforms to the following format: + `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + :type end_date: datetime + :param notification_date: Upcoming subscription expiration notification + date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + specified by the ISO 8601 standard. + :type notification_date: datetime + :param primary_key: Required. Subscription primary key. + :type primary_key: str + :param secondary_key: Required. Subscription secondary key. + :type secondary_key: str + :param state_comment: Optional subscription comment added by an + administrator. + :type state_comment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_id': {'required': True}, + 'product_id': {'required': True}, + 'display_name': {'max_length': 100, 'min_length': 0}, + 'state': {'required': True}, + 'created_date': {'readonly': True}, + 'primary_key': {'required': True, 'max_length': 256, 'min_length': 1}, + 'secondary_key': {'required': True, 'max_length': 256, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'SubscriptionState'}, + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'notification_date': {'key': 'properties.notificationDate', 'type': 'iso-8601'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'state_comment': {'key': 'properties.stateComment', 'type': 'str'}, + } + + def __init__(self, *, user_id: str, product_id: str, state, primary_key: str, secondary_key: str, display_name: str=None, start_date=None, expiration_date=None, end_date=None, notification_date=None, state_comment: str=None, **kwargs) -> None: + super(SubscriptionContract, self).__init__(, **kwargs) + self.user_id = user_id + self.product_id = product_id + self.display_name = display_name + self.state = state + self.created_date = None + self.start_date = start_date + self.expiration_date = expiration_date + self.end_date = end_date + self.notification_date = notification_date + self.primary_key = primary_key + self.secondary_key = secondary_key + self.state_comment = state_comment diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_create_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_create_parameters.py new file mode 100644 index 000000000000..5394d4b9873b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_create_parameters.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 msrest.serialization import Model + + +class SubscriptionCreateParameters(Model): + """Subscription create details. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. User (user id path) for whom subscription is + being created in form /users/{uid} + :type user_id: str + :param product_id: Required. Product (product id path) for which + subscription is being created in form /products/{productid} + :type product_id: str + :param display_name: Required. Subscription name. + :type display_name: str + :param primary_key: Primary subscription key. If not specified during + request key will be generated automatically. + :type primary_key: str + :param secondary_key: Secondary subscription key. If not specified during + request key will be generated automatically. + :type secondary_key: str + :param state: Initial subscription state. If no value is specified, + subscription is created with Submitted state. Possible states are * active + – the subscription is active, * suspended – the subscription is blocked, + and the subscriber cannot call any APIs of the product, * submitted – the + subscription request has been made by the developer, but has not yet been + approved or rejected, * rejected – the subscription request has been + denied by an administrator, * cancelled – the subscription has been + cancelled by the developer or administrator, * expired – the subscription + reached its expiration date and was deactivated. Possible values include: + 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' + :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState + """ + + _validation = { + 'user_id': {'required': True}, + 'product_id': {'required': True}, + 'display_name': {'required': True, 'max_length': 100, 'min_length': 1}, + 'primary_key': {'max_length': 256, 'min_length': 1}, + 'secondary_key': {'max_length': 256, 'min_length': 1}, + } + + _attribute_map = { + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'SubscriptionState'}, + } + + def __init__(self, **kwargs): + super(SubscriptionCreateParameters, self).__init__(**kwargs) + self.user_id = kwargs.get('user_id', None) + self.product_id = kwargs.get('product_id', None) + self.display_name = kwargs.get('display_name', None) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_create_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_create_parameters_py3.py new file mode 100644 index 000000000000..14dfa61075dd --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_create_parameters_py3.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 msrest.serialization import Model + + +class SubscriptionCreateParameters(Model): + """Subscription create details. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. User (user id path) for whom subscription is + being created in form /users/{uid} + :type user_id: str + :param product_id: Required. Product (product id path) for which + subscription is being created in form /products/{productid} + :type product_id: str + :param display_name: Required. Subscription name. + :type display_name: str + :param primary_key: Primary subscription key. If not specified during + request key will be generated automatically. + :type primary_key: str + :param secondary_key: Secondary subscription key. If not specified during + request key will be generated automatically. + :type secondary_key: str + :param state: Initial subscription state. If no value is specified, + subscription is created with Submitted state. Possible states are * active + – the subscription is active, * suspended – the subscription is blocked, + and the subscriber cannot call any APIs of the product, * submitted – the + subscription request has been made by the developer, but has not yet been + approved or rejected, * rejected – the subscription request has been + denied by an administrator, * cancelled – the subscription has been + cancelled by the developer or administrator, * expired – the subscription + reached its expiration date and was deactivated. Possible values include: + 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' + :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState + """ + + _validation = { + 'user_id': {'required': True}, + 'product_id': {'required': True}, + 'display_name': {'required': True, 'max_length': 100, 'min_length': 1}, + 'primary_key': {'max_length': 256, 'min_length': 1}, + 'secondary_key': {'max_length': 256, 'min_length': 1}, + } + + _attribute_map = { + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'SubscriptionState'}, + } + + def __init__(self, *, user_id: str, product_id: str, display_name: str, primary_key: str=None, secondary_key: str=None, state=None, **kwargs) -> None: + super(SubscriptionCreateParameters, self).__init__(**kwargs) + self.user_id = user_id + self.product_id = product_id + self.display_name = display_name + self.primary_key = primary_key + self.secondary_key = secondary_key + self.state = state diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_key_parameter_names_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_key_parameter_names_contract.py new file mode 100644 index 000000000000..f211ba47878c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_key_parameter_names_contract.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class SubscriptionKeyParameterNamesContract(Model): + """Subscription key parameter names details. + + :param header: Subscription key header name. + :type header: str + :param query: Subscription key query string parameter name. + :type query: str + """ + + _attribute_map = { + 'header': {'key': 'header', 'type': 'str'}, + 'query': {'key': 'query', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubscriptionKeyParameterNamesContract, self).__init__(**kwargs) + self.header = kwargs.get('header', None) + self.query = kwargs.get('query', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_key_parameter_names_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_key_parameter_names_contract_py3.py new file mode 100644 index 000000000000..b1163f189a3f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_key_parameter_names_contract_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class SubscriptionKeyParameterNamesContract(Model): + """Subscription key parameter names details. + + :param header: Subscription key header name. + :type header: str + :param query: Subscription key query string parameter name. + :type query: str + """ + + _attribute_map = { + 'header': {'key': 'header', 'type': 'str'}, + 'query': {'key': 'query', 'type': 'str'}, + } + + def __init__(self, *, header: str=None, query: str=None, **kwargs) -> None: + super(SubscriptionKeyParameterNamesContract, self).__init__(**kwargs) + self.header = header + self.query = query diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_update_parameters.py new file mode 100644 index 000000000000..7dc1180eb57e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_update_parameters.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class SubscriptionUpdateParameters(Model): + """Subscription update details. + + :param user_id: User identifier path: /users/{uid} + :type user_id: str + :param product_id: Product identifier path: /products/{productId} + :type product_id: str + :param expiration_date: Subscription expiration date. The setting is for + audit purposes only and the subscription is not automatically expired. The + subscription lifecycle can be managed by using the `state` property. The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :type expiration_date: datetime + :param display_name: Subscription name. + :type display_name: str + :param primary_key: Primary subscription key. + :type primary_key: str + :param secondary_key: Secondary subscription key. + :type secondary_key: str + :param state: Subscription state. Possible states are * active – the + subscription is active, * suspended – the subscription is blocked, and the + subscriber cannot call any APIs of the product, * submitted – the + subscription request has been made by the developer, but has not yet been + approved or rejected, * rejected – the subscription request has been + denied by an administrator, * cancelled – the subscription has been + cancelled by the developer or administrator, * expired – the subscription + reached its expiration date and was deactivated. Possible values include: + 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' + :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState + :param state_comment: Comments describing subscription state change by the + administrator. + :type state_comment: str + """ + + _validation = { + 'primary_key': {'max_length': 256, 'min_length': 1}, + 'secondary_key': {'max_length': 256, 'min_length': 1}, + } + + _attribute_map = { + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'SubscriptionState'}, + 'state_comment': {'key': 'properties.stateComment', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubscriptionUpdateParameters, self).__init__(**kwargs) + self.user_id = kwargs.get('user_id', None) + self.product_id = kwargs.get('product_id', None) + self.expiration_date = kwargs.get('expiration_date', None) + self.display_name = kwargs.get('display_name', None) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.state = kwargs.get('state', None) + self.state_comment = kwargs.get('state_comment', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_update_parameters_py3.py new file mode 100644 index 000000000000..1a4e344d340e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscription_update_parameters_py3.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class SubscriptionUpdateParameters(Model): + """Subscription update details. + + :param user_id: User identifier path: /users/{uid} + :type user_id: str + :param product_id: Product identifier path: /products/{productId} + :type product_id: str + :param expiration_date: Subscription expiration date. The setting is for + audit purposes only and the subscription is not automatically expired. The + subscription lifecycle can be managed by using the `state` property. The + date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + by the ISO 8601 standard. + :type expiration_date: datetime + :param display_name: Subscription name. + :type display_name: str + :param primary_key: Primary subscription key. + :type primary_key: str + :param secondary_key: Secondary subscription key. + :type secondary_key: str + :param state: Subscription state. Possible states are * active – the + subscription is active, * suspended – the subscription is blocked, and the + subscriber cannot call any APIs of the product, * submitted – the + subscription request has been made by the developer, but has not yet been + approved or rejected, * rejected – the subscription request has been + denied by an administrator, * cancelled – the subscription has been + cancelled by the developer or administrator, * expired – the subscription + reached its expiration date and was deactivated. Possible values include: + 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' + :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState + :param state_comment: Comments describing subscription state change by the + administrator. + :type state_comment: str + """ + + _validation = { + 'primary_key': {'max_length': 256, 'min_length': 1}, + 'secondary_key': {'max_length': 256, 'min_length': 1}, + } + + _attribute_map = { + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'SubscriptionState'}, + 'state_comment': {'key': 'properties.stateComment', 'type': 'str'}, + } + + def __init__(self, *, user_id: str=None, product_id: str=None, expiration_date=None, display_name: str=None, primary_key: str=None, secondary_key: str=None, state=None, state_comment: str=None, **kwargs) -> None: + super(SubscriptionUpdateParameters, self).__init__(**kwargs) + self.user_id = user_id + self.product_id = product_id + self.expiration_date = expiration_date + self.display_name = display_name + self.primary_key = primary_key + self.secondary_key = secondary_key + self.state = state + self.state_comment = state_comment diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscriptions_delegation_settings_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscriptions_delegation_settings_properties.py new file mode 100644 index 000000000000..82beeab1135d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscriptions_delegation_settings_properties.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SubscriptionsDelegationSettingsProperties(Model): + """Subscriptions delegation settings properties. + + :param enabled: Enable or disable delegation for subscriptions. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SubscriptionsDelegationSettingsProperties, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscriptions_delegation_settings_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscriptions_delegation_settings_properties_py3.py new file mode 100644 index 000000000000..61fab5253a59 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/subscriptions_delegation_settings_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SubscriptionsDelegationSettingsProperties(Model): + """Subscriptions delegation settings properties. + + :param enabled: Enable or disable delegation for subscriptions. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(SubscriptionsDelegationSettingsProperties, self).__init__(**kwargs) + self.enabled = enabled diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_contract.py new file mode 100644 index 000000000000..d0b129412cf1 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_contract.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 .resource import Resource + + +class TagContract(Resource): + """Tag Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param display_name: Required. Tag name. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True, 'max_length': 160, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagContract, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_contract_paged.py new file mode 100644 index 000000000000..48974c2715cf --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_contract_paged.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 msrest.paging import Paged + + +class TagContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`TagContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TagContract]'} + } + + def __init__(self, *args, **kwargs): + + super(TagContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_contract_py3.py new file mode 100644 index 000000000000..09e7c7880dec --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_contract_py3.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 .resource import Resource + + +class TagContract(Resource): + """Tag Contract details. + + Variables are only 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 for API Management resource. + :vartype type: str + :param display_name: Required. Tag name. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True, 'max_length': 160, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, **kwargs) -> None: + super(TagContract, self).__init__(, **kwargs) + self.display_name = display_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_create_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_create_update_parameters.py new file mode 100644 index 000000000000..c133f3ffbf39 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_create_update_parameters.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class TagCreateUpdateParameters(Model): + """Parameters supplied to Create/Update Tag operations. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Required. Tag name. + :type display_name: str + """ + + _validation = { + 'display_name': {'required': True, 'max_length': 160, 'min_length': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagCreateUpdateParameters, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_create_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_create_update_parameters_py3.py new file mode 100644 index 000000000000..e7a08d2fb302 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_create_update_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class TagCreateUpdateParameters(Model): + """Parameters supplied to Create/Update Tag operations. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Required. Tag name. + :type display_name: str + """ + + _validation = { + 'display_name': {'required': True, 'max_length': 160, 'min_length': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, **kwargs) -> None: + super(TagCreateUpdateParameters, self).__init__(**kwargs) + self.display_name = display_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_contract.py new file mode 100644 index 000000000000..26e272617407 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_contract.py @@ -0,0 +1,62 @@ +# 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 .resource import Resource + + +class TagDescriptionContract(Resource): + """Contract details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param description: Description of the Tag. + :type description: str + :param external_docs_url: Absolute URL of external resources describing + the tag. + :type external_docs_url: str + :param external_docs_description: Description of the external resources + describing the tag. + :type external_docs_description: str + :param display_name: Tag name. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'external_docs_url': {'max_length': 2000}, + 'display_name': {'max_length': 160, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'external_docs_url': {'key': 'properties.externalDocsUrl', 'type': 'str'}, + 'external_docs_description': {'key': 'properties.externalDocsDescription', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagDescriptionContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.external_docs_url = kwargs.get('external_docs_url', None) + self.external_docs_description = kwargs.get('external_docs_description', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_contract_paged.py new file mode 100644 index 000000000000..3867d66bf905 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_contract_paged.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 msrest.paging import Paged + + +class TagDescriptionContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`TagDescriptionContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TagDescriptionContract]'} + } + + def __init__(self, *args, **kwargs): + + super(TagDescriptionContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_contract_py3.py new file mode 100644 index 000000000000..27bffbed87e5 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_contract_py3.py @@ -0,0 +1,62 @@ +# 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 .resource import Resource + + +class TagDescriptionContract(Resource): + """Contract details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param description: Description of the Tag. + :type description: str + :param external_docs_url: Absolute URL of external resources describing + the tag. + :type external_docs_url: str + :param external_docs_description: Description of the external resources + describing the tag. + :type external_docs_description: str + :param display_name: Tag name. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'external_docs_url': {'max_length': 2000}, + 'display_name': {'max_length': 160, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'external_docs_url': {'key': 'properties.externalDocsUrl', 'type': 'str'}, + 'external_docs_description': {'key': 'properties.externalDocsDescription', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, external_docs_url: str=None, external_docs_description: str=None, display_name: str=None, **kwargs) -> None: + super(TagDescriptionContract, self).__init__(, **kwargs) + self.description = description + self.external_docs_url = external_docs_url + self.external_docs_description = external_docs_description + self.display_name = display_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_create_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_create_parameters.py new file mode 100644 index 000000000000..15842608702c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_create_parameters.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class TagDescriptionCreateParameters(Model): + """Parameters supplied to the Create TagDescription operation. + + :param description: Description of the Tag. + :type description: str + :param external_docs_url: Absolute URL of external resources describing + the tag. + :type external_docs_url: str + :param external_docs_description: Description of the external resources + describing the tag. + :type external_docs_description: str + """ + + _validation = { + 'external_docs_url': {'max_length': 2000}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'external_docs_url': {'key': 'properties.externalDocsUrl', 'type': 'str'}, + 'external_docs_description': {'key': 'properties.externalDocsDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagDescriptionCreateParameters, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.external_docs_url = kwargs.get('external_docs_url', None) + self.external_docs_description = kwargs.get('external_docs_description', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_create_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_create_parameters_py3.py new file mode 100644 index 000000000000..dd5a8b4ad441 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_description_create_parameters_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class TagDescriptionCreateParameters(Model): + """Parameters supplied to the Create TagDescription operation. + + :param description: Description of the Tag. + :type description: str + :param external_docs_url: Absolute URL of external resources describing + the tag. + :type external_docs_url: str + :param external_docs_description: Description of the external resources + describing the tag. + :type external_docs_description: str + """ + + _validation = { + 'external_docs_url': {'max_length': 2000}, + } + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'external_docs_url': {'key': 'properties.externalDocsUrl', 'type': 'str'}, + 'external_docs_description': {'key': 'properties.externalDocsDescription', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, external_docs_url: str=None, external_docs_description: str=None, **kwargs) -> None: + super(TagDescriptionCreateParameters, self).__init__(**kwargs) + self.description = description + self.external_docs_url = external_docs_url + self.external_docs_description = external_docs_description diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_resource_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_resource_contract.py new file mode 100644 index 000000000000..594a0780d833 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_resource_contract.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class TagResourceContract(Model): + """TagResource contract properties. + + All required parameters must be populated in order to send to Azure. + + :param tag: Required. Tag associated with the resource. + :type tag: + ~azure.mgmt.apimanagement.models.TagTagResourceContractProperties + :param api: Api associated with the tag. + :type api: + ~azure.mgmt.apimanagement.models.ApiTagResourceContractProperties + :param operation: Operation associated with the tag. + :type operation: + ~azure.mgmt.apimanagement.models.OperationTagResourceContractProperties + :param product: Product associated with the tag. + :type product: + ~azure.mgmt.apimanagement.models.ProductTagResourceContractProperties + """ + + _validation = { + 'tag': {'required': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'TagTagResourceContractProperties'}, + 'api': {'key': 'api', 'type': 'ApiTagResourceContractProperties'}, + 'operation': {'key': 'operation', 'type': 'OperationTagResourceContractProperties'}, + 'product': {'key': 'product', 'type': 'ProductTagResourceContractProperties'}, + } + + def __init__(self, **kwargs): + super(TagResourceContract, self).__init__(**kwargs) + self.tag = kwargs.get('tag', None) + self.api = kwargs.get('api', None) + self.operation = kwargs.get('operation', None) + self.product = kwargs.get('product', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_resource_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_resource_contract_paged.py new file mode 100644 index 000000000000..c64d82f24e7c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_resource_contract_paged.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 msrest.paging import Paged + + +class TagResourceContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`TagResourceContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TagResourceContract]'} + } + + def __init__(self, *args, **kwargs): + + super(TagResourceContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_resource_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_resource_contract_py3.py new file mode 100644 index 000000000000..1377128c02d7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_resource_contract_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class TagResourceContract(Model): + """TagResource contract properties. + + All required parameters must be populated in order to send to Azure. + + :param tag: Required. Tag associated with the resource. + :type tag: + ~azure.mgmt.apimanagement.models.TagTagResourceContractProperties + :param api: Api associated with the tag. + :type api: + ~azure.mgmt.apimanagement.models.ApiTagResourceContractProperties + :param operation: Operation associated with the tag. + :type operation: + ~azure.mgmt.apimanagement.models.OperationTagResourceContractProperties + :param product: Product associated with the tag. + :type product: + ~azure.mgmt.apimanagement.models.ProductTagResourceContractProperties + """ + + _validation = { + 'tag': {'required': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'TagTagResourceContractProperties'}, + 'api': {'key': 'api', 'type': 'ApiTagResourceContractProperties'}, + 'operation': {'key': 'operation', 'type': 'OperationTagResourceContractProperties'}, + 'product': {'key': 'product', 'type': 'ProductTagResourceContractProperties'}, + } + + def __init__(self, *, tag, api=None, operation=None, product=None, **kwargs) -> None: + super(TagResourceContract, self).__init__(**kwargs) + self.tag = tag + self.api = api + self.operation = operation + self.product = product diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_tag_resource_contract_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_tag_resource_contract_properties.py new file mode 100644 index 000000000000..54330625ad6d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_tag_resource_contract_properties.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class TagTagResourceContractProperties(Model): + """Contract defining the Tag property in the Tag Resource Contract. + + :param id: Tag identifier + :type id: str + :param name: Tag Name + :type name: str + """ + + _validation = { + 'name': {'max_length': 160, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagTagResourceContractProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_tag_resource_contract_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_tag_resource_contract_properties_py3.py new file mode 100644 index 000000000000..48f937aa9e52 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tag_tag_resource_contract_properties_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class TagTagResourceContractProperties(Model): + """Contract defining the Tag property in the Tag Resource Contract. + + :param id: Tag identifier + :type id: str + :param name: Tag Name + :type name: str + """ + + _validation = { + 'name': {'max_length': 160, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, **kwargs) -> None: + super(TagTagResourceContractProperties, self).__init__(**kwargs) + self.id = id + self.name = name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tenant_configuration_sync_state_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tenant_configuration_sync_state_contract.py new file mode 100644 index 000000000000..8b5d7e2d4c46 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tenant_configuration_sync_state_contract.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class TenantConfigurationSyncStateContract(Model): + """Tenant Configuration Synchronization State. + + :param branch: The name of Git branch. + :type branch: str + :param commit_id: The latest commit Id. + :type commit_id: str + :param is_export: value indicating if last sync was save (true) or deploy + (false) operation. + :type is_export: bool + :param is_synced: value indicating if last synchronization was later than + the configuration change. + :type is_synced: bool + :param is_git_enabled: value indicating whether Git configuration access + is enabled. + :type is_git_enabled: bool + :param sync_date: The date of the latest synchronization. The date + conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + the ISO 8601 standard. + :type sync_date: datetime + :param configuration_change_date: The date of the latest configuration + change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + as specified by the ISO 8601 standard. + :type configuration_change_date: datetime + """ + + _attribute_map = { + 'branch': {'key': 'branch', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'is_export': {'key': 'isExport', 'type': 'bool'}, + 'is_synced': {'key': 'isSynced', 'type': 'bool'}, + 'is_git_enabled': {'key': 'isGitEnabled', 'type': 'bool'}, + 'sync_date': {'key': 'syncDate', 'type': 'iso-8601'}, + 'configuration_change_date': {'key': 'configurationChangeDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(TenantConfigurationSyncStateContract, self).__init__(**kwargs) + self.branch = kwargs.get('branch', None) + self.commit_id = kwargs.get('commit_id', None) + self.is_export = kwargs.get('is_export', None) + self.is_synced = kwargs.get('is_synced', None) + self.is_git_enabled = kwargs.get('is_git_enabled', None) + self.sync_date = kwargs.get('sync_date', None) + self.configuration_change_date = kwargs.get('configuration_change_date', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tenant_configuration_sync_state_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tenant_configuration_sync_state_contract_py3.py new file mode 100644 index 000000000000..7b9c9e8d2c40 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/tenant_configuration_sync_state_contract_py3.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class TenantConfigurationSyncStateContract(Model): + """Tenant Configuration Synchronization State. + + :param branch: The name of Git branch. + :type branch: str + :param commit_id: The latest commit Id. + :type commit_id: str + :param is_export: value indicating if last sync was save (true) or deploy + (false) operation. + :type is_export: bool + :param is_synced: value indicating if last synchronization was later than + the configuration change. + :type is_synced: bool + :param is_git_enabled: value indicating whether Git configuration access + is enabled. + :type is_git_enabled: bool + :param sync_date: The date of the latest synchronization. The date + conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + the ISO 8601 standard. + :type sync_date: datetime + :param configuration_change_date: The date of the latest configuration + change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + as specified by the ISO 8601 standard. + :type configuration_change_date: datetime + """ + + _attribute_map = { + 'branch': {'key': 'branch', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'is_export': {'key': 'isExport', 'type': 'bool'}, + 'is_synced': {'key': 'isSynced', 'type': 'bool'}, + 'is_git_enabled': {'key': 'isGitEnabled', 'type': 'bool'}, + 'sync_date': {'key': 'syncDate', 'type': 'iso-8601'}, + 'configuration_change_date': {'key': 'configurationChangeDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, branch: str=None, commit_id: str=None, is_export: bool=None, is_synced: bool=None, is_git_enabled: bool=None, sync_date=None, configuration_change_date=None, **kwargs) -> None: + super(TenantConfigurationSyncStateContract, self).__init__(**kwargs) + self.branch = branch + self.commit_id = commit_id + self.is_export = is_export + self.is_synced = is_synced + self.is_git_enabled = is_git_enabled + self.sync_date = sync_date + self.configuration_change_date = configuration_change_date diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/terms_of_service_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/terms_of_service_properties.py new file mode 100644 index 000000000000..8967b154c12c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/terms_of_service_properties.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class TermsOfServiceProperties(Model): + """Terms of service contract properties. + + :param text: A terms of service text. + :type text: str + :param enabled: Display terms of service during a sign-up process. + :type enabled: bool + :param consent_required: Ask user for consent to the terms of service. + :type consent_required: bool + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'consent_required': {'key': 'consentRequired', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(TermsOfServiceProperties, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.enabled = kwargs.get('enabled', None) + self.consent_required = kwargs.get('consent_required', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/terms_of_service_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/terms_of_service_properties_py3.py new file mode 100644 index 000000000000..12ba02c648fa --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/terms_of_service_properties_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class TermsOfServiceProperties(Model): + """Terms of service contract properties. + + :param text: A terms of service text. + :type text: str + :param enabled: Display terms of service during a sign-up process. + :type enabled: bool + :param consent_required: Ask user for consent to the terms of service. + :type consent_required: bool + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'consent_required': {'key': 'consentRequired', 'type': 'bool'}, + } + + def __init__(self, *, text: str=None, enabled: bool=None, consent_required: bool=None, **kwargs) -> None: + super(TermsOfServiceProperties, self).__init__(**kwargs) + self.text = text + self.enabled = enabled + self.consent_required = consent_required diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/token_body_parameter_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/token_body_parameter_contract.py new file mode 100644 index 000000000000..605ff1d0d585 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/token_body_parameter_contract.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class TokenBodyParameterContract(Model): + """OAuth acquire token request body parameter (www-url-form-encoded). + + All required parameters must be populated in order to send to Azure. + + :param name: Required. body parameter name. + :type name: str + :param value: Required. body parameter value. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TokenBodyParameterContract, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/token_body_parameter_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/token_body_parameter_contract_py3.py new file mode 100644 index 000000000000..737fc6853009 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/token_body_parameter_contract_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class TokenBodyParameterContract(Model): + """OAuth acquire token request body parameter (www-url-form-encoded). + + All required parameters must be populated in order to send to Azure. + + :param name: Required. body parameter name. + :type name: str + :param value: Required. body parameter value. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str, **kwargs) -> None: + super(TokenBodyParameterContract, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_contract.py new file mode 100644 index 000000000000..e231f588b45d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_contract.py @@ -0,0 +1,84 @@ +# 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 .resource import Resource + + +class UserContract(Resource): + """User details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param state: Account state. Specifies whether the user is active or not. + Blocked users are unable to sign into the developer portal or call any + APIs of subscribed products. Default state is Active. Possible values + include: 'active', 'blocked', 'pending', 'deleted'. Default value: + "active" . + :type state: str or ~azure.mgmt.apimanagement.models.UserState + :param note: Optional note about a user set by the administrator. + :type note: str + :ivar identities: Collection of user identities. + :vartype identities: + list[~azure.mgmt.apimanagement.models.UserIdentityContract] + :param first_name: First name. + :type first_name: str + :param last_name: Last name. + :type last_name: str + :param email: Email address. + :type email: str + :param registration_date: Date of user registration. The date conforms to + the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :type registration_date: datetime + :ivar groups: Collection of groups user is part of. + :vartype groups: + list[~azure.mgmt.apimanagement.models.GroupContractProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identities': {'readonly': True}, + 'groups': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'note': {'key': 'properties.note', 'type': 'str'}, + 'identities': {'key': 'properties.identities', 'type': '[UserIdentityContract]'}, + 'first_name': {'key': 'properties.firstName', 'type': 'str'}, + 'last_name': {'key': 'properties.lastName', 'type': 'str'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'registration_date': {'key': 'properties.registrationDate', 'type': 'iso-8601'}, + 'groups': {'key': 'properties.groups', 'type': '[GroupContractProperties]'}, + } + + def __init__(self, **kwargs): + super(UserContract, self).__init__(**kwargs) + self.state = kwargs.get('state', "active") + self.note = kwargs.get('note', None) + self.identities = None + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) + self.email = kwargs.get('email', None) + self.registration_date = kwargs.get('registration_date', None) + self.groups = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_contract_paged.py new file mode 100644 index 000000000000..a31093562e22 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_contract_paged.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 msrest.paging import Paged + + +class UserContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`UserContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[UserContract]'} + } + + def __init__(self, *args, **kwargs): + + super(UserContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_contract_py3.py new file mode 100644 index 000000000000..ce3909ac3acd --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_contract_py3.py @@ -0,0 +1,84 @@ +# 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 .resource import Resource + + +class UserContract(Resource): + """User details. + + Variables are only populated by 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 for API Management resource. + :vartype type: str + :param state: Account state. Specifies whether the user is active or not. + Blocked users are unable to sign into the developer portal or call any + APIs of subscribed products. Default state is Active. Possible values + include: 'active', 'blocked', 'pending', 'deleted'. Default value: + "active" . + :type state: str or ~azure.mgmt.apimanagement.models.UserState + :param note: Optional note about a user set by the administrator. + :type note: str + :ivar identities: Collection of user identities. + :vartype identities: + list[~azure.mgmt.apimanagement.models.UserIdentityContract] + :param first_name: First name. + :type first_name: str + :param last_name: Last name. + :type last_name: str + :param email: Email address. + :type email: str + :param registration_date: Date of user registration. The date conforms to + the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :type registration_date: datetime + :ivar groups: Collection of groups user is part of. + :vartype groups: + list[~azure.mgmt.apimanagement.models.GroupContractProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identities': {'readonly': True}, + 'groups': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'note': {'key': 'properties.note', 'type': 'str'}, + 'identities': {'key': 'properties.identities', 'type': '[UserIdentityContract]'}, + 'first_name': {'key': 'properties.firstName', 'type': 'str'}, + 'last_name': {'key': 'properties.lastName', 'type': 'str'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'registration_date': {'key': 'properties.registrationDate', 'type': 'iso-8601'}, + 'groups': {'key': 'properties.groups', 'type': '[GroupContractProperties]'}, + } + + def __init__(self, *, state="active", note: str=None, first_name: str=None, last_name: str=None, email: str=None, registration_date=None, **kwargs) -> None: + super(UserContract, self).__init__(, **kwargs) + self.state = state + self.note = note + self.identities = None + self.first_name = first_name + self.last_name = last_name + self.email = email + self.registration_date = registration_date + self.groups = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_create_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_create_parameters.py new file mode 100644 index 000000000000..abcd03a8f7cc --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_create_parameters.py @@ -0,0 +1,77 @@ +# 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 msrest.serialization import Model + + +class UserCreateParameters(Model): + """User create details. + + Variables are only 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 state: Account state. Specifies whether the user is active or not. + Blocked users are unable to sign into the developer portal or call any + APIs of subscribed products. Default state is Active. Possible values + include: 'active', 'blocked', 'pending', 'deleted'. Default value: + "active" . + :type state: str or ~azure.mgmt.apimanagement.models.UserState + :param note: Optional note about a user set by the administrator. + :type note: str + :ivar identities: Collection of user identities. + :vartype identities: + list[~azure.mgmt.apimanagement.models.UserIdentityContract] + :param email: Required. Email address. Must not be empty and must be + unique within the service instance. + :type email: str + :param first_name: Required. First name. + :type first_name: str + :param last_name: Required. Last name. + :type last_name: str + :param password: User Password. If no value is provided, a default + password is generated. + :type password: str + :param confirmation: Determines the type of confirmation e-mail that will + be sent to the newly created user. Possible values include: 'signup', + 'invite' + :type confirmation: str or ~azure.mgmt.apimanagement.models.Confirmation + """ + + _validation = { + 'identities': {'readonly': True}, + 'email': {'required': True, 'max_length': 254, 'min_length': 1}, + 'first_name': {'required': True, 'max_length': 100, 'min_length': 1}, + 'last_name': {'required': True, 'max_length': 100, 'min_length': 1}, + } + + _attribute_map = { + 'state': {'key': 'properties.state', 'type': 'str'}, + 'note': {'key': 'properties.note', 'type': 'str'}, + 'identities': {'key': 'properties.identities', 'type': '[UserIdentityContract]'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'first_name': {'key': 'properties.firstName', 'type': 'str'}, + 'last_name': {'key': 'properties.lastName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'confirmation': {'key': 'properties.confirmation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserCreateParameters, self).__init__(**kwargs) + self.state = kwargs.get('state', "active") + self.note = kwargs.get('note', None) + self.identities = None + self.email = kwargs.get('email', None) + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) + self.password = kwargs.get('password', None) + self.confirmation = kwargs.get('confirmation', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_create_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_create_parameters_py3.py new file mode 100644 index 000000000000..86aa48cc8924 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_create_parameters_py3.py @@ -0,0 +1,77 @@ +# 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 msrest.serialization import Model + + +class UserCreateParameters(Model): + """User create details. + + Variables are only 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 state: Account state. Specifies whether the user is active or not. + Blocked users are unable to sign into the developer portal or call any + APIs of subscribed products. Default state is Active. Possible values + include: 'active', 'blocked', 'pending', 'deleted'. Default value: + "active" . + :type state: str or ~azure.mgmt.apimanagement.models.UserState + :param note: Optional note about a user set by the administrator. + :type note: str + :ivar identities: Collection of user identities. + :vartype identities: + list[~azure.mgmt.apimanagement.models.UserIdentityContract] + :param email: Required. Email address. Must not be empty and must be + unique within the service instance. + :type email: str + :param first_name: Required. First name. + :type first_name: str + :param last_name: Required. Last name. + :type last_name: str + :param password: User Password. If no value is provided, a default + password is generated. + :type password: str + :param confirmation: Determines the type of confirmation e-mail that will + be sent to the newly created user. Possible values include: 'signup', + 'invite' + :type confirmation: str or ~azure.mgmt.apimanagement.models.Confirmation + """ + + _validation = { + 'identities': {'readonly': True}, + 'email': {'required': True, 'max_length': 254, 'min_length': 1}, + 'first_name': {'required': True, 'max_length': 100, 'min_length': 1}, + 'last_name': {'required': True, 'max_length': 100, 'min_length': 1}, + } + + _attribute_map = { + 'state': {'key': 'properties.state', 'type': 'str'}, + 'note': {'key': 'properties.note', 'type': 'str'}, + 'identities': {'key': 'properties.identities', 'type': '[UserIdentityContract]'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'first_name': {'key': 'properties.firstName', 'type': 'str'}, + 'last_name': {'key': 'properties.lastName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'confirmation': {'key': 'properties.confirmation', 'type': 'str'}, + } + + def __init__(self, *, email: str, first_name: str, last_name: str, state="active", note: str=None, password: str=None, confirmation=None, **kwargs) -> None: + super(UserCreateParameters, self).__init__(**kwargs) + self.state = state + self.note = note + self.identities = None + self.email = email + self.first_name = first_name + self.last_name = last_name + self.password = password + self.confirmation = confirmation diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_entity_base_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_entity_base_parameters.py new file mode 100644 index 000000000000..4f5724636981 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_entity_base_parameters.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class UserEntityBaseParameters(Model): + """User Entity Base Parameters set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param state: Account state. Specifies whether the user is active or not. + Blocked users are unable to sign into the developer portal or call any + APIs of subscribed products. Default state is Active. Possible values + include: 'active', 'blocked', 'pending', 'deleted'. Default value: + "active" . + :type state: str or ~azure.mgmt.apimanagement.models.UserState + :param note: Optional note about a user set by the administrator. + :type note: str + :ivar identities: Collection of user identities. + :vartype identities: + list[~azure.mgmt.apimanagement.models.UserIdentityContract] + """ + + _validation = { + 'identities': {'readonly': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'note': {'key': 'note', 'type': 'str'}, + 'identities': {'key': 'identities', 'type': '[UserIdentityContract]'}, + } + + def __init__(self, **kwargs): + super(UserEntityBaseParameters, self).__init__(**kwargs) + self.state = kwargs.get('state', "active") + self.note = kwargs.get('note', None) + self.identities = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_entity_base_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_entity_base_parameters_py3.py new file mode 100644 index 000000000000..1e3fe35a8fcb --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_entity_base_parameters_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class UserEntityBaseParameters(Model): + """User Entity Base Parameters set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param state: Account state. Specifies whether the user is active or not. + Blocked users are unable to sign into the developer portal or call any + APIs of subscribed products. Default state is Active. Possible values + include: 'active', 'blocked', 'pending', 'deleted'. Default value: + "active" . + :type state: str or ~azure.mgmt.apimanagement.models.UserState + :param note: Optional note about a user set by the administrator. + :type note: str + :ivar identities: Collection of user identities. + :vartype identities: + list[~azure.mgmt.apimanagement.models.UserIdentityContract] + """ + + _validation = { + 'identities': {'readonly': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'note': {'key': 'note', 'type': 'str'}, + 'identities': {'key': 'identities', 'type': '[UserIdentityContract]'}, + } + + def __init__(self, *, state="active", note: str=None, **kwargs) -> None: + super(UserEntityBaseParameters, self).__init__(**kwargs) + self.state = state + self.note = note + self.identities = None diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_identity_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_identity_contract.py new file mode 100644 index 000000000000..1e0bd1a8ac33 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_identity_contract.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UserIdentityContract(Model): + """User identity details. + + :param provider: Identity provider name. + :type provider: str + :param id: Identifier value within provider. + :type id: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserIdentityContract, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_identity_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_identity_contract_paged.py new file mode 100644 index 000000000000..f1f4040a5e7b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_identity_contract_paged.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 msrest.paging import Paged + + +class UserIdentityContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`UserIdentityContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[UserIdentityContract]'} + } + + def __init__(self, *args, **kwargs): + + super(UserIdentityContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_identity_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_identity_contract_py3.py new file mode 100644 index 000000000000..880bf2e0336a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_identity_contract_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UserIdentityContract(Model): + """User identity details. + + :param provider: Identity provider name. + :type provider: str + :param id: Identifier value within provider. + :type id: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, id: str=None, **kwargs) -> None: + super(UserIdentityContract, self).__init__(**kwargs) + self.provider = provider + self.id = id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_parameters.py new file mode 100644 index 000000000000..09dce2f8d41b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_parameters.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class UserTokenParameters(Model): + """Parameters supplied to the Get User Token operation. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The Key to be used to generate token for user. + Possible values include: 'primary', 'secondary'. Default value: "primary" + . + :type key_type: str or ~azure.mgmt.apimanagement.models.KeyType + :param expiry: Required. The Expiry time of the Token. Maximum token + expiry time is set to 30 days. The date conforms to the following format: + `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + :type expiry: datetime + """ + + _validation = { + 'key_type': {'required': True}, + 'expiry': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'KeyType'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(UserTokenParameters, self).__init__(**kwargs) + self.key_type = kwargs.get('key_type', "primary") + self.expiry = kwargs.get('expiry', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_parameters_py3.py new file mode 100644 index 000000000000..fb49f3fd030e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_parameters_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class UserTokenParameters(Model): + """Parameters supplied to the Get User Token operation. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The Key to be used to generate token for user. + Possible values include: 'primary', 'secondary'. Default value: "primary" + . + :type key_type: str or ~azure.mgmt.apimanagement.models.KeyType + :param expiry: Required. The Expiry time of the Token. Maximum token + expiry time is set to 30 days. The date conforms to the following format: + `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + :type expiry: datetime + """ + + _validation = { + 'key_type': {'required': True}, + 'expiry': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'KeyType'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + } + + def __init__(self, *, expiry, key_type="primary", **kwargs) -> None: + super(UserTokenParameters, self).__init__(**kwargs) + self.key_type = key_type + self.expiry = expiry diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_result.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_result.py new file mode 100644 index 000000000000..d124715b1855 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_result.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class UserTokenResult(Model): + """Get User Token response details. + + :param value: Shared Access Authorization token for the User. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserTokenResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_result_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_result_py3.py new file mode 100644 index 000000000000..466feaef0a44 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_token_result_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class UserTokenResult(Model): + """Get User Token response details. + + :param value: Shared Access Authorization token for the User. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, **kwargs) -> None: + super(UserTokenResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_update_parameters.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_update_parameters.py new file mode 100644 index 000000000000..004573972d31 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_update_parameters.py @@ -0,0 +1,68 @@ +# 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 msrest.serialization import Model + + +class UserUpdateParameters(Model): + """User update parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param state: Account state. Specifies whether the user is active or not. + Blocked users are unable to sign into the developer portal or call any + APIs of subscribed products. Default state is Active. Possible values + include: 'active', 'blocked', 'pending', 'deleted'. Default value: + "active" . + :type state: str or ~azure.mgmt.apimanagement.models.UserState + :param note: Optional note about a user set by the administrator. + :type note: str + :ivar identities: Collection of user identities. + :vartype identities: + list[~azure.mgmt.apimanagement.models.UserIdentityContract] + :param email: Email address. Must not be empty and must be unique within + the service instance. + :type email: str + :param password: User Password. + :type password: str + :param first_name: First name. + :type first_name: str + :param last_name: Last name. + :type last_name: str + """ + + _validation = { + 'identities': {'readonly': True}, + 'email': {'max_length': 254, 'min_length': 1}, + 'first_name': {'max_length': 100, 'min_length': 1}, + 'last_name': {'max_length': 100, 'min_length': 1}, + } + + _attribute_map = { + 'state': {'key': 'properties.state', 'type': 'str'}, + 'note': {'key': 'properties.note', 'type': 'str'}, + 'identities': {'key': 'properties.identities', 'type': '[UserIdentityContract]'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'first_name': {'key': 'properties.firstName', 'type': 'str'}, + 'last_name': {'key': 'properties.lastName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserUpdateParameters, self).__init__(**kwargs) + self.state = kwargs.get('state', "active") + self.note = kwargs.get('note', None) + self.identities = None + self.email = kwargs.get('email', None) + self.password = kwargs.get('password', None) + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_update_parameters_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_update_parameters_py3.py new file mode 100644 index 000000000000..1d70413aff74 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/user_update_parameters_py3.py @@ -0,0 +1,68 @@ +# 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 msrest.serialization import Model + + +class UserUpdateParameters(Model): + """User update parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param state: Account state. Specifies whether the user is active or not. + Blocked users are unable to sign into the developer portal or call any + APIs of subscribed products. Default state is Active. Possible values + include: 'active', 'blocked', 'pending', 'deleted'. Default value: + "active" . + :type state: str or ~azure.mgmt.apimanagement.models.UserState + :param note: Optional note about a user set by the administrator. + :type note: str + :ivar identities: Collection of user identities. + :vartype identities: + list[~azure.mgmt.apimanagement.models.UserIdentityContract] + :param email: Email address. Must not be empty and must be unique within + the service instance. + :type email: str + :param password: User Password. + :type password: str + :param first_name: First name. + :type first_name: str + :param last_name: Last name. + :type last_name: str + """ + + _validation = { + 'identities': {'readonly': True}, + 'email': {'max_length': 254, 'min_length': 1}, + 'first_name': {'max_length': 100, 'min_length': 1}, + 'last_name': {'max_length': 100, 'min_length': 1}, + } + + _attribute_map = { + 'state': {'key': 'properties.state', 'type': 'str'}, + 'note': {'key': 'properties.note', 'type': 'str'}, + 'identities': {'key': 'properties.identities', 'type': '[UserIdentityContract]'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'first_name': {'key': 'properties.firstName', 'type': 'str'}, + 'last_name': {'key': 'properties.lastName', 'type': 'str'}, + } + + def __init__(self, *, state="active", note: str=None, email: str=None, password: str=None, first_name: str=None, last_name: str=None, **kwargs) -> None: + super(UserUpdateParameters, self).__init__(**kwargs) + self.state = state + self.note = note + self.identities = None + self.email = email + self.password = password + self.first_name = first_name + self.last_name = last_name diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration.py new file mode 100644 index 000000000000..2bc74d949399 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class VirtualNetworkConfiguration(Model): + """Configuration of a virtual network to which API Management service is + deployed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar vnetid: The virtual network ID. This is typically a GUID. Expect a + null GUID by default. + :vartype vnetid: str + :ivar subnetname: The name of the subnet. + :vartype subnetname: str + :param subnet_resource_id: The full resource ID of a subnet in a virtual + network to deploy the API Management service in. + :type subnet_resource_id: str + """ + + _validation = { + 'vnetid': {'readonly': True}, + 'subnetname': {'readonly': True}, + 'subnet_resource_id': {'pattern': r'^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$'}, + } + + _attribute_map = { + 'vnetid': {'key': 'vnetid', 'type': 'str'}, + 'subnetname': {'key': 'subnetname', 'type': 'str'}, + 'subnet_resource_id': {'key': 'subnetResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkConfiguration, self).__init__(**kwargs) + self.vnetid = None + self.subnetname = None + self.subnet_resource_id = kwargs.get('subnet_resource_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration_py3.py new file mode 100644 index 000000000000..1cfd6c15d5a9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class VirtualNetworkConfiguration(Model): + """Configuration of a virtual network to which API Management service is + deployed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar vnetid: The virtual network ID. This is typically a GUID. Expect a + null GUID by default. + :vartype vnetid: str + :ivar subnetname: The name of the subnet. + :vartype subnetname: str + :param subnet_resource_id: The full resource ID of a subnet in a virtual + network to deploy the API Management service in. + :type subnet_resource_id: str + """ + + _validation = { + 'vnetid': {'readonly': True}, + 'subnetname': {'readonly': True}, + 'subnet_resource_id': {'pattern': r'^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$'}, + } + + _attribute_map = { + 'vnetid': {'key': 'vnetid', 'type': 'str'}, + 'subnetname': {'key': 'subnetname', 'type': 'str'}, + 'subnet_resource_id': {'key': 'subnetResourceId', 'type': 'str'}, + } + + def __init__(self, *, subnet_resource_id: str=None, **kwargs) -> None: + super(VirtualNetworkConfiguration, self).__init__(**kwargs) + self.vnetid = None + self.subnetname = None + self.subnet_resource_id = subnet_resource_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/x509_certificate_name.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/x509_certificate_name.py new file mode 100644 index 000000000000..625c689ce7d2 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/x509_certificate_name.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class X509CertificateName(Model): + """Properties of server X509Names. + + :param name: Common Name of the Certificate. + :type name: str + :param issuer_certificate_thumbprint: Thumbprint for the Issuer of the + Certificate. + :type issuer_certificate_thumbprint: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'issuer_certificate_thumbprint': {'key': 'issuerCertificateThumbprint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(X509CertificateName, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.issuer_certificate_thumbprint = kwargs.get('issuer_certificate_thumbprint', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/x509_certificate_name_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/x509_certificate_name_py3.py new file mode 100644 index 000000000000..6a0e571d3296 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/x509_certificate_name_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class X509CertificateName(Model): + """Properties of server X509Names. + + :param name: Common Name of the Certificate. + :type name: str + :param issuer_certificate_thumbprint: Thumbprint for the Issuer of the + Certificate. + :type issuer_certificate_thumbprint: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'issuer_certificate_thumbprint': {'key': 'issuerCertificateThumbprint', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, issuer_certificate_thumbprint: str=None, **kwargs) -> None: + super(X509CertificateName, self).__init__(**kwargs) + self.name = name + self.issuer_certificate_thumbprint = issuer_certificate_thumbprint diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py new file mode 100644 index 000000000000..d9a744f4ab9d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py @@ -0,0 +1,126 @@ +# 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 .policy_operations import PolicyOperations +from .policy_snippets_operations import PolicySnippetsOperations +from .regions_operations import RegionsOperations +from .api_operations import ApiOperations +from .api_revisions_operations import ApiRevisionsOperations +from .api_release_operations import ApiReleaseOperations +from .api_operation_operations import ApiOperationOperations +from .api_operation_policy_operations import ApiOperationPolicyOperations +from .api_product_operations import ApiProductOperations +from .api_policy_operations import ApiPolicyOperations +from .api_schema_operations import ApiSchemaOperations +from .api_diagnostic_operations import ApiDiagnosticOperations +from .api_diagnostic_logger_operations import ApiDiagnosticLoggerOperations +from .authorization_server_operations import AuthorizationServerOperations +from .backend_operations import BackendOperations +from .certificate_operations import CertificateOperations +from .api_management_operations import ApiManagementOperations +from .api_management_service_operations import ApiManagementServiceOperations +from .diagnostic_operations import DiagnosticOperations +from .diagnostic_logger_operations import DiagnosticLoggerOperations +from .email_template_operations import EmailTemplateOperations +from .group_operations import GroupOperations +from .group_user_operations import GroupUserOperations +from .identity_provider_operations import IdentityProviderOperations +from .logger_operations import LoggerOperations +from .notification_operations import NotificationOperations +from .notification_recipient_user_operations import NotificationRecipientUserOperations +from .notification_recipient_email_operations import NotificationRecipientEmailOperations +from .network_status_operations import NetworkStatusOperations +from .open_id_connect_provider_operations import OpenIdConnectProviderOperations +from .sign_in_settings_operations import SignInSettingsOperations +from .sign_up_settings_operations import SignUpSettingsOperations +from .delegation_settings_operations import DelegationSettingsOperations +from .product_operations import ProductOperations +from .product_api_operations import ProductApiOperations +from .product_group_operations import ProductGroupOperations +from .product_subscriptions_operations import ProductSubscriptionsOperations +from .product_policy_operations import ProductPolicyOperations +from .property_operations import PropertyOperations +from .quota_by_counter_keys_operations import QuotaByCounterKeysOperations +from .quota_by_period_keys_operations import QuotaByPeriodKeysOperations +from .reports_operations import ReportsOperations +from .subscription_operations import SubscriptionOperations +from .tag_resource_operations import TagResourceOperations +from .tag_operations import TagOperations +from .tag_description_operations import TagDescriptionOperations +from .operation_operations import OperationOperations +from .tenant_access_operations import TenantAccessOperations +from .tenant_access_git_operations import TenantAccessGitOperations +from .tenant_configuration_operations import TenantConfigurationOperations +from .user_operations import UserOperations +from .user_group_operations import UserGroupOperations +from .user_subscription_operations import UserSubscriptionOperations +from .user_identities_operations import UserIdentitiesOperations +from .api_version_set_operations import ApiVersionSetOperations +from .api_export_operations import ApiExportOperations + +__all__ = [ + 'PolicyOperations', + 'PolicySnippetsOperations', + 'RegionsOperations', + 'ApiOperations', + 'ApiRevisionsOperations', + 'ApiReleaseOperations', + 'ApiOperationOperations', + 'ApiOperationPolicyOperations', + 'ApiProductOperations', + 'ApiPolicyOperations', + 'ApiSchemaOperations', + 'ApiDiagnosticOperations', + 'ApiDiagnosticLoggerOperations', + 'AuthorizationServerOperations', + 'BackendOperations', + 'CertificateOperations', + 'ApiManagementOperations', + 'ApiManagementServiceOperations', + 'DiagnosticOperations', + 'DiagnosticLoggerOperations', + 'EmailTemplateOperations', + 'GroupOperations', + 'GroupUserOperations', + 'IdentityProviderOperations', + 'LoggerOperations', + 'NotificationOperations', + 'NotificationRecipientUserOperations', + 'NotificationRecipientEmailOperations', + 'NetworkStatusOperations', + 'OpenIdConnectProviderOperations', + 'SignInSettingsOperations', + 'SignUpSettingsOperations', + 'DelegationSettingsOperations', + 'ProductOperations', + 'ProductApiOperations', + 'ProductGroupOperations', + 'ProductSubscriptionsOperations', + 'ProductPolicyOperations', + 'PropertyOperations', + 'QuotaByCounterKeysOperations', + 'QuotaByPeriodKeysOperations', + 'ReportsOperations', + 'SubscriptionOperations', + 'TagResourceOperations', + 'TagOperations', + 'TagDescriptionOperations', + 'OperationOperations', + 'TenantAccessOperations', + 'TenantAccessGitOperations', + 'TenantConfigurationOperations', + 'UserOperations', + 'UserGroupOperations', + 'UserSubscriptionOperations', + 'UserIdentitiesOperations', + 'ApiVersionSetOperations', + 'ApiExportOperations', +] diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_diagnostic_logger_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_diagnostic_logger_operations.py new file mode 100644 index 000000000000..79125ba73383 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_diagnostic_logger_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiDiagnosticLoggerOperations(object): + """ApiDiagnosticLoggerOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, api_id, diagnostic_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all loggers assosiated with the specified Diagnostic of an API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | type | eq | + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LoggerContract + :rtype: + ~azure.mgmt.apimanagement.models.LoggerContractPaged[~azure.mgmt.apimanagement.models.LoggerContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.LoggerContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LoggerContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers'} + + def check_entity_exists( + self, resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers=None, raw=False, **operation_config): + """Checks that logger entity specified by identifier is associated with + the diagnostics entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.check_entity_exists.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers=None, raw=False, **operation_config): + """Attaches a logger to a dignostic for an API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LoggerContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LoggerContract', response) + if response.status_code == 201: + deserialized = self._deserialize('LoggerContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}'} + + def delete( + self, resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers=None, raw=False, **operation_config): + """Deletes the specified Logger from Diagnostic for an API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_diagnostic_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_diagnostic_operations.py new file mode 100644 index 000000000000..bd5a10c2842b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_diagnostic_operations.py @@ -0,0 +1,494 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiDiagnosticOperations(object): + """ApiDiagnosticOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, api_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all diagnostics of an API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DiagnosticContract + :rtype: + ~azure.mgmt.apimanagement.models.DiagnosticContractPaged[~azure.mgmt.apimanagement.models.DiagnosticContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DiagnosticContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DiagnosticContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics'} + + def get_entity_tag( + self, resource_group_name, service_name, api_id, diagnostic_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the Diagnostic for an API + specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} + + def get( + self, resource_group_name, service_name, api_id, diagnostic_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the Diagnostic for an API specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DiagnosticContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('DiagnosticContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, diagnostic_id, enabled, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates a new Diagnostic for an API or updates an existing one. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param enabled: Indicates whether a diagnostic should receive data or + not. + :type enabled: bool + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DiagnosticContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.DiagnosticContract(enabled=enabled) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DiagnosticContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DiagnosticContract', response) + if response.status_code == 201: + deserialized = self._deserialize('DiagnosticContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} + + def update( + self, resource_group_name, service_name, api_id, diagnostic_id, if_match, enabled, custom_headers=None, raw=False, **operation_config): + """Updates the details of the Diagnostic for an API specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param enabled: Indicates whether a diagnostic should receive data or + not. + :type enabled: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.DiagnosticContract(enabled=enabled) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DiagnosticContract') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} + + def delete( + self, resource_group_name, service_name, api_id, diagnostic_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified Diagnostic from an API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_export_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_export_operations.py new file mode 100644 index 000000000000..d6041f4f8b45 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_export_operations.py @@ -0,0 +1,112 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiExportOperations(object): + """ApiExportOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar export: Query parameter required to export the API details. Constant value: "true". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.export = "true" + self.api_version = "2018-01-01" + + self.config = config + + def get( + self, resource_group_name, service_name, api_id, format, custom_headers=None, raw=False, **operation_config): + """Gets the details of the API specified by its identifier in the format + specified to the Storage Blob with SAS Key valid for 5 minutes. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param format: Format in which to export the Api Details to the + Storage Blob with Sas Key valid for 5 minutes. Possible values + include: 'Swagger', 'Wsdl', 'Wadl' + :type format: str or ~azure.mgmt.apimanagement.models.ExportFormat + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiExportResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiExportResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['format'] = self._serialize.query("format", format, 'str') + query_parameters['export'] = self._serialize.query("self.export", self.export, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_management_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_management_operations.py new file mode 100644 index 000000000000..9d40ef2e8a98 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_management_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ApiManagementOperations(object): + """ApiManagementOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available REST API operations of the + Microsoft.ApiManagement provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.apimanagement.models.OperationPaged[~azure.mgmt.apimanagement.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ApiManagement/operations'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_management_service_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_management_service_operations.py new file mode 100644 index 000000000000..66dec053aa83 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_management_service_operations.py @@ -0,0 +1,1138 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ApiManagementServiceOperations(object): + """ApiManagementServiceOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _restore_initial( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.restore.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiManagementServiceBackupRestoreParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def restore( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Restores a backup of an API Management service created using the + ApiManagementService_Backup operation on the current service. This is a + long running operation and could take several minutes to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param parameters: Parameters supplied to the Restore API Management + service from backup operation. + :type parameters: + ~azure.mgmt.apimanagement.models.ApiManagementServiceBackupRestoreParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApiManagementServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.ApiManagementServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._restore_initial( + resource_group_name=resource_group_name, + service_name=service_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore'} + + + def _backup_initial( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.backup.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiManagementServiceBackupRestoreParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def backup( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a backup of the API Management service to the given Azure + Storage Account. This is long running operation and could take several + minutes to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param parameters: Parameters supplied to the + ApiManagementService_Backup operation. + :type parameters: + ~azure.mgmt.apimanagement.models.ApiManagementServiceBackupRestoreParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApiManagementServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.ApiManagementServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._backup_initial( + resource_group_name=resource_group_name, + service_name=service_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiManagementServiceResource') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ApiManagementServiceResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an API Management service. This is long running + operation and could take several minutes to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param parameters: Parameters supplied to the CreateOrUpdate API + Management service operation. + :type parameters: + ~azure.mgmt.apimanagement.models.ApiManagementServiceResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApiManagementServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.ApiManagementServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} + + + def _update_initial( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiManagementServiceUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an existing API Management service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param parameters: Parameters supplied to the CreateOrUpdate API + Management service operation. + :type parameters: + ~azure.mgmt.apimanagement.models.ApiManagementServiceUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApiManagementServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.ApiManagementServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets an API Management service resource description. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiManagementServiceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} + + def delete( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Deletes an existing API Management service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List all API Management services within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApiManagementServiceResource + :rtype: + ~azure.mgmt.apimanagement.models.ApiManagementServiceResourcePaged[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ApiManagementServiceResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApiManagementServiceResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all API Management services within an Azure subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApiManagementServiceResource + :rtype: + ~azure.mgmt.apimanagement.models.ApiManagementServiceResourcePaged[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ApiManagementServiceResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApiManagementServiceResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service'} + + def get_sso_token( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets the Single-Sign-On token for the API Management Service which is + valid for 5 Minutes. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiManagementServiceGetSsoTokenResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.apimanagement.models.ApiManagementServiceGetSsoTokenResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_sso_token.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceGetSsoTokenResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_sso_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken'} + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks availability and correctness of a name for an API Management + service. + + :param name: The name to check for availability. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiManagementServiceNameAvailabilityResult or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.apimanagement.models.ApiManagementServiceNameAvailabilityResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.ApiManagementServiceCheckNameAvailabilityParameters(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiManagementServiceCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability'} + + + def _apply_network_configuration_updates_initial( + self, resource_group_name, service_name, location=None, custom_headers=None, raw=False, **operation_config): + parameters = None + if location is not None: + parameters = models.ApiManagementServiceApplyNetworkConfigurationParameters(location=location) + + # Construct URL + url = self.apply_network_configuration_updates.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'ApiManagementServiceApplyNetworkConfigurationParameters') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def apply_network_configuration_updates( + self, resource_group_name, service_name, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the Microsoft.ApiManagement resource running in the Virtual + network to pick the updated network settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param location: Location of the Api Management service to update for + a multi-region service. For a service deployed in a single region, + this parameter is not required. + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApiManagementServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.ApiManagementServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._apply_network_configuration_updates_initial( + resource_group_name=resource_group_name, + service_name=service_name, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + apply_network_configuration_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates'} + + def upload_certificate( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, **operation_config): + """Upload Custom Domain SSL certificate for an API Management service. + This operation will be deprecated in future releases. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param parameters: Parameters supplied to the Upload SSL certificate + for an API Management service operation. + :type parameters: + ~azure.mgmt.apimanagement.models.ApiManagementServiceUploadCertificateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateInformation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.CertificateInformation or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.upload_certificate.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiManagementServiceUploadCertificateParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateInformation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + upload_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatecertificate'} + + + def _update_hostname_initial( + self, resource_group_name, service_name, update=None, delete=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ApiManagementServiceUpdateHostnameParameters(update=update, delete=delete) + + # Construct URL + url = self.update_hostname.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiManagementServiceUpdateHostnameParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_hostname( + self, resource_group_name, service_name, update=None, delete=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates, updates, or deletes the custom hostnames for an API Management + service. The custom hostname can be applied to the Proxy and Portal + endpoint. This is a long running operation and could take several + minutes to complete. This operation will be deprecated in the next + version update. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param update: Hostnames to create or update. + :type update: + list[~azure.mgmt.apimanagement.models.HostnameConfigurationOld] + :param delete: Hostnames types to delete. + :type delete: list[str or + ~azure.mgmt.apimanagement.models.HostnameType] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApiManagementServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.ApiManagementServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_hostname_initial( + resource_group_name=resource_group_name, + service_name=service_name, + update=update, + delete=delete, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApiManagementServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_hostname.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatehostname'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_operations.py new file mode 100644 index 000000000000..a59fa1394d30 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_operations.py @@ -0,0 +1,500 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiOperationOperations(object): + """ApiOperationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_api( + self, resource_group_name, service_name, api_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of the operations for the specified API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + | name | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | method | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | description | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | urlTemplate | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OperationContract + :rtype: + ~azure.mgmt.apimanagement.models.OperationContractPaged[~azure.mgmt.apimanagement.models.OperationContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations'} + + def get_entity_tag( + self, resource_group_name, service_name, api_id, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the API operation specified by + its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} + + def get( + self, resource_group_name, service_name, api_id, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the API Operation specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.OperationContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('OperationContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, operation_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates a new operation in the API or updates an existing one. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param parameters: Create parameters. + :type parameters: ~azure.mgmt.apimanagement.models.OperationContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.OperationContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'OperationContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationContract', response) + if response.status_code == 201: + deserialized = self._deserialize('OperationContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} + + def update( + self, resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates the details of the operation in the API specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param parameters: API Operation Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.OperationUpdateContract + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'OperationUpdateContract') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} + + def delete( + self, resource_group_name, service_name, api_id, operation_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified operation in the API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_policy_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_policy_operations.py new file mode 100644 index 000000000000..3cb9b3ca0d50 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_policy_operations.py @@ -0,0 +1,411 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiOperationPolicyOperations(object): + """ApiOperationPolicyOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar policy_id: The identifier of the Policy. Constant value: "policy". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + self.policy_id = "policy" + + self.config = config + + def list_by_operation( + self, resource_group_name, service_name, api_id, operation_id, custom_headers=None, raw=False, **operation_config): + """Get the list of policy configuration at the API Operation level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_operation.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies'} + + def get_entity_tag( + self, resource_group_name, service_name, api_id, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the API operation policy + specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} + + def get( + self, resource_group_name, service_name, api_id, operation_id, custom_headers=None, raw=False, **operation_config): + """Get the policy configuration at the API Operation level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PolicyContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, operation_id, policy_content, if_match=None, content_format="xml", custom_headers=None, raw=False, **operation_config): + """Creates or updates policy configuration for the API Operation level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param policy_content: Json escaped Xml Encoded contents of the + Policy. + :type policy_content: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param content_format: Format of the policyContent. Possible values + include: 'xml', 'xml-link' + :type content_format: str or + ~azure.mgmt.apimanagement.models.PolicyContentFormat + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PolicyContract(policy_content=policy_content, content_format=content_format) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PolicyContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyContract', response) + if response.status_code == 201: + deserialized = self._deserialize('PolicyContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} + + def delete( + self, resource_group_name, service_name, api_id, operation_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the policy configuration at the Api Operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operations.py new file mode 100644 index 000000000000..9c173b97b08b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operations.py @@ -0,0 +1,596 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ApiOperations(object): + """ApiOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, expand_api_version_set=False, custom_headers=None, raw=False, **operation_config): + """Lists all APIs of the API Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | name | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | description | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | serviceUrl | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | path | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param expand_api_version_set: Include full ApiVersionSet resource in + response + :type expand_api_version_set: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApiContract + :rtype: + ~azure.mgmt.apimanagement.models.ApiContractPaged[~azure.mgmt.apimanagement.models.ApiContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand_api_version_set is not None: + query_parameters['expandApiVersionSet'] = self._serialize.query("expand_api_version_set", expand_api_version_set, 'bool') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ApiContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApiContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis'} + + def get_entity_tag( + self, resource_group_name, service_name, api_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the API specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} + + def get( + self, resource_group_name, service_name, api_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the API specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ApiContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates new or updates existing specified API of the API Management + service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param parameters: Create or update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.ApiCreateOrUpdateParameter + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiCreateOrUpdateParameter') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ApiContract', response) + header_dict = { + 'ETag': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('ApiContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} + + def update( + self, resource_group_name, service_name, api_id, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates the specified API of the API Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param parameters: API Update Contract parameters. + :type parameters: ~azure.mgmt.apimanagement.models.ApiUpdateContract + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiUpdateContract') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} + + def delete( + self, resource_group_name, service_name, api_id, if_match, delete_revisions=None, custom_headers=None, raw=False, **operation_config): + """Deletes the specified API of the API Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param delete_revisions: Delete all revisions of the Api. + :type delete_revisions: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if delete_revisions is not None: + query_parameters['deleteRevisions'] = self._serialize.query("delete_revisions", delete_revisions, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} + + def list_by_tags( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of apis associated with tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | aid | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | path | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | isCurrent | eq | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TagResourceContract + :rtype: + ~azure.mgmt.apimanagement.models.TagResourceContractPaged[~azure.mgmt.apimanagement.models.TagResourceContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TagResourceContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TagResourceContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apisByTags'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_policy_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_policy_operations.py new file mode 100644 index 000000000000..83fdff87d9e0 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_policy_operations.py @@ -0,0 +1,396 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiPolicyOperations(object): + """ApiPolicyOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar policy_id: The identifier of the Policy. Constant value: "policy". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + self.policy_id = "policy" + + self.config = config + + def list_by_api( + self, resource_group_name, service_name, api_id, custom_headers=None, raw=False, **operation_config): + """Get the policy configuration at the API level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PolicyCollection', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies'} + + def get_entity_tag( + self, resource_group_name, service_name, api_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the API policy specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} + + def get( + self, resource_group_name, service_name, api_id, custom_headers=None, raw=False, **operation_config): + """Get the policy configuration at the API level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PolicyContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, policy_content, if_match=None, content_format="xml", custom_headers=None, raw=False, **operation_config): + """Creates or updates policy configuration for the API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param policy_content: Json escaped Xml Encoded contents of the + Policy. + :type policy_content: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param content_format: Format of the policyContent. Possible values + include: 'xml', 'xml-link' + :type content_format: str or + ~azure.mgmt.apimanagement.models.PolicyContentFormat + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PolicyContract(policy_content=policy_content, content_format=content_format) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PolicyContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyContract', response) + if response.status_code == 201: + deserialized = self._deserialize('PolicyContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} + + def delete( + self, resource_group_name, service_name, api_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the policy configuration at the Api. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_product_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_product_operations.py new file mode 100644 index 000000000000..8efea01ad3d6 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_product_operations.py @@ -0,0 +1,127 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiProductOperations(object): + """ApiProductOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_apis( + self, resource_group_name, service_name, api_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all Products, which the API is part of. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param filter: | Field | Supported operators | Supported functions + | + |-------|------------------------|---------------------------------------------| + | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ProductContract + :rtype: + ~azure.mgmt.apimanagement.models.ProductContractPaged[~azure.mgmt.apimanagement.models.ProductContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_apis.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProductContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProductContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_apis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/products'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_release_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_release_operations.py new file mode 100644 index 000000000000..d914619fd2e3 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_release_operations.py @@ -0,0 +1,488 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiReleaseOperations(object): + """ApiReleaseOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, service_name, api_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all releases of an API. An API release is created when making an + API Revision current. Releases are also used to rollback to previous + revisions. Results will be paged and can be constrained by the $top and + $skip parameters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param filter: | Field | Supported operators | Supported functions + | + |-------|------------------------|---------------------------------------------| + | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + |notes|ge le eq ne gt lt|substringof contains startswith endswith| + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApiReleaseContract + :rtype: + ~azure.mgmt.apimanagement.models.ApiReleaseContractPaged[~azure.mgmt.apimanagement.models.ApiReleaseContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ApiReleaseContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApiReleaseContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases'} + + def get_entity_tag( + self, resource_group_name, service_name, api_id, release_id, custom_headers=None, raw=False, **operation_config): + """Returns the etag of an API release. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param release_id: Release identifier within an API. Must be unique in + the current API Management service instance. + :type release_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'releaseId': self._serialize.url("release_id", release_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} + + def get( + self, resource_group_name, service_name, api_id, release_id, custom_headers=None, raw=False, **operation_config): + """Returns the details of an API release. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param release_id: Release identifier within an API. Must be unique in + the current API Management service instance. + :type release_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiReleaseContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiReleaseContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'releaseId': self._serialize.url("release_id", release_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiReleaseContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} + + def create( + self, resource_group_name, service_name, api_id, release_id, api_id1=None, notes=None, custom_headers=None, raw=False, **operation_config): + """Creates a new Release for the API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param release_id: Release identifier within an API. Must be unique in + the current API Management service instance. + :type release_id: str + :param api_id1: Identifier of the API the release belongs to. + :type api_id1: str + :param notes: Release Notes + :type notes: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiReleaseContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiReleaseContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.ApiReleaseContract(notes=notes) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'releaseId': self._serialize.url("release_id", release_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiReleaseContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiReleaseContract', response) + if response.status_code == 201: + deserialized = self._deserialize('ApiReleaseContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} + + def update( + self, resource_group_name, service_name, api_id, release_id, if_match, api_id1=None, notes=None, custom_headers=None, raw=False, **operation_config): + """Updates the details of the release of the API specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param release_id: Release identifier within an API. Must be unique in + the current API Management service instance. + :type release_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param api_id1: Identifier of the API the release belongs to. + :type api_id1: str + :param notes: Release Notes + :type notes: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.ApiReleaseContract(notes=notes) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'releaseId': self._serialize.url("release_id", release_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiReleaseContract') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} + + def delete( + self, resource_group_name, service_name, api_id, release_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified release in the API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param release_id: Release identifier within an API. Must be unique in + the current API Management service instance. + :type release_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'releaseId': self._serialize.url("release_id", release_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_revisions_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_revisions_operations.py new file mode 100644 index 000000000000..3081080e2019 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_revisions_operations.py @@ -0,0 +1,127 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiRevisionsOperations(object): + """ApiRevisionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, service_name, api_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all revisions of an API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith| + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApiRevisionContract + :rtype: + ~azure.mgmt.apimanagement.models.ApiRevisionContractPaged[~azure.mgmt.apimanagement.models.ApiRevisionContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ApiRevisionContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApiRevisionContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/revisions'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_schema_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_schema_operations.py new file mode 100644 index 000000000000..582a4af5dcbc --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_schema_operations.py @@ -0,0 +1,410 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiSchemaOperations(object): + """ApiSchemaOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_api( + self, resource_group_name, service_name, api_id, custom_headers=None, raw=False, **operation_config): + """Get the schema configuration at the API level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SchemaContract + :rtype: + ~azure.mgmt.apimanagement.models.SchemaContractPaged[~azure.mgmt.apimanagement.models.SchemaContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SchemaContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SchemaContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas'} + + def get_entity_tag( + self, resource_group_name, service_name, api_id, schema_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the schema specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param schema_id: Schema identifier within an API. Must be unique in + the current API Management service instance. + :type schema_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'schemaId': self._serialize.url("schema_id", schema_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} + + def get( + self, resource_group_name, service_name, api_id, schema_id, custom_headers=None, raw=False, **operation_config): + """Get the schema configuration at the API level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param schema_id: Schema identifier within an API. Must be unique in + the current API Management service instance. + :type schema_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SchemaContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.SchemaContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'schemaId': self._serialize.url("schema_id", schema_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('SchemaContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, schema_id, content_type, if_match=None, value=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates schema configuration for the API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param schema_id: Schema identifier within an API. Must be unique in + the current API Management service instance. + :type schema_id: str + :param content_type: Must be a valid a media type used in a + Content-Type header as defined in the RFC 2616. Media type of the + schema document (e.g. application/json, application/xml). + :type content_type: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param value: Json escaped string defining the document representing + the Schema. + :type value: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SchemaContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.SchemaContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.SchemaContract(content_type=content_type, value=value) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'schemaId': self._serialize.url("schema_id", schema_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SchemaContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SchemaContract', response) + if response.status_code == 201: + deserialized = self._deserialize('SchemaContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} + + def delete( + self, resource_group_name, service_name, api_id, schema_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the schema configuration at the Api. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param schema_id: Schema identifier within an API. Must be unique in + the current API Management service instance. + :type schema_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'schemaId': self._serialize.url("schema_id", schema_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_version_set_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_version_set_operations.py new file mode 100644 index 000000000000..e7352723575c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_version_set_operations.py @@ -0,0 +1,477 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiVersionSetOperations(object): + """ApiVersionSetOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of API Version Sets in the specified service + instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |------------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | email | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | state | eq | N/A + | + | registrationDate | ge, le, eq, ne, gt, lt | N/A + | + | note | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApiVersionSetContract + :rtype: + ~azure.mgmt.apimanagement.models.ApiVersionSetContractPaged[~azure.mgmt.apimanagement.models.ApiVersionSetContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ApiVersionSetContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApiVersionSetContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets'} + + def get_entity_tag( + self, resource_group_name, service_name, version_set_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the Api Version Set specified + by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param version_set_id: Api Version Set identifier. Must be unique in + the current API Management service instance. + :type version_set_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'versionSetId': self._serialize.url("version_set_id", version_set_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}'} + + def get( + self, resource_group_name, service_name, version_set_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the Api Version Set specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param version_set_id: Api Version Set identifier. Must be unique in + the current API Management service instance. + :type version_set_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiVersionSetContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiVersionSetContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'versionSetId': self._serialize.url("version_set_id", version_set_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ApiVersionSetContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}'} + + def create_or_update( + self, resource_group_name, service_name, version_set_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or Updates a Api Version Set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param version_set_id: Api Version Set identifier. Must be unique in + the current API Management service instance. + :type version_set_id: str + :param parameters: Create or update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.ApiVersionSetContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiVersionSetContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiVersionSetContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'versionSetId': self._serialize.url("version_set_id", version_set_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiVersionSetContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiVersionSetContract', response) + if response.status_code == 201: + deserialized = self._deserialize('ApiVersionSetContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}'} + + def update( + self, resource_group_name, service_name, version_set_id, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates the details of the Api VersionSet specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param version_set_id: Api Version Set identifier. Must be unique in + the current API Management service instance. + :type version_set_id: str + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.ApiVersionSetUpdateParameters + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'versionSetId': self._serialize.url("version_set_id", version_set_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApiVersionSetUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}'} + + def delete( + self, resource_group_name, service_name, version_set_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes specific Api Version Set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param version_set_id: Api Version Set identifier. Must be unique in + the current API Management service instance. + :type version_set_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'versionSetId': self._serialize.url("version_set_id", version_set_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/authorization_server_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/authorization_server_operations.py new file mode 100644 index 000000000000..f94da13b79ac --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/authorization_server_operations.py @@ -0,0 +1,467 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class AuthorizationServerOperations(object): + """AuthorizationServerOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of authorization servers defined within a service + instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported functions + | + |-------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AuthorizationServerContract + :rtype: + ~azure.mgmt.apimanagement.models.AuthorizationServerContractPaged[~azure.mgmt.apimanagement.models.AuthorizationServerContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AuthorizationServerContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AuthorizationServerContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers'} + + def get_entity_tag( + self, resource_group_name, service_name, authsid, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the authorizationServer + specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param authsid: Identifier of the authorization server. + :type authsid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'authsid': self._serialize.url("authsid", authsid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} + + def get( + self, resource_group_name, service_name, authsid, custom_headers=None, raw=False, **operation_config): + """Gets the details of the authorization server specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param authsid: Identifier of the authorization server. + :type authsid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AuthorizationServerContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerContract + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'authsid': self._serialize.url("authsid", authsid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('AuthorizationServerContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} + + def create_or_update( + self, resource_group_name, service_name, authsid, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates new authorization server or updates an existing authorization + server. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param authsid: Identifier of the authorization server. + :type authsid: str + :param parameters: Create or update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.AuthorizationServerContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AuthorizationServerContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerContract + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'authsid': self._serialize.url("authsid", authsid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AuthorizationServerContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AuthorizationServerContract', response) + if response.status_code == 201: + deserialized = self._deserialize('AuthorizationServerContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} + + def update( + self, resource_group_name, service_name, authsid, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates the details of the authorization server specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param authsid: Identifier of the authorization server. + :type authsid: str + :param parameters: OAuth2 Server settings Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.AuthorizationServerUpdateContract + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'authsid': self._serialize.url("authsid", authsid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AuthorizationServerUpdateContract') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} + + def delete( + self, resource_group_name, service_name, authsid, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes specific authorization server instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param authsid: Identifier of the authorization server. + :type authsid: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'authsid': self._serialize.url("authsid", authsid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/backend_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/backend_operations.py new file mode 100644 index 000000000000..abddb993cc8f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/backend_operations.py @@ -0,0 +1,538 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BackendOperations(object): + """BackendOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of backends in the specified service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported functions + | + |-------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + | host | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BackendContract + :rtype: + ~azure.mgmt.apimanagement.models.BackendContractPaged[~azure.mgmt.apimanagement.models.BackendContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.BackendContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BackendContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends'} + + def get_entity_tag( + self, resource_group_name, service_name, backendid, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the backend specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param backendid: Identifier of the Backend entity. Must be unique in + the current API Management service instance. + :type backendid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'backendid': self._serialize.url("backendid", backendid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}'} + + def get( + self, resource_group_name, service_name, backendid, custom_headers=None, raw=False, **operation_config): + """Gets the details of the backend specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param backendid: Identifier of the Backend entity. Must be unique in + the current API Management service instance. + :type backendid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackendContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.BackendContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'backendid': self._serialize.url("backendid", backendid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('BackendContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}'} + + def create_or_update( + self, resource_group_name, service_name, backendid, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or Updates a backend. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param backendid: Identifier of the Backend entity. Must be unique in + the current API Management service instance. + :type backendid: str + :param parameters: Create parameters. + :type parameters: ~azure.mgmt.apimanagement.models.BackendContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackendContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.BackendContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'backendid': self._serialize.url("backendid", backendid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BackendContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackendContract', response) + if response.status_code == 201: + deserialized = self._deserialize('BackendContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}'} + + def update( + self, resource_group_name, service_name, backendid, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates an existing backend. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param backendid: Identifier of the Backend entity. Must be unique in + the current API Management service instance. + :type backendid: str + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.BackendUpdateParameters + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'backendid': self._serialize.url("backendid", backendid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BackendUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}'} + + def delete( + self, resource_group_name, service_name, backendid, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified backend. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param backendid: Identifier of the Backend entity. Must be unique in + the current API Management service instance. + :type backendid: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'backendid': self._serialize.url("backendid", backendid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}'} + + def reconnect( + self, resource_group_name, service_name, backendid, after=None, custom_headers=None, raw=False, **operation_config): + """Notifies the APIM proxy to create a new connection to the backend after + the specified timeout. If no timeout was specified, timeout of 2 + minutes is used. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param backendid: Identifier of the Backend entity. Must be unique in + the current API Management service instance. + :type backendid: str + :param after: Duration in ISO8601 format after which reconnect will be + initiated. Minimum duration of the Reconect is PT2M. + :type after: timedelta + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + if after is not None: + parameters = models.BackendReconnectContract(after=after) + + # Construct URL + url = self.reconnect.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'backendid': self._serialize.url("backendid", backendid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'BackendReconnectContract') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + reconnect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}/reconnect'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/certificate_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/certificate_operations.py new file mode 100644 index 000000000000..07608d49b540 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/certificate_operations.py @@ -0,0 +1,407 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class CertificateOperations(object): + """CertificateOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of all certificates in the specified service + instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |----------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | subject | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | thumbprint | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | expirationDate | ge, le, eq, ne, gt, lt | N/A + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of CertificateContract + :rtype: + ~azure.mgmt.apimanagement.models.CertificateContractPaged[~azure.mgmt.apimanagement.models.CertificateContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CertificateContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CertificateContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates'} + + def get_entity_tag( + self, resource_group_name, service_name, certificate_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the certificate specified by + its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param certificate_id: Identifier of the certificate entity. Must be + unique in the current API Management service instance. + :type certificate_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} + + def get( + self, resource_group_name, service_name, certificate_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the certificate specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param certificate_id: Identifier of the certificate entity. Must be + unique in the current API Management service instance. + :type certificate_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('CertificateContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} + + def create_or_update( + self, resource_group_name, service_name, certificate_id, data, password, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates the certificate being used for authentication with + the backend. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param certificate_id: Identifier of the certificate entity. Must be + unique in the current API Management service instance. + :type certificate_id: str + :param data: Base 64 encoded certificate using the + application/x-pkcs12 representation. + :type data: str + :param password: Password for the Certificate + :type password: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.CertificateCreateOrUpdateParameters(data=data, password=password) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CertificateCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateContract', response) + if response.status_code == 201: + deserialized = self._deserialize('CertificateContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} + + def delete( + self, resource_group_name, service_name, certificate_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes specific certificate. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param certificate_id: Identifier of the certificate entity. Must be + unique in the current API Management service instance. + :type certificate_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/delegation_settings_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/delegation_settings_operations.py new file mode 100644 index 000000000000..fc9cbb639cf2 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/delegation_settings_operations.py @@ -0,0 +1,294 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DelegationSettingsOperations(object): + """DelegationSettingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def get_entity_tag( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the DelegationSettings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get Delegation settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PortalDelegationSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PortalDelegationSettings or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PortalDelegationSettings', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} + + def update( + self, resource_group_name, service_name, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Update Delegation settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param parameters: Update Delegation settings. + :type parameters: + ~azure.mgmt.apimanagement.models.PortalDelegationSettings + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PortalDelegationSettings') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} + + def create_or_update( + self, resource_group_name, service_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or Update Delegation settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param parameters: Create or update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.PortalDelegationSettings + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PortalDelegationSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PortalDelegationSettings or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PortalDelegationSettings') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PortalDelegationSettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/diagnostic_logger_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/diagnostic_logger_operations.py new file mode 100644 index 000000000000..ed7f4a054413 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/diagnostic_logger_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DiagnosticLoggerOperations(object): + """DiagnosticLoggerOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, diagnostic_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all loggers assosiated with the specified Diagnostic of the API + Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | type | eq | + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LoggerContract + :rtype: + ~azure.mgmt.apimanagement.models.LoggerContractPaged[~azure.mgmt.apimanagement.models.LoggerContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.LoggerContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LoggerContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers'} + + def check_entity_exists( + self, resource_group_name, service_name, diagnostic_id, loggerid, custom_headers=None, raw=False, **operation_config): + """Checks that logger entity specified by identifier is associated with + the diagnostics entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.check_entity_exists.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}'} + + def create_or_update( + self, resource_group_name, service_name, diagnostic_id, loggerid, custom_headers=None, raw=False, **operation_config): + """Attaches a logger to a dignostic. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LoggerContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LoggerContract', response) + if response.status_code == 201: + deserialized = self._deserialize('LoggerContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}'} + + def delete( + self, resource_group_name, service_name, diagnostic_id, loggerid, custom_headers=None, raw=False, **operation_config): + """Deletes the specified Logger from Diagnostic. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/diagnostic_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/diagnostic_operations.py new file mode 100644 index 000000000000..47b432c1f944 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/diagnostic_operations.py @@ -0,0 +1,468 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DiagnosticOperations(object): + """DiagnosticOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all diagnostics of the API Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DiagnosticContract + :rtype: + ~azure.mgmt.apimanagement.models.DiagnosticContractPaged[~azure.mgmt.apimanagement.models.DiagnosticContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DiagnosticContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DiagnosticContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics'} + + def get_entity_tag( + self, resource_group_name, service_name, diagnostic_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the Diagnostic specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} + + def get( + self, resource_group_name, service_name, diagnostic_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the Diagnostic specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DiagnosticContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('DiagnosticContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} + + def create_or_update( + self, resource_group_name, service_name, diagnostic_id, enabled, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates a new Diagnostic or updates an existing one. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param enabled: Indicates whether a diagnostic should receive data or + not. + :type enabled: bool + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DiagnosticContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.DiagnosticContract(enabled=enabled) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DiagnosticContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DiagnosticContract', response) + if response.status_code == 201: + deserialized = self._deserialize('DiagnosticContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} + + def update( + self, resource_group_name, service_name, diagnostic_id, if_match, enabled, custom_headers=None, raw=False, **operation_config): + """Updates the details of the Diagnostic specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param enabled: Indicates whether a diagnostic should receive data or + not. + :type enabled: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.DiagnosticContract(enabled=enabled) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DiagnosticContract') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} + + def delete( + self, resource_group_name, service_name, diagnostic_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified Diagnostic. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param diagnostic_id: Diagnostic identifier. Must be unique in the + current API Management service instance. + :type diagnostic_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'diagnosticId': self._serialize.url("diagnostic_id", diagnostic_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/email_template_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/email_template_operations.py new file mode 100644 index 000000000000..0e3ef0fbd91d --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/email_template_operations.py @@ -0,0 +1,509 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class EmailTemplateOperations(object): + """EmailTemplateOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of properties defined within a service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EmailTemplateContract + :rtype: + ~azure.mgmt.apimanagement.models.EmailTemplateContractPaged[~azure.mgmt.apimanagement.models.EmailTemplateContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EmailTemplateContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EmailTemplateContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates'} + + def get_entity_tag( + self, resource_group_name, service_name, template_name, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the email template specified by + its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param template_name: Email Template Name Identifier. Possible values + include: 'applicationApprovedNotificationMessage', + 'accountClosedDeveloper', + 'quotaLimitApproachingDeveloperNotificationMessage', + 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + 'purchaseDeveloperNotificationMessage', + 'passwordResetIdentityDefault', + 'passwordResetByAdminNotificationMessage', + 'rejectDeveloperNotificationMessage', + 'requestDeveloperNotificationMessage' + :type template_name: str or + ~azure.mgmt.apimanagement.models.TemplateName + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'templateName': self._serialize.url("template_name", template_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} + + def get( + self, resource_group_name, service_name, template_name, custom_headers=None, raw=False, **operation_config): + """Gets the details of the email template specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param template_name: Email Template Name Identifier. Possible values + include: 'applicationApprovedNotificationMessage', + 'accountClosedDeveloper', + 'quotaLimitApproachingDeveloperNotificationMessage', + 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + 'purchaseDeveloperNotificationMessage', + 'passwordResetIdentityDefault', + 'passwordResetByAdminNotificationMessage', + 'rejectDeveloperNotificationMessage', + 'requestDeveloperNotificationMessage' + :type template_name: str or + ~azure.mgmt.apimanagement.models.TemplateName + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EmailTemplateContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.EmailTemplateContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'templateName': self._serialize.url("template_name", template_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('EmailTemplateContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} + + def create_or_update( + self, resource_group_name, service_name, template_name, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Updates an Email Template. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param template_name: Email Template Name Identifier. Possible values + include: 'applicationApprovedNotificationMessage', + 'accountClosedDeveloper', + 'quotaLimitApproachingDeveloperNotificationMessage', + 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + 'purchaseDeveloperNotificationMessage', + 'passwordResetIdentityDefault', + 'passwordResetByAdminNotificationMessage', + 'rejectDeveloperNotificationMessage', + 'requestDeveloperNotificationMessage' + :type template_name: str or + ~azure.mgmt.apimanagement.models.TemplateName + :param parameters: Email Template update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.EmailTemplateUpdateParameters + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EmailTemplateContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.EmailTemplateContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'templateName': self._serialize.url("template_name", template_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'EmailTemplateUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EmailTemplateContract', response) + if response.status_code == 201: + deserialized = self._deserialize('EmailTemplateContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} + + def update( + self, resource_group_name, service_name, template_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates the specific Email Template. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param template_name: Email Template Name Identifier. Possible values + include: 'applicationApprovedNotificationMessage', + 'accountClosedDeveloper', + 'quotaLimitApproachingDeveloperNotificationMessage', + 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + 'purchaseDeveloperNotificationMessage', + 'passwordResetIdentityDefault', + 'passwordResetByAdminNotificationMessage', + 'rejectDeveloperNotificationMessage', + 'requestDeveloperNotificationMessage' + :type template_name: str or + ~azure.mgmt.apimanagement.models.TemplateName + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.EmailTemplateUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'templateName': self._serialize.url("template_name", template_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'EmailTemplateUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} + + def delete( + self, resource_group_name, service_name, template_name, if_match, custom_headers=None, raw=False, **operation_config): + """Reset the Email Template to default template provided by the API + Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param template_name: Email Template Name Identifier. Possible values + include: 'applicationApprovedNotificationMessage', + 'accountClosedDeveloper', + 'quotaLimitApproachingDeveloperNotificationMessage', + 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + 'purchaseDeveloperNotificationMessage', + 'passwordResetIdentityDefault', + 'passwordResetByAdminNotificationMessage', + 'rejectDeveloperNotificationMessage', + 'requestDeveloperNotificationMessage' + :type template_name: str or + ~azure.mgmt.apimanagement.models.TemplateName + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'templateName': self._serialize.url("template_name", template_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/group_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/group_operations.py new file mode 100644 index 000000000000..cf7381a5f73b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/group_operations.py @@ -0,0 +1,472 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class GroupOperations(object): + """GroupOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of groups defined within a service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | type | eq, ne | N/A + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GroupContract + :rtype: + ~azure.mgmt.apimanagement.models.GroupContractPaged[~azure.mgmt.apimanagement.models.GroupContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.GroupContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.GroupContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups'} + + def get_entity_tag( + self, resource_group_name, service_name, group_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the group specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} + + def get( + self, resource_group_name, service_name, group_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the group specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GroupContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.GroupContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('GroupContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} + + def create_or_update( + self, resource_group_name, service_name, group_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or Updates a group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param parameters: Create parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.GroupCreateParameters + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GroupContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.GroupContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'GroupCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GroupContract', response) + if response.status_code == 201: + deserialized = self._deserialize('GroupContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} + + def update( + self, resource_group_name, service_name, group_id, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates the details of the group specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.GroupUpdateParameters + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'GroupUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} + + def delete( + self, resource_group_name, service_name, group_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes specific group of the API Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/group_user_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/group_user_operations.py new file mode 100644 index 000000000000..08811eba0ae3 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/group_user_operations.py @@ -0,0 +1,336 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class GroupUserOperations(object): + """GroupUserOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, service_name, group_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of the members of the group, specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param filter: | Field | Supported operators | Supported + functions | + |------------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | email | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | state | eq | N/A + | + | registrationDate | ge, le, eq, ne, gt, lt | N/A + | + | note | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of UserContract + :rtype: + ~azure.mgmt.apimanagement.models.UserContractPaged[~azure.mgmt.apimanagement.models.UserContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.UserContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UserContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users'} + + def check_entity_exists( + self, resource_group_name, service_name, group_id, uid, custom_headers=None, raw=False, **operation_config): + """Checks that user entity specified by identifier is associated with the + group entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.check_entity_exists.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}'} + + def create( + self, resource_group_name, service_name, group_id, uid, custom_headers=None, raw=False, **operation_config): + """Adds a user to the specified group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: UserContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.UserContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UserContract', response) + if response.status_code == 201: + deserialized = self._deserialize('UserContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}'} + + def delete( + self, resource_group_name, service_name, group_id, uid, custom_headers=None, raw=False, **operation_config): + """Remove existing user from existing group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/identity_provider_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/identity_provider_operations.py new file mode 100644 index 000000000000..c2de5e944025 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/identity_provider_operations.py @@ -0,0 +1,460 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class IdentityProviderOperations(object): + """IdentityProviderOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Lists a collection of Identity Provider configured in the specified + service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IdentityProviderContract + :rtype: + ~azure.mgmt.apimanagement.models.IdentityProviderContractPaged[~azure.mgmt.apimanagement.models.IdentityProviderContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.IdentityProviderContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.IdentityProviderContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders'} + + def get_entity_tag( + self, resource_group_name, service_name, identity_provider_name, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the identityProvider specified + by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param identity_provider_name: Identity Provider Type identifier. + Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + 'aad', 'aadB2C' + :type identity_provider_name: str or + ~azure.mgmt.apimanagement.models.IdentityProviderType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'identityProviderName': self._serialize.url("identity_provider_name", identity_provider_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} + + def get( + self, resource_group_name, service_name, identity_provider_name, custom_headers=None, raw=False, **operation_config): + """Gets the configuration details of the identity Provider configured in + specified service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param identity_provider_name: Identity Provider Type identifier. + Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + 'aad', 'aadB2C' + :type identity_provider_name: str or + ~azure.mgmt.apimanagement.models.IdentityProviderType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IdentityProviderContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IdentityProviderContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'identityProviderName': self._serialize.url("identity_provider_name", identity_provider_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('IdentityProviderContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} + + def create_or_update( + self, resource_group_name, service_name, identity_provider_name, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or Updates the IdentityProvider configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param identity_provider_name: Identity Provider Type identifier. + Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + 'aad', 'aadB2C' + :type identity_provider_name: str or + ~azure.mgmt.apimanagement.models.IdentityProviderType + :param parameters: Create parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.IdentityProviderContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IdentityProviderContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IdentityProviderContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'identityProviderName': self._serialize.url("identity_provider_name", identity_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'IdentityProviderContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IdentityProviderContract', response) + if response.status_code == 201: + deserialized = self._deserialize('IdentityProviderContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} + + def update( + self, resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates an existing IdentityProvider configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param identity_provider_name: Identity Provider Type identifier. + Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + 'aad', 'aadB2C' + :type identity_provider_name: str or + ~azure.mgmt.apimanagement.models.IdentityProviderType + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.IdentityProviderUpdateParameters + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'identityProviderName': self._serialize.url("identity_provider_name", identity_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'IdentityProviderUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} + + def delete( + self, resource_group_name, service_name, identity_provider_name, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified identity provider configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param identity_provider_name: Identity Provider Type identifier. + Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + 'aad', 'aadB2C' + :type identity_provider_name: str or + ~azure.mgmt.apimanagement.models.IdentityProviderType + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'identityProviderName': self._serialize.url("identity_provider_name", identity_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/logger_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/logger_operations.py new file mode 100644 index 000000000000..44011c829d91 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/logger_operations.py @@ -0,0 +1,465 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class LoggerOperations(object): + """LoggerOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of loggers in the specified service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported functions + | + |-------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + | type | eq | + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LoggerContract + :rtype: + ~azure.mgmt.apimanagement.models.LoggerContractPaged[~azure.mgmt.apimanagement.models.LoggerContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.LoggerContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LoggerContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers'} + + def get_entity_tag( + self, resource_group_name, service_name, loggerid, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the logger specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}'} + + def get( + self, resource_group_name, service_name, loggerid, custom_headers=None, raw=False, **operation_config): + """Gets the details of the logger specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LoggerContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('LoggerContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}'} + + def create_or_update( + self, resource_group_name, service_name, loggerid, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or Updates a logger. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param parameters: Create parameters. + :type parameters: ~azure.mgmt.apimanagement.models.LoggerContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LoggerContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'LoggerContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LoggerContract', response) + if response.status_code == 201: + deserialized = self._deserialize('LoggerContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}'} + + def update( + self, resource_group_name, service_name, loggerid, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates an existing logger. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.LoggerUpdateContract + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'LoggerUpdateContract') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}'} + + def delete( + self, resource_group_name, service_name, loggerid, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified logger. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param loggerid: Logger identifier. Must be unique in the API + Management service instance. + :type loggerid: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'loggerid': self._serialize.url("loggerid", loggerid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/network_status_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/network_status_operations.py new file mode 100644 index 000000000000..e1bb254c2a31 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/network_status_operations.py @@ -0,0 +1,169 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class NetworkStatusOperations(object): + """NetworkStatusOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets the Connectivity Status to the external resources on which the Api + Management service depends from inside the Cloud Service. This also + returns the DNS Servers as visible to the CloudService. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.apimanagement.models.NetworkStatusContractByLocation] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkStatusContractByLocation]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/networkstatus'} + + def list_by_location( + self, resource_group_name, service_name, location_name, custom_headers=None, raw=False, **operation_config): + """Gets the Connectivity Status to the external resources on which the Api + Management service depends from inside the Cloud Service. This also + returns the DNS Servers as visible to the CloudService. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param location_name: Location in which the API Management service is + deployed. This is one of the Azure Regions like West US, East US, + South Central US. + :type location_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NetworkStatusContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.NetworkStatusContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_location.metadata['url'] + 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'locationName': self._serialize.url("location_name", location_name, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkStatusContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/notification_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/notification_operations.py new file mode 100644 index 000000000000..566af539e5a2 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/notification_operations.py @@ -0,0 +1,262 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class NotificationOperations(object): + """NotificationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of properties defined within a service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NotificationContract + :rtype: + ~azure.mgmt.apimanagement.models.NotificationContractPaged[~azure.mgmt.apimanagement.models.NotificationContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NotificationContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NotificationContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications'} + + def get( + self, resource_group_name, service_name, notification_name, custom_headers=None, raw=False, **operation_config): + """Gets the details of the Notification specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NotificationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.NotificationContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NotificationContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}'} + + def create_or_update( + self, resource_group_name, service_name, notification_name, if_match=None, custom_headers=None, raw=False, **operation_config): + """Updates an Notification. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NotificationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.NotificationContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NotificationContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/notification_recipient_email_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/notification_recipient_email_operations.py new file mode 100644 index 000000000000..ca3eb28c0603 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/notification_recipient_email_operations.py @@ -0,0 +1,316 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class NotificationRecipientEmailOperations(object): + """NotificationRecipientEmailOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_notification( + self, resource_group_name, service_name, notification_name, custom_headers=None, raw=False, **operation_config): + """Gets the list of the Notification Recipient Emails subscribed to a + notification. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecipientEmailCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.RecipientEmailCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_notification.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecipientEmailCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_notification.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails'} + + def check_entity_exists( + self, resource_group_name, service_name, notification_name, email, custom_headers=None, raw=False, **operation_config): + """Determine if Notification Recipient Email subscribed to the + notification. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param email: Email identifier. + :type email: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.check_entity_exists.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'email': self._serialize.url("email", email, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'} + + def create_or_update( + self, resource_group_name, service_name, notification_name, email, custom_headers=None, raw=False, **operation_config): + """Adds the Email address to the list of Recipients for the Notification. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param email: Email identifier. + :type email: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecipientEmailContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.RecipientEmailContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'email': self._serialize.url("email", email, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecipientEmailContract', response) + if response.status_code == 201: + deserialized = self._deserialize('RecipientEmailContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'} + + def delete( + self, resource_group_name, service_name, notification_name, email, custom_headers=None, raw=False, **operation_config): + """Removes the email from the list of Notification. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param email: Email identifier. + :type email: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'email': self._serialize.url("email", email, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/notification_recipient_user_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/notification_recipient_user_operations.py new file mode 100644 index 000000000000..24abb3b97c66 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/notification_recipient_user_operations.py @@ -0,0 +1,320 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class NotificationRecipientUserOperations(object): + """NotificationRecipientUserOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_notification( + self, resource_group_name, service_name, notification_name, custom_headers=None, raw=False, **operation_config): + """Gets the list of the Notification Recipient User subscribed to the + notification. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecipientUserCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.RecipientUserCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_notification.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecipientUserCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_notification.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers'} + + def check_entity_exists( + self, resource_group_name, service_name, notification_name, uid, custom_headers=None, raw=False, **operation_config): + """Determine if the Notification Recipient User is subscribed to the + notification. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.check_entity_exists.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}'} + + def create_or_update( + self, resource_group_name, service_name, notification_name, uid, custom_headers=None, raw=False, **operation_config): + """Adds the API Management User to the list of Recipients for the + Notification. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecipientUserContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.RecipientUserContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecipientUserContract', response) + if response.status_code == 201: + deserialized = self._deserialize('RecipientUserContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}'} + + def delete( + self, resource_group_name, service_name, notification_name, uid, custom_headers=None, raw=False, **operation_config): + """Removes the API Management user from the list of Notification. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param notification_name: Notification Name Identifier. Possible + values include: 'RequestPublisherNotificationMessage', + 'PurchasePublisherNotificationMessage', + 'NewApplicationNotificationMessage', 'BCC', + 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + 'QuotaLimitApproachingPublisherNotificationMessage' + :type notification_name: str or + ~azure.mgmt.apimanagement.models.NotificationName + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'notificationName': self._serialize.url("notification_name", notification_name, 'str'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/open_id_connect_provider_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/open_id_connect_provider_operations.py new file mode 100644 index 000000000000..972f8638a628 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/open_id_connect_provider_operations.py @@ -0,0 +1,466 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class OpenIdConnectProviderOperations(object): + """OpenIdConnectProviderOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all OpenID Connect Providers. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported functions + | + |-------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OpenidConnectProviderContract + :rtype: + ~azure.mgmt.apimanagement.models.OpenidConnectProviderContractPaged[~azure.mgmt.apimanagement.models.OpenidConnectProviderContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OpenidConnectProviderContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OpenidConnectProviderContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders'} + + def get_entity_tag( + self, resource_group_name, service_name, opid, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the openIdConnectProvider + specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param opid: Identifier of the OpenID Connect Provider. + :type opid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'opid': self._serialize.url("opid", opid, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} + + def get( + self, resource_group_name, service_name, opid, custom_headers=None, raw=False, **operation_config): + """Gets specific OpenID Connect Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param opid: Identifier of the OpenID Connect Provider. + :type opid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OpenidConnectProviderContract or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'opid': self._serialize.url("opid", opid, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('OpenidConnectProviderContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} + + def create_or_update( + self, resource_group_name, service_name, opid, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates the OpenID Connect Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param opid: Identifier of the OpenID Connect Provider. + :type opid: str + :param parameters: Create parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OpenidConnectProviderContract or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'opid': self._serialize.url("opid", opid, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'OpenidConnectProviderContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OpenidConnectProviderContract', response) + if response.status_code == 201: + deserialized = self._deserialize('OpenidConnectProviderContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} + + def update( + self, resource_group_name, service_name, opid, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates the specific OpenID Connect Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param opid: Identifier of the OpenID Connect Provider. + :type opid: str + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.OpenidConnectProviderUpdateContract + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'opid': self._serialize.url("opid", opid, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'OpenidConnectProviderUpdateContract') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} + + def delete( + self, resource_group_name, service_name, opid, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes specific OpenID Connect Provider of the API Management service + instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param opid: Identifier of the OpenID Connect Provider. + :type opid: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'opid': self._serialize.url("opid", opid, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/operation_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/operation_operations.py new file mode 100644 index 000000000000..eb4cd4c49f36 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/operation_operations.py @@ -0,0 +1,140 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class OperationOperations(object): + """OperationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_tags( + self, resource_group_name, service_name, api_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of operations associated with tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | apiName | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | method | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TagResourceContract + :rtype: + ~azure.mgmt.apimanagement.models.TagResourceContractPaged[~azure.mgmt.apimanagement.models.TagResourceContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TagResourceContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TagResourceContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_operations.py new file mode 100644 index 000000000000..96af9bab57ca --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_operations.py @@ -0,0 +1,370 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PolicyOperations(object): + """PolicyOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar policy_id: The identifier of the Policy. Constant value: "policy". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + self.policy_id = "policy" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, scope=None, custom_headers=None, raw=False, **operation_config): + """Lists all the Global Policy definitions of the Api Management service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param scope: Policy scope. Possible values include: 'Tenant', + 'Product', 'Api', 'Operation', 'All' + :type scope: str or + ~azure.mgmt.apimanagement.models.PolicyScopeContract + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'PolicyScopeContract') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies'} + + def get_entity_tag( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the Global policy definition in + the Api Management service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get the Global policy definition of the Api Management service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PolicyContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} + + def create_or_update( + self, resource_group_name, service_name, policy_content, content_format="xml", custom_headers=None, raw=False, **operation_config): + """Creates or updates the global policy configuration of the Api + Management service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param policy_content: Json escaped Xml Encoded contents of the + Policy. + :type policy_content: str + :param content_format: Format of the policyContent. Possible values + include: 'xml', 'xml-link' + :type content_format: str or + ~azure.mgmt.apimanagement.models.PolicyContentFormat + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PolicyContract(policy_content=policy_content, content_format=content_format) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PolicyContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyContract', response) + if response.status_code == 201: + deserialized = self._deserialize('PolicyContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} + + def delete( + self, resource_group_name, service_name, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the global policy configuration of the Api Management Service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_snippets_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_snippets_operations.py new file mode 100644 index 000000000000..4ff1a86eec73 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_snippets_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PolicySnippetsOperations(object): + """PolicySnippetsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, scope=None, custom_headers=None, raw=False, **operation_config): + """Lists all policy snippets. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param scope: Policy scope. Possible values include: 'Tenant', + 'Product', 'Api', 'Operation', 'All' + :type scope: str or + ~azure.mgmt.apimanagement.models.PolicyScopeContract + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicySnippetsCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicySnippetsCollection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'PolicyScopeContract') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicySnippetsCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policySnippets'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_api_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_api_operations.py new file mode 100644 index 000000000000..45c63fb4f995 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_api_operations.py @@ -0,0 +1,331 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductApiOperations(object): + """ProductApiOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_product( + self, resource_group_name, service_name, product_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of the APIs associated with a product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | path | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApiContract + :rtype: + ~azure.mgmt.apimanagement.models.ApiContractPaged[~azure.mgmt.apimanagement.models.ApiContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_product.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ApiContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApiContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis'} + + def check_entity_exists( + self, resource_group_name, service_name, product_id, api_id, custom_headers=None, raw=False, **operation_config): + """Checks that API entity specified by identifier is associated with the + Product entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.check_entity_exists.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'} + + def create_or_update( + self, resource_group_name, service_name, product_id, api_id, custom_headers=None, raw=False, **operation_config): + """Adds an API to the specified product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiContract', response) + if response.status_code == 201: + deserialized = self._deserialize('ApiContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'} + + def delete( + self, resource_group_name, service_name, product_id, api_id, custom_headers=None, raw=False, **operation_config): + """Deletes the specified API from the specified product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_group_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_group_operations.py new file mode 100644 index 000000000000..9140736b7569 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_group_operations.py @@ -0,0 +1,331 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductGroupOperations(object): + """ProductGroupOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_product( + self, resource_group_name, service_name, product_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists the collection of developer groups associated with the specified + product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | type | eq, ne | N/A + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GroupContract + :rtype: + ~azure.mgmt.apimanagement.models.GroupContractPaged[~azure.mgmt.apimanagement.models.GroupContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_product.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.GroupContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.GroupContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups'} + + def check_entity_exists( + self, resource_group_name, service_name, product_id, group_id, custom_headers=None, raw=False, **operation_config): + """Checks that Group entity specified by identifier is associated with the + Product entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.check_entity_exists.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'} + + def create_or_update( + self, resource_group_name, service_name, product_id, group_id, custom_headers=None, raw=False, **operation_config): + """Adds the association between the specified developer group with the + specified product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GroupContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.GroupContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GroupContract', response) + if response.status_code == 201: + deserialized = self._deserialize('GroupContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'} + + def delete( + self, resource_group_name, service_name, product_id, group_id, custom_headers=None, raw=False, **operation_config): + """Deletes the association between the specified group and product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param group_id: Group identifier. Must be unique in the current API + Management service instance. + :type group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_operations.py new file mode 100644 index 000000000000..6d4a99060f0e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductOperations(object): + """ProductOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, expand_groups=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of products in the specified service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | terms | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | state | eq | + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param expand_groups: When set to true, the response contains an array + of groups that have visibility to the product. The default is false. + :type expand_groups: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ProductContract + :rtype: + ~azure.mgmt.apimanagement.models.ProductContractPaged[~azure.mgmt.apimanagement.models.ProductContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if expand_groups is not None: + query_parameters['expandGroups'] = self._serialize.query("expand_groups", expand_groups, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProductContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProductContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products'} + + def get_entity_tag( + self, resource_group_name, service_name, product_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the product specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} + + def get( + self, resource_group_name, service_name, product_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the product specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProductContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ProductContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ProductContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} + + def create_or_update( + self, resource_group_name, service_name, product_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or Updates a product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param parameters: Create or update parameters. + :type parameters: ~azure.mgmt.apimanagement.models.ProductContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProductContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ProductContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ProductContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProductContract', response) + if response.status_code == 201: + deserialized = self._deserialize('ProductContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} + + def update( + self, resource_group_name, service_name, product_id, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Update product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.ProductUpdateParameters + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ProductUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} + + def delete( + self, resource_group_name, service_name, product_id, if_match, delete_subscriptions=None, custom_headers=None, raw=False, **operation_config): + """Delete product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param delete_subscriptions: Delete existing subscriptions associated + with the product or not. + :type delete_subscriptions: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if delete_subscriptions is not None: + query_parameters['deleteSubscriptions'] = self._serialize.query("delete_subscriptions", delete_subscriptions, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_policy_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_policy_operations.py new file mode 100644 index 000000000000..0b2471308071 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_policy_operations.py @@ -0,0 +1,390 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductPolicyOperations(object): + """ProductPolicyOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar policy_id: The identifier of the Policy. Constant value: "policy". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + self.policy_id = "policy" + + self.config = config + + def list_by_product( + self, resource_group_name, service_name, product_id, custom_headers=None, raw=False, **operation_config): + """Get the policy configuration at the Product level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_product.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PolicyCollection', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies'} + + def get_entity_tag( + self, resource_group_name, service_name, product_id, custom_headers=None, raw=False, **operation_config): + """Get the ETag of the policy configuration at the Product level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'policyId': self._serialize.url("self.policy_id", self.policy_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} + + def get( + self, resource_group_name, service_name, product_id, custom_headers=None, raw=False, **operation_config): + """Get the policy configuration at the Product level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'policyId': self._serialize.url("self.policy_id", self.policy_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PolicyContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} + + def create_or_update( + self, resource_group_name, service_name, product_id, policy_content, if_match=None, content_format="xml", custom_headers=None, raw=False, **operation_config): + """Creates or updates policy configuration for the Product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param policy_content: Json escaped Xml Encoded contents of the + Policy. + :type policy_content: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param content_format: Format of the policyContent. Possible values + include: 'xml', 'xml-link' + :type content_format: str or + ~azure.mgmt.apimanagement.models.PolicyContentFormat + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PolicyContract(policy_content=policy_content, content_format=content_format) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PolicyContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyContract', response) + if response.status_code == 201: + deserialized = self._deserialize('PolicyContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} + + def delete( + self, resource_group_name, service_name, product_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the policy configuration at the Product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'policyId': self._serialize.url("self.policy_id", self.policy_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_subscriptions_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_subscriptions_operations.py new file mode 100644 index 000000000000..465d62c1bfa9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_subscriptions_operations.py @@ -0,0 +1,137 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductSubscriptionsOperations(object): + """ProductSubscriptionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, service_name, product_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists the collection of subscriptions to the specified product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param filter: | Field | Supported operators | Supported + functions | + |--------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | userId | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | productId | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | state | eq | + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SubscriptionContract + :rtype: + ~azure.mgmt.apimanagement.models.SubscriptionContractPaged[~azure.mgmt.apimanagement.models.SubscriptionContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SubscriptionContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SubscriptionContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/subscriptions'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/property_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/property_operations.py new file mode 100644 index 000000000000..a9dc5ef44fa4 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/property_operations.py @@ -0,0 +1,462 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PropertyOperations(object): + """PropertyOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of properties defined within a service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported functions + | + |-------|------------------------|-------------------------------------------------------| + | tags | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith, any, all | + | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PropertyContract + :rtype: + ~azure.mgmt.apimanagement.models.PropertyContractPaged[~azure.mgmt.apimanagement.models.PropertyContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PropertyContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PropertyContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties'} + + def get_entity_tag( + self, resource_group_name, service_name, prop_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the property specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param prop_id: Identifier of the property. + :type prop_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} + + def get( + self, resource_group_name, service_name, prop_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the property specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param prop_id: Identifier of the property. + :type prop_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PropertyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PropertyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PropertyContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} + + def create_or_update( + self, resource_group_name, service_name, prop_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a property. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param prop_id: Identifier of the property. + :type prop_id: str + :param parameters: Create parameters. + :type parameters: ~azure.mgmt.apimanagement.models.PropertyContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PropertyContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PropertyContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PropertyContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PropertyContract', response) + if response.status_code == 201: + deserialized = self._deserialize('PropertyContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} + + def update( + self, resource_group_name, service_name, prop_id, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates the specific property. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param prop_id: Identifier of the property. + :type prop_id: str + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.PropertyUpdateParameters + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PropertyUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} + + def delete( + self, resource_group_name, service_name, prop_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes specific property from the the API Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param prop_id: Identifier of the property. + :type prop_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/quota_by_counter_keys_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/quota_by_counter_keys_operations.py new file mode 100644 index 000000000000..bc54f6217d8a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/quota_by_counter_keys_operations.py @@ -0,0 +1,181 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class QuotaByCounterKeysOperations(object): + """QuotaByCounterKeysOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, quota_counter_key, custom_headers=None, raw=False, **operation_config): + """Lists a collection of current quota counter periods associated with the + counter-key configured in the policy on the specified service instance. + The api does not support paging yet. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param quota_counter_key: Quota counter key identifier.This is the + result of expression defined in counter-key attribute of the + quota-by-key policy.For Example, if you specify counter-key="boo" in + the policy, then it’s accessible by "boo" counter key. But if it’s + defined as counter-key="@("b"+"a")" then it will be accessible by "ba" + key + :type quota_counter_key: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: QuotaCounterCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'quotaCounterKey': self._serialize.url("quota_counter_key", quota_counter_key, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('QuotaCounterCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}'} + + def update( + self, resource_group_name, service_name, quota_counter_key, calls_count=None, kb_transferred=None, custom_headers=None, raw=False, **operation_config): + """Updates all the quota counter values specified with the existing quota + counter key to a value in the specified service instance. This should + be used for reset of the quota counter values. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param quota_counter_key: Quota counter key identifier.This is the + result of expression defined in counter-key attribute of the + quota-by-key policy.For Example, if you specify counter-key="boo" in + the policy, then it’s accessible by "boo" counter key. But if it’s + defined as counter-key="@("b"+"a")" then it will be accessible by "ba" + key + :type quota_counter_key: str + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.QuotaCounterValueContractProperties(calls_count=calls_count, kb_transferred=kb_transferred) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'quotaCounterKey': self._serialize.url("quota_counter_key", quota_counter_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'QuotaCounterValueContractProperties') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/quota_by_period_keys_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/quota_by_period_keys_operations.py new file mode 100644 index 000000000000..ee9c5c1bfc82 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/quota_by_period_keys_operations.py @@ -0,0 +1,185 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class QuotaByPeriodKeysOperations(object): + """QuotaByPeriodKeysOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def get( + self, resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers=None, raw=False, **operation_config): + """Gets the value of the quota counter associated with the counter-key in + the policy for the specific period in service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param quota_counter_key: Quota counter key identifier.This is the + result of expression defined in counter-key attribute of the + quota-by-key policy.For Example, if you specify counter-key="boo" in + the policy, then it’s accessible by "boo" counter key. But if it’s + defined as counter-key="@("b"+"a")" then it will be accessible by "ba" + key + :type quota_counter_key: str + :param quota_period_key: Quota period key identifier. + :type quota_period_key: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: QuotaCounterContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'quotaCounterKey': self._serialize.url("quota_counter_key", quota_counter_key, 'str'), + 'quotaPeriodKey': self._serialize.url("quota_period_key", quota_period_key, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('QuotaCounterContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}'} + + def update( + self, resource_group_name, service_name, quota_counter_key, quota_period_key, calls_count=None, kb_transferred=None, custom_headers=None, raw=False, **operation_config): + """Updates an existing quota counter value in the specified service + instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param quota_counter_key: Quota counter key identifier.This is the + result of expression defined in counter-key attribute of the + quota-by-key policy.For Example, if you specify counter-key="boo" in + the policy, then it’s accessible by "boo" counter key. But if it’s + defined as counter-key="@("b"+"a")" then it will be accessible by "ba" + key + :type quota_counter_key: str + :param quota_period_key: Quota period key identifier. + :type quota_period_key: str + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.QuotaCounterValueContractProperties(calls_count=calls_count, kb_transferred=kb_transferred) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'quotaCounterKey': self._serialize.url("quota_counter_key", quota_counter_key, 'str'), + 'quotaPeriodKey': self._serialize.url("quota_period_key", quota_period_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'QuotaCounterValueContractProperties') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/regions_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/regions_operations.py new file mode 100644 index 000000000000..e1d073e10af7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/regions_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RegionsOperations(object): + """RegionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Lists all azure regions in which the service exists. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RegionContract + :rtype: + ~azure.mgmt.apimanagement.models.RegionContractPaged[~azure.mgmt.apimanagement.models.RegionContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RegionContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RegionContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/reports_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/reports_operations.py new file mode 100644 index 000000000000..f8aba4048a74 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/reports_operations.py @@ -0,0 +1,704 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ReportsOperations(object): + """ReportsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_api( + self, resource_group_name, service_name, filter, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists report records by API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ReportRecordContract + :rtype: + ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi'} + + def list_by_user( + self, resource_group_name, service_name, filter, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists report records by User. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ReportRecordContract + :rtype: + ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_user.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser'} + + def list_by_operation( + self, resource_group_name, service_name, filter, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists report records by API Operations. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ReportRecordContract + :rtype: + ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_operation.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation'} + + def list_by_product( + self, resource_group_name, service_name, filter, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists report records by Product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ReportRecordContract + :rtype: + ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_product.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct'} + + def list_by_geo( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists report records by GeoGraphy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ReportRecordContract + :rtype: + ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_geo.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_geo.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo'} + + def list_by_subscription( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists report records by subscription. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ReportRecordContract + :rtype: + ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription'} + + def list_by_time( + self, resource_group_name, service_name, interval, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists report records by Time. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param interval: By time interval. Interval must be multiple of 15 + minutes and may not be zero. The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be + used to convert TimeSpan to a valid interval string: + XmlConvert.ToString(new TimeSpan(hours, minutes, secconds)) + :type interval: timedelta + :param filter: The filter to apply on the operation. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ReportRecordContract + :rtype: + ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_time.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['interval'] = self._serialize.query("interval", interval, 'duration') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReportRecordContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_time.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime'} + + def list_by_request( + self, resource_group_name, service_name, filter, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists report records by Request. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RequestReportRecordContract + :rtype: + ~azure.mgmt.apimanagement.models.RequestReportRecordContractPaged[~azure.mgmt.apimanagement.models.RequestReportRecordContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_request.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RequestReportRecordContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RequestReportRecordContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_request.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/sign_in_settings_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/sign_in_settings_operations.py new file mode 100644 index 000000000000..a1eee88bc069 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/sign_in_settings_operations.py @@ -0,0 +1,296 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SignInSettingsOperations(object): + """SignInSettingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def get_entity_tag( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the SignInSettings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get Sign-In settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PortalSigninSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PortalSigninSettings or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PortalSigninSettings', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} + + def update( + self, resource_group_name, service_name, if_match, enabled=None, custom_headers=None, raw=False, **operation_config): + """Update Sign-In settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param enabled: Redirect Anonymous users to the Sign-In page. + :type enabled: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PortalSigninSettings(enabled=enabled) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PortalSigninSettings') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} + + def create_or_update( + self, resource_group_name, service_name, enabled=None, custom_headers=None, raw=False, **operation_config): + """Create or Update Sign-In settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param enabled: Redirect Anonymous users to the Sign-In page. + :type enabled: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PortalSigninSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PortalSigninSettings or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PortalSigninSettings(enabled=enabled) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PortalSigninSettings') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PortalSigninSettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/sign_up_settings_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/sign_up_settings_operations.py new file mode 100644 index 000000000000..97c5d90ec45a --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/sign_up_settings_operations.py @@ -0,0 +1,302 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SignUpSettingsOperations(object): + """SignUpSettingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def get_entity_tag( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the SignUpSettings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get Sign-Up settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PortalSignupSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PortalSignupSettings or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PortalSignupSettings', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} + + def update( + self, resource_group_name, service_name, if_match, enabled=None, terms_of_service=None, custom_headers=None, raw=False, **operation_config): + """Update Sign-Up settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param enabled: Allow users to sign up on a developer portal. + :type enabled: bool + :param terms_of_service: Terms of service contract properties. + :type terms_of_service: + ~azure.mgmt.apimanagement.models.TermsOfServiceProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PortalSignupSettings(enabled=enabled, terms_of_service=terms_of_service) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PortalSignupSettings') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} + + def create_or_update( + self, resource_group_name, service_name, enabled=None, terms_of_service=None, custom_headers=None, raw=False, **operation_config): + """Create or Update Sign-Up settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param enabled: Allow users to sign up on a developer portal. + :type enabled: bool + :param terms_of_service: Terms of service contract properties. + :type terms_of_service: + ~azure.mgmt.apimanagement.models.TermsOfServiceProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PortalSignupSettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PortalSignupSettings or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PortalSignupSettings(enabled=enabled, terms_of_service=terms_of_service) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PortalSignupSettings') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PortalSignupSettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/subscription_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/subscription_operations.py new file mode 100644 index 000000000000..e07edfd81fd7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/subscription_operations.py @@ -0,0 +1,605 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SubscriptionOperations(object): + """SubscriptionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all subscriptions of the API Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |--------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | userId | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | productId | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | state | eq | + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SubscriptionContract + :rtype: + ~azure.mgmt.apimanagement.models.SubscriptionContractPaged[~azure.mgmt.apimanagement.models.SubscriptionContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SubscriptionContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SubscriptionContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions'} + + def get_entity_tag( + self, resource_group_name, service_name, sid, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the apimanagement subscription + specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param sid: Subscription entity Identifier. The entity represents the + association between a user and a product in API Management. + :type sid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'sid': self._serialize.url("sid", sid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} + + def get( + self, resource_group_name, service_name, sid, custom_headers=None, raw=False, **operation_config): + """Gets the specified Subscription entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param sid: Subscription entity Identifier. The entity represents the + association between a user and a product in API Management. + :type sid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SubscriptionContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'sid': self._serialize.url("sid", sid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('SubscriptionContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} + + def create_or_update( + self, resource_group_name, service_name, sid, parameters, notify=None, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates the subscription of specified user to the specified + product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param sid: Subscription entity Identifier. The entity represents the + association between a user and a product in API Management. + :type sid: str + :param parameters: Create parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.SubscriptionCreateParameters + :param notify: Notify change in Subscription State. + - If false, do not send any email notification for change of state of + subscription + - If true, send email notification of change of state of subscription + :type notify: bool + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SubscriptionContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'sid': self._serialize.url("sid", sid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if notify is not None: + query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SubscriptionCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SubscriptionContract', response) + if response.status_code == 201: + deserialized = self._deserialize('SubscriptionContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} + + def update( + self, resource_group_name, service_name, sid, parameters, if_match, notify=None, custom_headers=None, raw=False, **operation_config): + """Updates the details of a subscription specificied by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param sid: Subscription entity Identifier. The entity represents the + association between a user and a product in API Management. + :type sid: str + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.SubscriptionUpdateParameters + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param notify: Notify change in Subscription State. + - If false, do not send any email notification for change of state of + subscription + - If true, send email notification of change of state of subscription + :type notify: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'sid': self._serialize.url("sid", sid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if notify is not None: + query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SubscriptionUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} + + def delete( + self, resource_group_name, service_name, sid, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified subscription. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param sid: Subscription entity Identifier. The entity represents the + association between a user and a product in API Management. + :type sid: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'sid': self._serialize.url("sid", sid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} + + def regenerate_primary_key( + self, resource_group_name, service_name, sid, custom_headers=None, raw=False, **operation_config): + """Regenerates primary key of existing subscription of the API Management + service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param sid: Subscription entity Identifier. The entity represents the + association between a user and a product in API Management. + :type sid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.regenerate_primary_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'sid': self._serialize.url("sid", sid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey'} + + def regenerate_secondary_key( + self, resource_group_name, service_name, sid, custom_headers=None, raw=False, **operation_config): + """Regenerates secondary key of existing subscription of the API + Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param sid: Subscription entity Identifier. The entity represents the + association between a user and a product in API Management. + :type sid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.regenerate_secondary_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'sid': self._serialize.url("sid", sid, 'str', max_length=80, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tag_description_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tag_description_operations.py new file mode 100644 index 000000000000..f1ac22de336f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tag_description_operations.py @@ -0,0 +1,423 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TagDescriptionOperations(object): + """TagDescriptionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_api( + self, resource_group_name, service_name, api_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all Tags descriptions in scope of API. Model similar to swagger - + tagDescription is defined on API level but tag may be assigned to the + Operations. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TagDescriptionContract + :rtype: + ~azure.mgmt.apimanagement.models.TagDescriptionContractPaged[~azure.mgmt.apimanagement.models.TagDescriptionContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TagDescriptionContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TagDescriptionContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions'} + + def get_entity_state( + self, resource_group_name, service_name, api_id, tag_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state version of the tag specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_state.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}'} + + def get( + self, resource_group_name, service_name, api_id, tag_id, custom_headers=None, raw=False, **operation_config): + """Get tag associated with the API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagDescriptionContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagDescriptionContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('TagDescriptionContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, tag_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Create/Update tag fescription in scope of the Api. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param parameters: Create parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.TagDescriptionCreateParameters + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagDescriptionContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagDescriptionContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagDescriptionCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TagDescriptionContract', response) + if response.status_code == 201: + deserialized = self._deserialize('TagDescriptionContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}'} + + def delete( + self, resource_group_name, service_name, api_id, tag_id, if_match, custom_headers=None, raw=False, **operation_config): + """Delete tag description for the Api. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tag_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tag_operations.py new file mode 100644 index 000000000000..8890d3d907f2 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tag_operations.py @@ -0,0 +1,1616 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TagOperations(object): + """TagOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of tags defined within a service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TagContract + :rtype: + ~azure.mgmt.apimanagement.models.TagContractPaged[~azure.mgmt.apimanagement.models.TagContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TagContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TagContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags'} + + def get_entity_state( + self, resource_group_name, service_name, tag_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state version of the tag specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_state.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} + + def get( + self, resource_group_name, service_name, tag_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the tag specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('TagContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} + + def create_or_update( + self, resource_group_name, service_name, tag_id, display_name, custom_headers=None, raw=False, **operation_config): + """Creates a tag. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param display_name: Tag name. + :type display_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.TagCreateUpdateParameters(display_name=display_name) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagCreateUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TagContract', response) + if response.status_code == 201: + deserialized = self._deserialize('TagContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} + + def update( + self, resource_group_name, service_name, tag_id, if_match, display_name, custom_headers=None, raw=False, **operation_config): + """Updates the details of the tag specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param display_name: Tag name. + :type display_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.TagCreateUpdateParameters(display_name=display_name) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagCreateUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} + + def delete( + self, resource_group_name, service_name, tag_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes specific tag of the API Management service instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} + + def list_by_api( + self, resource_group_name, service_name, api_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all Tags associated with the API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TagContract + :rtype: + ~azure.mgmt.apimanagement.models.TagContractPaged[~azure.mgmt.apimanagement.models.TagContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TagContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TagContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags'} + + def get_entity_state_by_api( + self, resource_group_name, service_name, api_id, tag_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state version of the tag specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_state_by_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_state_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} + + def get_by_api( + self, resource_group_name, service_name, api_id, tag_id, custom_headers=None, raw=False, **operation_config): + """Get tag associated with the API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('TagContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} + + def assign_to_api( + self, resource_group_name, service_name, api_id, tag_id, if_match=None, custom_headers=None, raw=False, **operation_config): + """Assign tag to the Api. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.assign_to_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TagContract', response) + if response.status_code == 201: + deserialized = self._deserialize('TagContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + assign_to_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} + + def detach_from_api( + self, resource_group_name, service_name, api_id, tag_id, if_match, custom_headers=None, raw=False, **operation_config): + """Detach the tag from the Api. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.detach_from_api.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + detach_from_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} + + def list_by_operation( + self, resource_group_name, service_name, api_id, operation_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all Tags associated with the Operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | method | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TagContract + :rtype: + ~azure.mgmt.apimanagement.models.TagContractPaged[~azure.mgmt.apimanagement.models.TagContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_operation.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TagContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TagContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags'} + + def get_entity_state_by_operation( + self, resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state version of the tag specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_state_by_operation.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_state_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} + + def get_by_operation( + self, resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers=None, raw=False, **operation_config): + """Get tag associated with the Operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_operation.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('TagContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} + + def assign_to_operation( + self, resource_group_name, service_name, api_id, operation_id, tag_id, if_match=None, custom_headers=None, raw=False, **operation_config): + """Assign tag to the Operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.assign_to_operation.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TagContract', response) + if response.status_code == 201: + deserialized = self._deserialize('TagContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + assign_to_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} + + def detach_from_operation( + self, resource_group_name, service_name, api_id, operation_id, tag_id, if_match, custom_headers=None, raw=False, **operation_config): + """Detach the tag from the Operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API revision identifier. Must be unique in the current + API Management service instance. Non-current revision has ;rev=n as a + suffix where n is the revision number. + :type api_id: str + :param operation_id: Operation identifier within an API. Must be + unique in the current API Management service instance. + :type operation_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.detach_from_operation.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + detach_from_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} + + def list_by_product( + self, resource_group_name, service_name, product_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all Tags associated with the Product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TagContract + :rtype: + ~azure.mgmt.apimanagement.models.TagContractPaged[~azure.mgmt.apimanagement.models.TagContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_product.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TagContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TagContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags'} + + def get_entity_state_by_product( + self, resource_group_name, service_name, product_id, tag_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state version of the tag specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_state_by_product.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_state_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} + + def get_by_product( + self, resource_group_name, service_name, product_id, tag_id, custom_headers=None, raw=False, **operation_config): + """Get tag associated with the Product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_product.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('TagContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} + + def assign_to_product( + self, resource_group_name, service_name, product_id, tag_id, if_match=None, custom_headers=None, raw=False, **operation_config): + """Assign tag to the Product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.assign_to_product.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TagContract', response) + if response.status_code == 201: + deserialized = self._deserialize('TagContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + assign_to_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} + + def detach_from_product( + self, resource_group_name, service_name, product_id, tag_id, if_match, custom_headers=None, raw=False, **operation_config): + """Detach the tag from the Product. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param product_id: Product identifier. Must be unique in the current + API Management service instance. + :type product_id: str + :param tag_id: Tag identifier. Must be unique in the current API + Management service instance. + :type tag_id: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.detach_from_product.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'productId': self._serialize.url("product_id", product_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'tagId': self._serialize.url("tag_id", tag_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + detach_from_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tag_resource_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tag_resource_operations.py new file mode 100644 index 000000000000..f870c52e3f2b --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tag_resource_operations.py @@ -0,0 +1,149 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TagResourceOperations(object): + """TagResourceOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of resources associated with tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | aid | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | apiName | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | path | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | method | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | terms | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | state | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | isCurrent | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TagResourceContract + :rtype: + ~azure.mgmt.apimanagement.models.TagResourceContractPaged[~azure.mgmt.apimanagement.models.TagResourceContract] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TagResourceContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TagResourceContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tagResources'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tenant_access_git_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tenant_access_git_operations.py new file mode 100644 index 000000000000..dd6aee9db023 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tenant_access_git_operations.py @@ -0,0 +1,214 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TenantAccessGitOperations(object): + """TenantAccessGitOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar access_name: The identifier of the Access configuration. Constant value: "access". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + self.access_name = "access" + + self.config = config + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets the Git access configuration for the tenant. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessInformationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'accessName': self._serialize.url("self.access_name", self.access_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('AccessInformationContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git'} + + def regenerate_primary_key( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Regenerate primary access key for GIT. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.regenerate_primary_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'accessName': self._serialize.url("self.access_name", self.access_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey'} + + def regenerate_secondary_key( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Regenerate secondary access key for GIT. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.regenerate_secondary_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'accessName': self._serialize.url("self.access_name", self.access_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tenant_access_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tenant_access_operations.py new file mode 100644 index 000000000000..688ab94a2bb3 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tenant_access_operations.py @@ -0,0 +1,284 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TenantAccessOperations(object): + """TenantAccessOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar access_name: The identifier of the Access configuration. Constant value: "access". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + self.access_name = "access" + + self.config = config + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get tenant access information details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessInformationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'accessName': self._serialize.url("self.access_name", self.access_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('AccessInformationContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} + + def update( + self, resource_group_name, service_name, if_match, enabled=None, custom_headers=None, raw=False, **operation_config): + """Update tenant access information details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param enabled: Tenant access information of the API Management + service. + :type enabled: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.AccessInformationUpdateParameters(enabled=enabled) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'accessName': self._serialize.url("self.access_name", self.access_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AccessInformationUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} + + def regenerate_primary_key( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Regenerate primary access key. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.regenerate_primary_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'accessName': self._serialize.url("self.access_name", self.access_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey'} + + def regenerate_secondary_key( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Regenerate secondary access key. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.regenerate_secondary_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'accessName': self._serialize.url("self.access_name", self.access_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tenant_configuration_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tenant_configuration_operations.py new file mode 100644 index 000000000000..42f8f322f8e9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/tenant_configuration_operations.py @@ -0,0 +1,435 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class TenantConfigurationOperations(object): + """TenantConfigurationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar configuration_name: The identifier of the Git Configuration Operation. Constant value: "configuration". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + self.configuration_name = "configuration" + + self.config = config + + + def _deploy_initial( + self, resource_group_name, service_name, branch, force=None, custom_headers=None, raw=False, **operation_config): + parameters = models.DeployConfigurationParameters(branch=branch, force=force) + + # Construct URL + url = self.deploy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'configurationName': self._serialize.url("self.configuration_name", self.configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DeployConfigurationParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationResultContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def deploy( + self, resource_group_name, service_name, branch, force=None, custom_headers=None, raw=False, polling=True, **operation_config): + """This operation applies changes from the specified Git branch to the + configuration database. This is a long running operation and could take + several minutes to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param branch: The name of the Git branch from which the configuration + is to be deployed to the configuration database. + :type branch: str + :param force: The value enforcing deleting subscriptions to products + that are deleted in this update. + :type force: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationResultContract + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.OperationResultContract] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.OperationResultContract]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._deploy_initial( + resource_group_name=resource_group_name, + service_name=service_name, + branch=branch, + force=force, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationResultContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy'} + + + def _save_initial( + self, resource_group_name, service_name, branch, force=None, custom_headers=None, raw=False, **operation_config): + parameters = models.SaveConfigurationParameter(branch=branch, force=force) + + # Construct URL + url = self.save.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'configurationName': self._serialize.url("self.configuration_name", self.configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SaveConfigurationParameter') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationResultContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def save( + self, resource_group_name, service_name, branch, force=None, custom_headers=None, raw=False, polling=True, **operation_config): + """This operation creates a commit with the current configuration snapshot + to the specified branch in the repository. This is a long running + operation and could take several minutes to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param branch: The name of the Git branch in which to commit the + current configuration snapshot. + :type branch: str + :param force: The value if true, the current configuration database is + committed to the Git repository, even if the Git repository has newer + changes that would be overwritten. + :type force: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationResultContract + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.OperationResultContract] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.OperationResultContract]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._save_initial( + resource_group_name=resource_group_name, + service_name=service_name, + branch=branch, + force=force, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationResultContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + save.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save'} + + + def _validate_initial( + self, resource_group_name, service_name, branch, force=None, custom_headers=None, raw=False, **operation_config): + parameters = models.DeployConfigurationParameters(branch=branch, force=force) + + # Construct URL + url = self.validate.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'configurationName': self._serialize.url("self.configuration_name", self.configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DeployConfigurationParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationResultContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate( + self, resource_group_name, service_name, branch, force=None, custom_headers=None, raw=False, polling=True, **operation_config): + """This operation validates the changes in the specified Git branch. This + is a long running operation and could take several minutes to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param branch: The name of the Git branch from which the configuration + is to be deployed to the configuration database. + :type branch: str + :param force: The value enforcing deleting subscriptions to products + that are deleted in this update. + :type force: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationResultContract + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.OperationResultContract] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.OperationResultContract]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + branch=branch, + force=force, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationResultContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate'} + + def get_sync_state( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets the status of the most recent synchronization between the + configuration database and the Git repository. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TenantConfigurationSyncStateContract or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.apimanagement.models.TenantConfigurationSyncStateContract + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_sync_state.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'configurationName': self._serialize.url("self.configuration_name", self.configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TenantConfigurationSyncStateContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_sync_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_group_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_group_operations.py new file mode 100644 index 000000000000..7df3219adb2f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_group_operations.py @@ -0,0 +1,131 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class UserGroupOperations(object): + """UserGroupOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, service_name, uid, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all user groups. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GroupContract + :rtype: + ~azure.mgmt.apimanagement.models.GroupContractPaged[~azure.mgmt.apimanagement.models.GroupContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.GroupContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.GroupContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/groups'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_identities_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_identities_operations.py new file mode 100644 index 000000000000..47b38db92ee8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_identities_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class UserIdentitiesOperations(object): + """UserIdentitiesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, service_name, uid, custom_headers=None, raw=False, **operation_config): + """Lists all user identities. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of UserIdentityContract + :rtype: + ~azure.mgmt.apimanagement.models.UserIdentityContractPaged[~azure.mgmt.apimanagement.models.UserIdentityContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.UserIdentityContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UserIdentityContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/identities'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_operations.py new file mode 100644 index 000000000000..85f2c1619de9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_operations.py @@ -0,0 +1,630 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class UserOperations(object): + """UserOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of registered users in the specified service + instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: | Field | Supported operators | Supported + functions | + |------------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | email | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | state | eq | N/A + | + | registrationDate | ge, le, eq, ne, gt, lt | N/A + | + | note | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of UserContract + :rtype: + ~azure.mgmt.apimanagement.models.UserContractPaged[~azure.mgmt.apimanagement.models.UserContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.UserContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UserContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users'} + + def get_entity_tag( + self, resource_group_name, service_name, uid, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the user specified by its + identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}'} + + def get( + self, resource_group_name, service_name, uid, custom_headers=None, raw=False, **operation_config): + """Gets the details of the user specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: UserContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.UserContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('UserContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}'} + + def create_or_update( + self, resource_group_name, service_name, uid, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or Updates a user. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param parameters: Create or update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.UserCreateParameters + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: UserContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.UserContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'UserCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UserContract', response) + if response.status_code == 201: + deserialized = self._deserialize('UserContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}'} + + def update( + self, resource_group_name, service_name, uid, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates the details of the user specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param parameters: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.UserUpdateParameters + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'UserUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}'} + + def delete( + self, resource_group_name, service_name, uid, if_match, delete_subscriptions=None, notify=None, custom_headers=None, raw=False, **operation_config): + """Deletes specific user. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param if_match: ETag of the Entity. ETag should match the current + entity state from the header response of the GET request or it should + be * for unconditional update. + :type if_match: str + :param delete_subscriptions: Whether to delete user's subscription or + not. + :type delete_subscriptions: bool + :param notify: Send an Account Closed Email notification to the User. + :type notify: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if delete_subscriptions is not None: + query_parameters['deleteSubscriptions'] = self._serialize.query("delete_subscriptions", delete_subscriptions, 'bool') + if notify is not None: + query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}'} + + def generate_sso_url( + self, resource_group_name, service_name, uid, custom_headers=None, raw=False, **operation_config): + """Retrieves a redirection URL containing an authentication token for + signing a given user into the developer portal. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GenerateSsoUrlResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.GenerateSsoUrlResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.generate_sso_url.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GenerateSsoUrlResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + generate_sso_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/generateSsoUrl'} + + def get_shared_access_token( + self, resource_group_name, service_name, uid, expiry, key_type="primary", custom_headers=None, raw=False, **operation_config): + """Gets the Shared Access Authorization Token for the User. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param key_type: The Key to be used to generate token for user. + Possible values include: 'primary', 'secondary' + :type key_type: str or ~azure.mgmt.apimanagement.models.KeyType + :param expiry: The Expiry time of the Token. Maximum token expiry time + is set to 30 days. The date conforms to the following format: + `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + :type expiry: datetime + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: UserTokenResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.UserTokenResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.UserTokenParameters(key_type=key_type, expiry=expiry) + + # Construct URL + url = self.get_shared_access_token.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'UserTokenParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UserTokenResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_shared_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/token'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_subscription_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_subscription_operations.py new file mode 100644 index 000000000000..4b0efda6e060 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_subscription_operations.py @@ -0,0 +1,137 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class UserSubscriptionOperations(object): + """UserSubscriptionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, service_name, uid, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists the collection of subscriptions of the specified user. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param uid: User identifier. Must be unique in the current API + Management service instance. + :type uid: str + :param filter: | Field | Supported operators | Supported + functions | + |--------------|------------------------|---------------------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | name | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | userId | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | productId | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith | + | state | eq | + | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SubscriptionContract + :rtype: + ~azure.mgmt.apimanagement.models.SubscriptionContractPaged[~azure.mgmt.apimanagement.models.SubscriptionContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'uid': self._serialize.url("uid", uid, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SubscriptionContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SubscriptionContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/subscriptions'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/version.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/version.py @@ -0,0 +1,13 @@ +# 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 = "0.1.0" + diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py index 58dac299a951..e561ff7983d0 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py @@ -9,28 +9,52 @@ # regenerated. # -------------------------------------------------------------------------- -from .sku import Sku -from .permissions import Permissions -from .access_policy_entry import AccessPolicyEntry -from .ip_rule import IPRule -from .virtual_network_rule import VirtualNetworkRule -from .network_rule_set import NetworkRuleSet -from .vault_properties import VaultProperties -from .vault_patch_properties import VaultPatchProperties -from .vault_access_policy_properties import VaultAccessPolicyProperties -from .deleted_vault_properties import DeletedVaultProperties -from .vault_create_or_update_parameters import VaultCreateOrUpdateParameters -from .vault_patch_parameters import VaultPatchParameters -from .vault_access_policy_parameters import VaultAccessPolicyParameters -from .vault import Vault -from .deleted_vault import DeletedVault -from .resource import Resource -from .vault_check_name_availability_parameters import VaultCheckNameAvailabilityParameters -from .check_name_availability_result import CheckNameAvailabilityResult -from .operation_display import OperationDisplay -from .log_specification import LogSpecification -from .service_specification import ServiceSpecification -from .operation import Operation +try: + from .sku_py3 import Sku + from .permissions_py3 import Permissions + from .access_policy_entry_py3 import AccessPolicyEntry + from .ip_rule_py3 import IPRule + from .virtual_network_rule_py3 import VirtualNetworkRule + from .network_rule_set_py3 import NetworkRuleSet + from .vault_properties_py3 import VaultProperties + from .vault_patch_properties_py3 import VaultPatchProperties + from .vault_access_policy_properties_py3 import VaultAccessPolicyProperties + from .deleted_vault_properties_py3 import DeletedVaultProperties + from .vault_create_or_update_parameters_py3 import VaultCreateOrUpdateParameters + from .vault_patch_parameters_py3 import VaultPatchParameters + from .vault_access_policy_parameters_py3 import VaultAccessPolicyParameters + from .vault_py3 import Vault + from .deleted_vault_py3 import DeletedVault + from .resource_py3 import Resource + from .vault_check_name_availability_parameters_py3 import VaultCheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .operation_display_py3 import OperationDisplay + from .log_specification_py3 import LogSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_py3 import Operation +except (SyntaxError, ImportError): + from .sku import Sku + from .permissions import Permissions + from .access_policy_entry import AccessPolicyEntry + from .ip_rule import IPRule + from .virtual_network_rule import VirtualNetworkRule + from .network_rule_set import NetworkRuleSet + from .vault_properties import VaultProperties + from .vault_patch_properties import VaultPatchProperties + from .vault_access_policy_properties import VaultAccessPolicyProperties + from .deleted_vault_properties import DeletedVaultProperties + from .vault_create_or_update_parameters import VaultCreateOrUpdateParameters + from .vault_patch_parameters import VaultPatchParameters + from .vault_access_policy_parameters import VaultAccessPolicyParameters + from .vault import Vault + from .deleted_vault import DeletedVault + from .resource import Resource + from .vault_check_name_availability_parameters import VaultCheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .operation_display import OperationDisplay + from .log_specification import LogSpecification + from .service_specification import ServiceSpecification + from .operation import Operation from .vault_paged import VaultPaged from .deleted_vault_paged import DeletedVaultPaged from .resource_paged import ResourcePaged diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py index 2b4ccd6fb4cb..532fd4ad3cc4 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py @@ -16,18 +16,20 @@ class AccessPolicyEntry(Model): """An identity that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. - :param tenant_id: The Azure Active Directory tenant ID that should be used - for authenticating requests to the key vault. + All required parameters must be populated in order to send to Azure. + + :param tenant_id: Required. The Azure Active Directory tenant ID that + should be used for authenticating requests to the key vault. :type tenant_id: str - :param object_id: The object ID of a user, service principal or security - group in the Azure Active Directory tenant for the vault. The object ID - must be unique for the list of access policies. + :param object_id: Required. The object ID of a user, service principal or + security group in the Azure Active Directory tenant for the vault. The + object ID must be unique for the list of access policies. :type object_id: str :param application_id: Application ID of the client making request on behalf of a principal :type application_id: str - :param permissions: Permissions the identity has for keys, secrets and - certificates. + :param permissions: Required. Permissions the identity has for keys, + secrets and certificates. :type permissions: ~azure.mgmt.keyvault.models.Permissions """ @@ -44,9 +46,9 @@ class AccessPolicyEntry(Model): 'permissions': {'key': 'permissions', 'type': 'Permissions'}, } - def __init__(self, tenant_id, object_id, permissions, application_id=None): - super(AccessPolicyEntry, self).__init__() - self.tenant_id = tenant_id - self.object_id = object_id - self.application_id = application_id - self.permissions = permissions + def __init__(self, **kwargs): + super(AccessPolicyEntry, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.object_id = kwargs.get('object_id', None) + self.application_id = kwargs.get('application_id', None) + self.permissions = kwargs.get('permissions', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry_py3.py new file mode 100644 index 000000000000..1862c8f5e881 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class AccessPolicyEntry(Model): + """An identity that have access to the key vault. All identities in the array + must use the same tenant ID as the key vault's tenant ID. + + All required parameters must be populated in order to send to Azure. + + :param tenant_id: Required. The Azure Active Directory tenant ID that + should be used for authenticating requests to the key vault. + :type tenant_id: str + :param object_id: Required. The object ID of a user, service principal or + security group in the Azure Active Directory tenant for the vault. The + object ID must be unique for the list of access policies. + :type object_id: str + :param application_id: Application ID of the client making request on + behalf of a principal + :type application_id: str + :param permissions: Required. Permissions the identity has for keys, + secrets and certificates. + :type permissions: ~azure.mgmt.keyvault.models.Permissions + """ + + _validation = { + 'tenant_id': {'required': True}, + 'object_id': {'required': True}, + 'permissions': {'required': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'Permissions'}, + } + + def __init__(self, *, tenant_id: str, object_id: str, permissions, application_id: str=None, **kwargs) -> None: + super(AccessPolicyEntry, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.object_id = object_id + self.application_id = application_id + self.permissions = permissions diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result.py index 6e8d8b5a2a9b..eb924fe2ecd6 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..cd818840e171 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: 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: The reason that a vault 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.keyvault.models.Reason + :ivar message: 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': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py index 7b49d29ed836..fde8fff07353 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py @@ -41,9 +41,9 @@ class DeletedVault(Model): 'properties': {'key': 'properties', 'type': 'DeletedVaultProperties'}, } - def __init__(self, properties=None): - super(DeletedVault, self).__init__() + def __init__(self, **kwargs): + super(DeletedVault, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.properties = properties + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties.py index 3247a439d946..76fa9d43de1f 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties.py @@ -46,8 +46,8 @@ class DeletedVaultProperties(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self): - super(DeletedVaultProperties, self).__init__() + def __init__(self, **kwargs): + super(DeletedVaultProperties, self).__init__(**kwargs) self.vault_id = None self.location = None self.deletion_date = None diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties_py3.py new file mode 100644 index 000000000000..c78663f989b5 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class DeletedVaultProperties(Model): + """Properties of the deleted vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar vault_id: The resource id of the original vault. + :vartype vault_id: str + :ivar location: The location of the original vault. + :vartype location: str + :ivar deletion_date: The deleted date. + :vartype deletion_date: datetime + :ivar scheduled_purge_date: The scheduled purged date. + :vartype scheduled_purge_date: datetime + :ivar tags: Tags of the original vault. + :vartype tags: dict[str, str] + """ + + _validation = { + 'vault_id': {'readonly': True}, + 'location': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'vault_id': {'key': 'vaultId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'deletion_date': {'key': 'deletionDate', 'type': 'iso-8601'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(DeletedVaultProperties, self).__init__(**kwargs) + self.vault_id = None + self.location = None + self.deletion_date = None + self.scheduled_purge_date = None + self.tags = None diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_py3.py new file mode 100644 index 000000000000..5ef53e97840f --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_py3.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 msrest.serialization import Model + + +class DeletedVault(Model): + """Deleted vault information with extended details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID for the deleted key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param properties: Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.DeletedVaultProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'DeletedVaultProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeletedVault, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule.py index 4e8dd1fdfc34..8dc2808dd197 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule.py @@ -16,7 +16,9 @@ class IPRule(Model): """A rule governing the accesibility of a vault from a specific ip address or ip range. - :param value: An IPv4 address range in CIDR notation, such as + All required parameters must be populated in order to send to Azure. + + :param value: Required. An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that start with 124.56.78). :type value: str @@ -30,6 +32,6 @@ class IPRule(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(IPRule, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule_py3.py new file mode 100644 index 000000000000..e0656699eb1e --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class IPRule(Model): + """A rule governing the accesibility of a vault from a specific ip address or + ip range. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. An IPv4 address range in CIDR notation, such as + '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that + start with 124.56.78). + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/key_vault_management_client_enums.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/key_vault_management_client_enums.py index 871b034f2215..e31e5b8e5c8f 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/key_vault_management_client_enums.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/key_vault_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class SkuName(Enum): +class SkuName(str, Enum): standard = "standard" premium = "premium" -class KeyPermissions(Enum): +class KeyPermissions(str, Enum): encrypt = "encrypt" decrypt = "decrypt" @@ -38,7 +38,7 @@ class KeyPermissions(Enum): purge = "purge" -class SecretPermissions(Enum): +class SecretPermissions(str, Enum): get = "get" list = "list" @@ -50,7 +50,7 @@ class SecretPermissions(Enum): purge = "purge" -class CertificatePermissions(Enum): +class CertificatePermissions(str, Enum): get = "get" list = "list" @@ -66,9 +66,11 @@ class CertificatePermissions(Enum): manageissuers = "manageissuers" recover = "recover" purge = "purge" + backup = "backup" + restore = "restore" -class StoragePermissions(Enum): +class StoragePermissions(str, Enum): get = "get" list = "list" @@ -86,31 +88,31 @@ class StoragePermissions(Enum): deletesas = "deletesas" -class CreateMode(Enum): +class CreateMode(str, Enum): recover = "recover" default = "default" -class NetworkRuleBypassOptions(Enum): +class NetworkRuleBypassOptions(str, Enum): azure_services = "AzureServices" none = "None" -class NetworkRuleAction(Enum): +class NetworkRuleAction(str, Enum): allow = "Allow" deny = "Deny" -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class AccessPolicyUpdateKind(Enum): +class AccessPolicyUpdateKind(str, Enum): add = "add" replace = "replace" diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification.py index 1c4e46d69fbd..092f8d7039b9 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification.py @@ -29,8 +29,8 @@ class LogSpecification(Model): 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, blob_duration=None): - super(LogSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.blob_duration = blob_duration + 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) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification_py3.py new file mode 100644 index 000000000000..091c8250d3f2 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class LogSpecification(Model): + """Log specification of operation. + + :param name: Name of log specification. + :type name: str + :param display_name: Display name of log specification. + :type display_name: str + :param blob_duration: Blob duration of specification. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set.py index ff6a68c37bc0..59ccba80617a 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set.py @@ -37,9 +37,9 @@ class NetworkRuleSet(Model): 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, } - def __init__(self, bypass=None, default_action=None, ip_rules=None, virtual_network_rules=None): - super(NetworkRuleSet, self).__init__() - self.bypass = bypass - self.default_action = default_action - self.ip_rules = ip_rules - self.virtual_network_rules = virtual_network_rules + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', None) + self.default_action = kwargs.get('default_action', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set_py3.py new file mode 100644 index 000000000000..ae74ff44fa86 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class NetworkRuleSet(Model): + """A set of rules governing the network accessibility of a vault. + + :param bypass: Tells what traffic can bypass network rules. This can be + 'AzureServices' or 'None'. If not specified the default is + 'AzureServices'. Possible values include: 'AzureServices', 'None' + :type bypass: str or ~azure.mgmt.keyvault.models.NetworkRuleBypassOptions + :param default_action: The default action when no rule from ipRules and + from virtualNetworkRules match. This is only used after the bypass + property has been evaluated. Possible values include: 'Allow', 'Deny' + :type default_action: str or ~azure.mgmt.keyvault.models.NetworkRuleAction + :param ip_rules: The list of IP address rules. + :type ip_rules: list[~azure.mgmt.keyvault.models.IPRule] + :param virtual_network_rules: The list of virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.keyvault.models.VirtualNetworkRule] + """ + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + } + + def __init__(self, *, bypass=None, default_action=None, ip_rules=None, virtual_network_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.default_action = default_action + self.ip_rules = ip_rules + self.virtual_network_rules = virtual_network_rules diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation.py index 27e52fdb7f54..201a18369a5d 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation.py @@ -34,9 +34,9 @@ class Operation(Model): 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, } - def __init__(self, name=None, display=None, origin=None, service_specification=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification + 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) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display.py index ccb8d7adee3a..6aaa72c83818 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display.py @@ -32,9 +32,9 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + 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) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display_py3.py new file mode 100644 index 000000000000..75671557dbee --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Key Vault. + :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: Decription of 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: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_py3.py new file mode 100644 index 000000000000..caad53eed64b --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """Key Vault 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.keyvault.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.keyvault.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: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions.py index 25d73401a680..cd774ee7763f 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions.py @@ -33,9 +33,9 @@ class Permissions(Model): 'storage': {'key': 'storage', 'type': '[str]'}, } - def __init__(self, keys=None, secrets=None, certificates=None, storage=None): - super(Permissions, self).__init__() - self.keys = keys - self.secrets = secrets - self.certificates = certificates - self.storage = storage + def __init__(self, **kwargs): + super(Permissions, self).__init__(**kwargs) + self.keys = kwargs.get('keys', None) + self.secrets = kwargs.get('secrets', None) + self.certificates = kwargs.get('certificates', None) + self.storage = kwargs.get('storage', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions_py3.py new file mode 100644 index 000000000000..a46b41e32517 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class Permissions(Model): + """Permissions the identity has for keys, secrets, certificates and storage. + + :param keys: Permissions to keys + :type keys: list[str or ~azure.mgmt.keyvault.models.KeyPermissions] + :param secrets: Permissions to secrets + :type secrets: list[str or ~azure.mgmt.keyvault.models.SecretPermissions] + :param certificates: Permissions to certificates + :type certificates: list[str or + ~azure.mgmt.keyvault.models.CertificatePermissions] + :param storage: Permissions to storage accounts + :type storage: list[str or ~azure.mgmt.keyvault.models.StoragePermissions] + """ + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[str]'}, + 'secrets': {'key': 'secrets', 'type': '[str]'}, + 'certificates': {'key': 'certificates', 'type': '[str]'}, + 'storage': {'key': 'storage', 'type': '[str]'}, + } + + def __init__(self, *, keys=None, secrets=None, certificates=None, storage=None, **kwargs) -> None: + super(Permissions, self).__init__(**kwargs) + self.keys = keys + self.secrets = secrets + self.certificates = certificates + self.storage = storage diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource.py index 9d91463bfeee..0c30e1ffcb16 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource.py @@ -18,14 +18,16 @@ class Resource(Model): Variables are only 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 Azure Resource Manager resource ID for the key vault. :vartype id: str :ivar name: The name of the key vault. :vartype name: str :ivar type: The resource type of the key vault. :vartype type: str - :param location: The supported Azure location where the key vault should - be created. + :param location: Required. The supported Azure location where the key + vault should be created. :type location: str :param tags: The tags that will be assigned to the key vault. :type tags: dict[str, str] @@ -46,10 +48,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource_py3.py new file mode 100644 index 000000000000..57daac0d2a91 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource_py3.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """Key Vault 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: The Azure Resource Manager resource ID for the key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :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=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification.py index a4fa109f9243..e049692e09c0 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification.py @@ -24,6 +24,6 @@ class ServiceSpecification(Model): 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, } - def __init__(self, log_specifications=None): - super(ServiceSpecification, self).__init__() - self.log_specifications = log_specifications + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification_py3.py new file mode 100644 index 000000000000..b34f83c19eee --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification_py3.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 msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include log specifications. + + :param log_specifications: Log specifications of operation. + :type log_specifications: + list[~azure.mgmt.keyvault.models.LogSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__(self, *, log_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku.py index 69a4758e155f..821f817256a4 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku.py @@ -18,10 +18,13 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar family: SKU family name. Default value: "A" . + All required parameters must be populated in order to send to Azure. + + :ivar family: Required. SKU family name. Default value: "A" . :vartype family: str - :param name: SKU name to specify whether the key vault is a standard vault - or a premium vault. Possible values include: 'standard', 'premium' + :param name: Required. SKU name to specify whether the key vault is a + standard vault or a premium vault. Possible values include: 'standard', + 'premium' :type name: str or ~azure.mgmt.keyvault.models.SkuName """ @@ -37,6 +40,6 @@ class Sku(Model): family = "A" - def __init__(self, name): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku_py3.py new file mode 100644 index 000000000000..f14fc4dafab0 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """SKU details. + + Variables are only 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 family: Required. SKU family name. Default value: "A" . + :vartype family: str + :param name: Required. SKU name to specify whether the key vault is a + standard vault or a premium vault. Possible values include: 'standard', + 'premium' + :type name: str or ~azure.mgmt.keyvault.models.SkuName + """ + + _validation = { + 'family': {'required': True, 'constant': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'family': {'key': 'family', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'SkuName'}, + } + + family = "A" + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault.py index c47e0d8b68e0..6ec3c66c53e1 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault.py @@ -18,18 +18,20 @@ class Vault(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: The Azure Resource Manager resource ID for the key vault. :vartype id: str :ivar name: The name of the key vault. :vartype name: str :ivar type: The resource type of the key vault. :vartype type: str - :param location: The supported Azure location where the key vault should - be created. + :param location: Required. The supported Azure location where the key + vault should be created. :type location: str :param tags: The tags that will be assigned to the key vault. :type tags: dict[str, str] - :param properties: Properties of the vault + :param properties: Required. Properties of the vault :type properties: ~azure.mgmt.keyvault.models.VaultProperties """ @@ -50,6 +52,6 @@ class Vault(Resource): 'properties': {'key': 'properties', 'type': 'VaultProperties'}, } - def __init__(self, location, properties, tags=None): - super(Vault, self).__init__(location=location, tags=tags) - self.properties = properties + def __init__(self, **kwargs): + super(Vault, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters.py index 65667c484b09..a2a6e5db234e 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters.py @@ -18,6 +18,8 @@ class VaultAccessPolicyParameters(Model): Variables are only 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 resource id of the access policy. :vartype id: str :ivar name: The resource name of the access policy. @@ -26,7 +28,7 @@ class VaultAccessPolicyParameters(Model): :vartype type: str :ivar location: The resource type of the the access policy. :vartype location: str - :param properties: Properties of the access policy + :param properties: Required. Properties of the access policy :type properties: ~azure.mgmt.keyvault.models.VaultAccessPolicyProperties """ @@ -46,10 +48,10 @@ class VaultAccessPolicyParameters(Model): 'properties': {'key': 'properties', 'type': 'VaultAccessPolicyProperties'}, } - def __init__(self, properties): - super(VaultAccessPolicyParameters, self).__init__() + def __init__(self, **kwargs): + super(VaultAccessPolicyParameters, self).__init__(**kwargs) self.id = None self.name = None self.type = None self.location = None - self.properties = properties + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters_py3.py new file mode 100644 index 000000000000..0b3bc1b438c7 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters_py3.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class VaultAccessPolicyParameters(Model): + """Parameters for updating the access policy in a vault. + + Variables are only 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 resource id of the access policy. + :vartype id: str + :ivar name: The resource name of the access policy. + :vartype name: str + :ivar type: The resource name of the access policy. + :vartype type: str + :ivar location: The resource type of the the access policy. + :vartype location: str + :param properties: Required. Properties of the access policy + :type properties: ~azure.mgmt.keyvault.models.VaultAccessPolicyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VaultAccessPolicyProperties'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(VaultAccessPolicyParameters, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties.py index 2c93c6b466aa..cf906d226126 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties.py @@ -15,9 +15,11 @@ class VaultAccessPolicyProperties(Model): """Properties of the vault access policy. - :param access_policies: An array of 0 to 16 identities that have access to - the key vault. All identities in the array must use the same tenant ID as - the key vault's tenant ID. + All required parameters must be populated in order to send to Azure. + + :param access_policies: Required. An array of 0 to 16 identities that have + access to the key vault. All identities in the array must use the same + tenant ID as the key vault's tenant ID. :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] """ @@ -29,6 +31,6 @@ class VaultAccessPolicyProperties(Model): 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, } - def __init__(self, access_policies): - super(VaultAccessPolicyProperties, self).__init__() - self.access_policies = access_policies + def __init__(self, **kwargs): + super(VaultAccessPolicyProperties, self).__init__(**kwargs) + self.access_policies = kwargs.get('access_policies', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties_py3.py new file mode 100644 index 000000000000..bacfa890f9f2 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class VaultAccessPolicyProperties(Model): + """Properties of the vault access policy. + + All required parameters must be populated in order to send to Azure. + + :param access_policies: Required. An array of 0 to 16 identities that have + access to the key vault. All identities in the array must use the same + tenant ID as the key vault's tenant ID. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + """ + + _validation = { + 'access_policies': {'required': True}, + } + + _attribute_map = { + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + } + + def __init__(self, *, access_policies, **kwargs) -> None: + super(VaultAccessPolicyProperties, self).__init__(**kwargs) + self.access_policies = access_policies diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters.py index ff2b7e738674..b49bc5dbb513 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters.py @@ -18,10 +18,12 @@ class VaultCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The vault name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The vault name. :type name: str - :ivar type: The type of resource, Microsoft.KeyVault/vaults. Default - value: "Microsoft.KeyVault/vaults" . + :ivar type: Required. The type of resource, Microsoft.KeyVault/vaults. + Default value: "Microsoft.KeyVault/vaults" . :vartype type: str """ @@ -37,6 +39,6 @@ class VaultCheckNameAvailabilityParameters(Model): type = "Microsoft.KeyVault/vaults" - def __init__(self, name): - super(VaultCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(VaultCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..74afce9a8c85 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class VaultCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the vault 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 vault name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.KeyVault/vaults. + Default value: "Microsoft.KeyVault/vaults" . + :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.KeyVault/vaults" + + def __init__(self, *, name: str, **kwargs) -> None: + super(VaultCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters.py index 8e5a87895bf7..17d358af45c4 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters.py @@ -15,12 +15,14 @@ class VaultCreateOrUpdateParameters(Model): """Parameters for creating or updating a vault. - :param location: The supported Azure location where the key vault should - be created. + All required parameters must be populated in order to send to Azure. + + :param location: Required. The supported Azure location where the key + vault should be created. :type location: str :param tags: The tags that will be assigned to the key vault. :type tags: dict[str, str] - :param properties: Properties of the vault + :param properties: Required. Properties of the vault :type properties: ~azure.mgmt.keyvault.models.VaultProperties """ @@ -35,8 +37,8 @@ class VaultCreateOrUpdateParameters(Model): 'properties': {'key': 'properties', 'type': 'VaultProperties'}, } - def __init__(self, location, properties, tags=None): - super(VaultCreateOrUpdateParameters, self).__init__() - self.location = location - self.tags = tags - self.properties = properties + def __init__(self, **kwargs): + super(VaultCreateOrUpdateParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..861fc58686cb --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class VaultCreateOrUpdateParameters(Model): + """Parameters for creating or updating a vault. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Required. Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultProperties + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultProperties'}, + } + + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: + super(VaultCreateOrUpdateParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters.py index ada3e9a9c58d..b38fcc1b32df 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters.py @@ -26,7 +26,7 @@ class VaultPatchParameters(Model): 'properties': {'key': 'properties', 'type': 'VaultPatchProperties'}, } - def __init__(self, tags=None, properties=None): - super(VaultPatchParameters, self).__init__() - self.tags = tags - self.properties = properties + def __init__(self, **kwargs): + super(VaultPatchParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters_py3.py new file mode 100644 index 000000000000..16bf148f7b8c --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class VaultPatchParameters(Model): + """Parameters for creating or updating a vault. + + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultPatchProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultPatchProperties'}, + } + + def __init__(self, *, tags=None, properties=None, **kwargs) -> None: + super(VaultPatchParameters, self).__init__(**kwargs) + self.tags = tags + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties.py index 22d3a0b8c88b..e1e4b1b5b89d 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties.py @@ -68,15 +68,15 @@ class VaultPatchProperties(Model): 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, tenant_id=None, sku=None, access_policies=None, enabled_for_deployment=None, enabled_for_disk_encryption=None, enabled_for_template_deployment=None, enable_soft_delete=None, create_mode=None, enable_purge_protection=None, network_acls=None): - super(VaultPatchProperties, self).__init__() - self.tenant_id = tenant_id - self.sku = sku - self.access_policies = access_policies - self.enabled_for_deployment = enabled_for_deployment - self.enabled_for_disk_encryption = enabled_for_disk_encryption - self.enabled_for_template_deployment = enabled_for_template_deployment - self.enable_soft_delete = enable_soft_delete - self.create_mode = create_mode - self.enable_purge_protection = enable_purge_protection - self.network_acls = network_acls + def __init__(self, **kwargs): + super(VaultPatchProperties, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.sku = kwargs.get('sku', None) + self.access_policies = kwargs.get('access_policies', None) + self.enabled_for_deployment = kwargs.get('enabled_for_deployment', None) + self.enabled_for_disk_encryption = kwargs.get('enabled_for_disk_encryption', None) + self.enabled_for_template_deployment = kwargs.get('enabled_for_template_deployment', None) + self.enable_soft_delete = kwargs.get('enable_soft_delete', None) + self.create_mode = kwargs.get('create_mode', None) + self.enable_purge_protection = kwargs.get('enable_purge_protection', None) + self.network_acls = kwargs.get('network_acls', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties_py3.py new file mode 100644 index 000000000000..c31e17f365cc --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties_py3.py @@ -0,0 +1,82 @@ +# 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 msrest.serialization import Model + + +class VaultPatchProperties(Model): + """Properties of the vault. + + :param tenant_id: The Azure Active Directory tenant ID that should be used + for authenticating requests to the key vault. + :type tenant_id: str + :param sku: SKU details + :type sku: ~azure.mgmt.keyvault.models.Sku + :param access_policies: An array of 0 to 16 identities that have access to + the key vault. All identities in the array must use the same tenant ID as + the key vault's tenant ID. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + :param enabled_for_deployment: Property to specify whether Azure Virtual + Machines are permitted to retrieve certificates stored as secrets from the + key vault. + :type enabled_for_deployment: bool + :param enabled_for_disk_encryption: Property to specify whether Azure Disk + Encryption is permitted to retrieve secrets from the vault and unwrap + keys. + :type enabled_for_disk_encryption: bool + :param enabled_for_template_deployment: Property to specify whether Azure + Resource Manager is permitted to retrieve secrets from the key vault. + :type enabled_for_template_deployment: bool + :param enable_soft_delete: Property to specify whether the 'soft delete' + functionality is enabled for this key vault. It does not accept false + value. + :type enable_soft_delete: bool + :param create_mode: The vault's create mode to indicate whether the vault + need to be recovered or not. Possible values include: 'recover', 'default' + :type create_mode: str or ~azure.mgmt.keyvault.models.CreateMode + :param enable_purge_protection: Property specifying whether protection + against purge is enabled for this vault. Setting this property to true + activates protection against purge for this vault and its content - only + the Key Vault service may initiate a hard, irrecoverable deletion. The + setting is effective only if soft delete is also enabled. Enabling this + functionality is irreversible - that is, the property does not accept + false as its value. + :type enable_purge_protection: bool + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. + :type network_acls: ~azure.mgmt.keyvault.models.NetworkRuleSet + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + 'enabled_for_deployment': {'key': 'enabledForDeployment', 'type': 'bool'}, + 'enabled_for_disk_encryption': {'key': 'enabledForDiskEncryption', 'type': 'bool'}, + 'enabled_for_template_deployment': {'key': 'enabledForTemplateDeployment', 'type': 'bool'}, + 'enable_soft_delete': {'key': 'enableSoftDelete', 'type': 'bool'}, + 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, + 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tenant_id: str=None, sku=None, access_policies=None, enabled_for_deployment: bool=None, enabled_for_disk_encryption: bool=None, enabled_for_template_deployment: bool=None, enable_soft_delete: bool=None, create_mode=None, enable_purge_protection: bool=None, network_acls=None, **kwargs) -> None: + super(VaultPatchProperties, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.sku = sku + self.access_policies = access_policies + self.enabled_for_deployment = enabled_for_deployment + self.enabled_for_disk_encryption = enabled_for_disk_encryption + self.enabled_for_template_deployment = enabled_for_template_deployment + self.enable_soft_delete = enable_soft_delete + self.create_mode = create_mode + self.enable_purge_protection = enable_purge_protection + self.network_acls = network_acls diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties.py index d903a7d93145..a09d68c304b0 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties.py @@ -15,10 +15,12 @@ class VaultProperties(Model): """Properties of the vault. - :param tenant_id: The Azure Active Directory tenant ID that should be used - for authenticating requests to the key vault. + All required parameters must be populated in order to send to Azure. + + :param tenant_id: Required. The Azure Active Directory tenant ID that + should be used for authenticating requests to the key vault. :type tenant_id: str - :param sku: SKU details + :param sku: Required. SKU details :type sku: ~azure.mgmt.keyvault.models.Sku :param access_policies: An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as @@ -77,16 +79,16 @@ class VaultProperties(Model): 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, tenant_id, sku, access_policies=None, vault_uri=None, enabled_for_deployment=None, enabled_for_disk_encryption=None, enabled_for_template_deployment=None, enable_soft_delete=None, create_mode=None, enable_purge_protection=None, network_acls=None): - super(VaultProperties, self).__init__() - self.tenant_id = tenant_id - self.sku = sku - self.access_policies = access_policies - self.vault_uri = vault_uri - self.enabled_for_deployment = enabled_for_deployment - self.enabled_for_disk_encryption = enabled_for_disk_encryption - self.enabled_for_template_deployment = enabled_for_template_deployment - self.enable_soft_delete = enable_soft_delete - self.create_mode = create_mode - self.enable_purge_protection = enable_purge_protection - self.network_acls = network_acls + def __init__(self, **kwargs): + super(VaultProperties, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.sku = kwargs.get('sku', None) + self.access_policies = kwargs.get('access_policies', None) + self.vault_uri = kwargs.get('vault_uri', None) + self.enabled_for_deployment = kwargs.get('enabled_for_deployment', None) + self.enabled_for_disk_encryption = kwargs.get('enabled_for_disk_encryption', None) + self.enabled_for_template_deployment = kwargs.get('enabled_for_template_deployment', None) + self.enable_soft_delete = kwargs.get('enable_soft_delete', None) + self.create_mode = kwargs.get('create_mode', None) + self.enable_purge_protection = kwargs.get('enable_purge_protection', None) + self.network_acls = kwargs.get('network_acls', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties_py3.py new file mode 100644 index 000000000000..e25654b6d375 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties_py3.py @@ -0,0 +1,94 @@ +# 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 msrest.serialization import Model + + +class VaultProperties(Model): + """Properties of the vault. + + All required parameters must be populated in order to send to Azure. + + :param tenant_id: Required. The Azure Active Directory tenant ID that + should be used for authenticating requests to the key vault. + :type tenant_id: str + :param sku: Required. SKU details + :type sku: ~azure.mgmt.keyvault.models.Sku + :param access_policies: An array of 0 to 16 identities that have access to + the key vault. All identities in the array must use the same tenant ID as + the key vault's tenant ID. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + :param vault_uri: The URI of the vault for performing operations on keys + and secrets. + :type vault_uri: str + :param enabled_for_deployment: Property to specify whether Azure Virtual + Machines are permitted to retrieve certificates stored as secrets from the + key vault. + :type enabled_for_deployment: bool + :param enabled_for_disk_encryption: Property to specify whether Azure Disk + Encryption is permitted to retrieve secrets from the vault and unwrap + keys. + :type enabled_for_disk_encryption: bool + :param enabled_for_template_deployment: Property to specify whether Azure + Resource Manager is permitted to retrieve secrets from the key vault. + :type enabled_for_template_deployment: bool + :param enable_soft_delete: Property to specify whether the 'soft delete' + functionality is enabled for this key vault. It does not accept false + value. + :type enable_soft_delete: bool + :param create_mode: The vault's create mode to indicate whether the vault + need to be recovered or not. Possible values include: 'recover', 'default' + :type create_mode: str or ~azure.mgmt.keyvault.models.CreateMode + :param enable_purge_protection: Property specifying whether protection + against purge is enabled for this vault. Setting this property to true + activates protection against purge for this vault and its content - only + the Key Vault service may initiate a hard, irrecoverable deletion. The + setting is effective only if soft delete is also enabled. Enabling this + functionality is irreversible - that is, the property does not accept + false as its value. + :type enable_purge_protection: bool + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. + :type network_acls: ~azure.mgmt.keyvault.models.NetworkRuleSet + """ + + _validation = { + 'tenant_id': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'enabled_for_deployment': {'key': 'enabledForDeployment', 'type': 'bool'}, + 'enabled_for_disk_encryption': {'key': 'enabledForDiskEncryption', 'type': 'bool'}, + 'enabled_for_template_deployment': {'key': 'enabledForTemplateDeployment', 'type': 'bool'}, + 'enable_soft_delete': {'key': 'enableSoftDelete', 'type': 'bool'}, + 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, + 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tenant_id: str, sku, access_policies=None, vault_uri: str=None, enabled_for_deployment: bool=None, enabled_for_disk_encryption: bool=None, enabled_for_template_deployment: bool=None, enable_soft_delete: bool=None, create_mode=None, enable_purge_protection: bool=None, network_acls=None, **kwargs) -> None: + super(VaultProperties, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.sku = sku + self.access_policies = access_policies + self.vault_uri = vault_uri + self.enabled_for_deployment = enabled_for_deployment + self.enabled_for_disk_encryption = enabled_for_disk_encryption + self.enabled_for_template_deployment = enabled_for_template_deployment + self.enable_soft_delete = enable_soft_delete + self.create_mode = create_mode + self.enable_purge_protection = enable_purge_protection + self.network_acls = network_acls diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_py3.py new file mode 100644 index 000000000000..bcbb18be36d5 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_py3.py @@ -0,0 +1,57 @@ +# 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 .resource import Resource + + +class Vault(Resource): + """Resource information with extended details. + + Variables are only 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 Azure Resource Manager resource ID for the key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Required. Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'properties': {'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}'}, + 'properties': {'key': 'properties', 'type': 'VaultProperties'}, + } + + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: + super(Vault, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule.py index f99d02ada8fd..638060696e8e 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule.py @@ -16,7 +16,9 @@ class VirtualNetworkRule(Model): """A rule governing the accesibility of a vault from a specific virtual network. - :param id: Full resource id of a vnet subnet, such as + All required parameters must be populated in order to send to Azure. + + :param id: Required. Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. :type id: str """ @@ -29,6 +31,6 @@ class VirtualNetworkRule(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id): - super(VirtualNetworkRule, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..19f2eec7d290 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """A rule governing the accesibility of a vault from a specific virtual + network. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Full resource id of a vnet subnet, such as + '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/operations/vaults_operations.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/operations/vaults_operations.py index e13133a7f284..22e2537ac076 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/operations/vaults_operations.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/operations/vaults_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -94,7 +94,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vault_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vault_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a key vault in the specified subscription. :param resource_group_name: The name of the Resource Group to which @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.keyvault.models.VaultCreateOrUpdateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Vault or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Vault or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.keyvault.models.Vault] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.keyvault.models.Vault]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Vault', response) if raw: @@ -155,12 +136,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'} def update( @@ -764,7 +746,7 @@ def _purge_deleted_initial( return client_raw_response def purge_deleted( - self, vault_name, location, custom_headers=None, raw=False, **operation_config): + self, vault_name, location, custom_headers=None, raw=False, polling=True, **operation_config): """Permanently deletes the specified vault. aka Purges the deleted Azure key vault. @@ -773,12 +755,14 @@ def purge_deleted( :param location: The location of the soft-deleted vault. :type location: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._purge_deleted_initial( @@ -788,40 +772,19 @@ def purge_deleted( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) purge_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge'} def list( diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/version.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/version.py index 7cc8dceb7a1e..affaef0c987e 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/version.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0a2" +VERSION = "1.0.0b1"