diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/__init__.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/__init__.py new file mode 100644 index 000000000000..1ef36714e76e --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import CPIMConfigurationClientConfiguration +from ._cpim_configuration_client import CPIMConfigurationClient +__all__ = ['CPIMConfigurationClient', 'CPIMConfigurationClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/_configuration.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/_configuration.py new file mode 100644 index 000000000000..164d56c60db7 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/_configuration.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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class CPIMConfigurationClientConfiguration(AzureConfiguration): + """Configuration for CPIMConfigurationClient + 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(CPIMConfigurationClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-azureadb2c/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/_cpim_configuration_client.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/_cpim_configuration_client.py new file mode 100644 index 000000000000..813fbdf18b13 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/_cpim_configuration_client.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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import CPIMConfigurationClientConfiguration +from .operations import B2CTenantsOperations +from .operations import Operations +from . import models + + +class CPIMConfigurationClient(SDKClient): + """CPIM Configuration Client + + :ivar config: Configuration for client. + :vartype config: CPIMConfigurationClientConfiguration + + :ivar b2_ctenants: B2CTenants operations + :vartype b2_ctenants: azure.mgmt.azureadb2c.v2019_01_01_preview.operations.B2CTenantsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.azureadb2c.v2019_01_01_preview.operations.Operations + + :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 = CPIMConfigurationClientConfiguration(credentials, subscription_id, base_url) + super(CPIMConfigurationClient, 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 = '2019-01-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.b2_ctenants = B2CTenantsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/__init__.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/__init__.py new file mode 100644 index 000000000000..faad0621e415 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/__init__.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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AsyncOperationStatus + from ._models_py3 import AsyncOperationStatusError + from ._models_py3 import B2CResourceSKU + from ._models_py3 import B2CTenantResource + from ._models_py3 import B2CTenantResourcePropertiesBillingConfig + from ._models_py3 import B2CTenantUpdateRequest + from ._models_py3 import CheckNameAvailabilityRequestBody + from ._models_py3 import CreateTenantRequestBody + from ._models_py3 import CreateTenantRequestBodyProperties + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse + from ._models_py3 import NameAvailabilityResponse + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay +except (SyntaxError, ImportError): + from ._models import AsyncOperationStatus + from ._models import AsyncOperationStatusError + from ._models import B2CResourceSKU + from ._models import B2CTenantResource + from ._models import B2CTenantResourcePropertiesBillingConfig + from ._models import B2CTenantUpdateRequest + from ._models import CheckNameAvailabilityRequestBody + from ._models import CreateTenantRequestBody + from ._models import CreateTenantRequestBodyProperties + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse + from ._models import NameAvailabilityResponse + from ._models import Operation + from ._models import OperationDisplay +from ._paged_models import B2CTenantResourcePaged +from ._paged_models import OperationPaged +from ._cpim_configuration_client_enums import ( + StatusType, + BillingType, + B2CResourceSKUName, + B2CResourceSKUTier, + NameAvailabilityReasonType, + TypeValue, +) + +__all__ = [ + 'AsyncOperationStatus', + 'AsyncOperationStatusError', + 'B2CResourceSKU', + 'B2CTenantResource', + 'B2CTenantResourcePropertiesBillingConfig', + 'B2CTenantUpdateRequest', + 'CheckNameAvailabilityRequestBody', + 'CreateTenantRequestBody', + 'CreateTenantRequestBodyProperties', + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'NameAvailabilityResponse', + 'Operation', + 'OperationDisplay', + 'B2CTenantResourcePaged', + 'OperationPaged', + 'StatusType', + 'BillingType', + 'B2CResourceSKUName', + 'B2CResourceSKUTier', + 'NameAvailabilityReasonType', + 'TypeValue', +] diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_cpim_configuration_client_enums.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_cpim_configuration_client_enums.py new file mode 100644 index 000000000000..44f33e8c54bb --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_cpim_configuration_client_enums.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 enum import Enum + + +class StatusType(str, Enum): + + succeeded = "Succeeded" #: The operation succeeded. + pending = "Pending" #: The operation is pending. + failed = "Failed" #: The operation failed. + + +class BillingType(str, Enum): + + mau = "MAU" #: Azure AD B2C usage is billed to a linked Azure subscription and uses a monthly active users (MAU) billing model. + auths = "Auths" #: Azure AD B2C usage is billed to a linked Azure subscription and uses number of authentications based billing. + + +class B2CResourceSKUName(str, Enum): + + standard = "Standard" #: Azure AD B2C usage is billed to a linked Azure subscription and uses a monthly active users (MAU) billing model. + premium_p1 = "PremiumP1" #: Azure AD B2C usage is billed to a linked Azure subscription and uses number of authentications based billing. + premium_p2 = "PremiumP2" #: Azure AD B2C usage is billed to a linked Azure subscription and uses number of authentications based billing. + + +class B2CResourceSKUTier(str, Enum): + + a0 = "A0" #: The SKU tier used for all Azure AD B2C tenants. + + +class NameAvailabilityReasonType(str, Enum): + + already_exists = "AlreadyExists" #: The name is already in use and is therefore unavailable. + invalid = "Invalid" #: The name provided does not match the resource provider’s naming requirements (incorrect length, unsupported characters, etc.). + + +class TypeValue(str, Enum): + + microsoft_azure_active_directoryb2c_directories = "Microsoft.AzureActiveDirectory/b2cDirectories" #: The resource type for Azure AD B2C tenant resource. diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_models.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_models.py new file mode 100644 index 000000000000..1f6744664c9c --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_models.py @@ -0,0 +1,526 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by 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 AsyncOperationStatus(Model): + """The async operation status. + + :param subscription_id: Subscription ID that the resource belongs to. + :type subscription_id: str + :param id: The GET resource path for the operation. + :type id: str + :param name: The operation ID. + :type name: str + :param status: The status of the operation. Possible values include: + 'Succeeded', 'Pending', 'Failed' + :type status: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.StatusType + :param start_time: Start time of the async operation. + :type start_time: str + :param end_time: End time of the async operation. + :type end_time: str + :param billing_config: The billing configuration for the tenant. + :type billing_config: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResourcePropertiesBillingConfig + :param tenant_id: An identifier of the B2C tenant. + :type tenant_id: str + :param error: Error response if async operation failed. + :type error: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.AsyncOperationStatusError + """ + + _attribute_map = { + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'StatusType'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'billing_config': {'key': 'properties.billingConfig', 'type': 'B2CTenantResourcePropertiesBillingConfig'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'AsyncOperationStatusError'}, + } + + def __init__(self, **kwargs): + super(AsyncOperationStatus, self).__init__(**kwargs) + self.subscription_id = kwargs.get('subscription_id', None) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.billing_config = kwargs.get('billing_config', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.error = kwargs.get('error', None) + + +class AsyncOperationStatusError(Model): + """Error response if async operation failed. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AsyncOperationStatusError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class B2CResourceSKU(Model): + """SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C + billing at [aka.ms/b2cBilling](https://aka.ms/b2cBilling). + + :param name: The name of the SKU for the tenant. Possible values include: + 'Standard', 'PremiumP1', 'PremiumP2' + :type name: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKUName + :param tier: The tier of the tenant. Possible values include: 'A0' + :type tier: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKUTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'B2CResourceSKUName'}, + 'tier': {'key': 'tier', 'type': 'B2CResourceSKUTier'}, + } + + def __init__(self, **kwargs): + super(B2CResourceSKU, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class B2CTenantResource(Model): + """B2CTenantResource. + + Variables are only 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: The type of the B2C tenant resource. Possible values include: + 'Microsoft.AzureActiveDirectory/b2cDirectories' + :vartype type: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.TypeValue + :param sku: Required. + :type sku: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKU + :param billing_config: The billing configuration for the tenant. + :type billing_config: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResourcePropertiesBillingConfig + :param tenant_id: An identifier of the B2C tenant. + :type tenant_id: str + :ivar id: An identifier that represents the B2C tenant resource. + :vartype id: str + :ivar name: The name of the B2C tenant resource. + :vartype name: str + :param location: Required. The location in which the resource is hosted + and data resides. Refer to [this + documentation](https://aka.ms/B2CDataResidency) to see valid data + residency locations. Please choose one of 'United States', 'Europe', and + 'Asia Pacific'. + :type location: str + :param tags: Resource Tags + :type tags: dict[str, str] + """ + + _validation = { + 'type': {'readonly': True}, + 'sku': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'TypeValue'}, + 'sku': {'key': 'sku', 'type': 'B2CResourceSKU'}, + 'billing_config': {'key': 'properties.billingConfig', 'type': 'B2CTenantResourcePropertiesBillingConfig'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(B2CTenantResource, self).__init__(**kwargs) + self.type = None + self.sku = kwargs.get('sku', None) + self.billing_config = kwargs.get('billing_config', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.id = None + self.name = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class B2CTenantResourcePropertiesBillingConfig(Model): + """The billing configuration for the tenant. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param billing_type: The type of billing. Will be MAU for all new + customers. If 'Auths', it can be updated to 'MAU'. Cannot be changed if + value is 'MAU'. Learn more about Azure AD B2C billing at + [aka.ms/b2cBilling](https://aka.ms/b2cbilling). Possible values include: + 'MAU', 'Auths' + :type billing_type: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.BillingType + :ivar effective_start_date_utc: The data from which the billing type took + effect + :vartype effective_start_date_utc: str + """ + + _validation = { + 'effective_start_date_utc': {'readonly': True}, + } + + _attribute_map = { + 'billing_type': {'key': 'billingType', 'type': 'BillingType'}, + 'effective_start_date_utc': {'key': 'effectiveStartDateUtc', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(B2CTenantResourcePropertiesBillingConfig, self).__init__(**kwargs) + self.billing_type = kwargs.get('billing_type', None) + self.effective_start_date_utc = None + + +class B2CTenantUpdateRequest(Model): + """The request body to update the Azure AD B2C tenant resource. + + :param sku: + :type sku: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKU + :param billing_config: The billing configuration for the tenant. + :type billing_config: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResourcePropertiesBillingConfig + :param tenant_id: An identifier of the B2C tenant. + :type tenant_id: str + :param tags: Resource Tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'B2CResourceSKU'}, + 'billing_config': {'key': 'properties.billingConfig', 'type': 'B2CTenantResourcePropertiesBillingConfig'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(B2CTenantUpdateRequest, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.billing_config = kwargs.get('billing_config', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.tags = kwargs.get('tags', None) + + +class CheckNameAvailabilityRequestBody(Model): + """The information required to check the availability of the name for the + tenant. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The domain name to check for availability. + :type name: str + :param country_code: Required. + :type country_code: str + """ + + _validation = { + 'name': {'required': True}, + 'country_code': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityRequestBody, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.country_code = kwargs.get('country_code', None) + + +class CloudError(Model): + """An error response for a resource management request. + + :param error: + :type error: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CreateTenantRequestBody(Model): + """The information needed to create the Azure AD B2C tenant and corresponding + Azure resource, which is used for billing purposes. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location in which the resource is hosted + and data resides. Refer to [this + documentation](https://aka.ms/B2CDataResidency) to see valid data + residency locations. Please choose one of 'United States', 'Europe', and + 'Asia Pacific'. + :type location: str + :param properties: Required. + :type properties: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.CreateTenantRequestBodyProperties + :param sku: Required. + :type sku: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKU + :param tags: Resource Tags + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CreateTenantRequestBodyProperties'}, + 'sku': {'key': 'sku', 'type': 'B2CResourceSKU'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CreateTenantRequestBody, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + + +class CreateTenantRequestBodyProperties(Model): + """CreateTenantRequestBodyProperties. + + :param display_name: The display name of the B2C tenant. + :type display_name: str + :param country_code: + :type country_code: str + """ + + _attribute_map = { + 'display_name': {'key': 'createTenantProperties.displayName', 'type': 'str'}, + 'country_code': {'key': 'createTenantProperties.countryCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CreateTenantRequestBodyProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.country_code = kwargs.get('country_code', None) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + 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 target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.azureadb2c.v2019_01_01_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.azureadb2c.v2019_01_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class NameAvailabilityResponse(Model): + """Response of the CheckNameAvailability operation. + + :param message: Description of the reason if name is not available. + :type message: str + :param name_available: True if the name is available and can be used to + create a new tenant. Otherwise false. + :type name_available: bool + :param reason: Possible values include: 'AlreadyExists', 'Invalid' + :type reason: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.NameAvailabilityReasonType + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'NameAvailabilityReasonType'}, + } + + def __init__(self, **kwargs): + super(NameAvailabilityResponse, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + + +class Operation(Model): + """Microsoft.AzureActiveDirectory REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.AzureActiveDirectory. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: GuestUsages, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + :param description: Friendly name of the operation + :type description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = kwargs.get('description', None) diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_models_py3.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..29ca0d00c82c --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_models_py3.py @@ -0,0 +1,526 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by 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 AsyncOperationStatus(Model): + """The async operation status. + + :param subscription_id: Subscription ID that the resource belongs to. + :type subscription_id: str + :param id: The GET resource path for the operation. + :type id: str + :param name: The operation ID. + :type name: str + :param status: The status of the operation. Possible values include: + 'Succeeded', 'Pending', 'Failed' + :type status: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.StatusType + :param start_time: Start time of the async operation. + :type start_time: str + :param end_time: End time of the async operation. + :type end_time: str + :param billing_config: The billing configuration for the tenant. + :type billing_config: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResourcePropertiesBillingConfig + :param tenant_id: An identifier of the B2C tenant. + :type tenant_id: str + :param error: Error response if async operation failed. + :type error: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.AsyncOperationStatusError + """ + + _attribute_map = { + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'StatusType'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'billing_config': {'key': 'properties.billingConfig', 'type': 'B2CTenantResourcePropertiesBillingConfig'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'AsyncOperationStatusError'}, + } + + def __init__(self, *, subscription_id: str=None, id: str=None, name: str=None, status=None, start_time: str=None, end_time: str=None, billing_config=None, tenant_id: str=None, error=None, **kwargs) -> None: + super(AsyncOperationStatus, self).__init__(**kwargs) + self.subscription_id = subscription_id + self.id = id + self.name = name + self.status = status + self.start_time = start_time + self.end_time = end_time + self.billing_config = billing_config + self.tenant_id = tenant_id + self.error = error + + +class AsyncOperationStatusError(Model): + """Error response if async operation failed. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(AsyncOperationStatusError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class B2CResourceSKU(Model): + """SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C + billing at [aka.ms/b2cBilling](https://aka.ms/b2cBilling). + + :param name: The name of the SKU for the tenant. Possible values include: + 'Standard', 'PremiumP1', 'PremiumP2' + :type name: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKUName + :param tier: The tier of the tenant. Possible values include: 'A0' + :type tier: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKUTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'B2CResourceSKUName'}, + 'tier': {'key': 'tier', 'type': 'B2CResourceSKUTier'}, + } + + def __init__(self, *, name=None, tier=None, **kwargs) -> None: + super(B2CResourceSKU, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class B2CTenantResource(Model): + """B2CTenantResource. + + Variables are only 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: The type of the B2C tenant resource. Possible values include: + 'Microsoft.AzureActiveDirectory/b2cDirectories' + :vartype type: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.TypeValue + :param sku: Required. + :type sku: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKU + :param billing_config: The billing configuration for the tenant. + :type billing_config: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResourcePropertiesBillingConfig + :param tenant_id: An identifier of the B2C tenant. + :type tenant_id: str + :ivar id: An identifier that represents the B2C tenant resource. + :vartype id: str + :ivar name: The name of the B2C tenant resource. + :vartype name: str + :param location: Required. The location in which the resource is hosted + and data resides. Refer to [this + documentation](https://aka.ms/B2CDataResidency) to see valid data + residency locations. Please choose one of 'United States', 'Europe', and + 'Asia Pacific'. + :type location: str + :param tags: Resource Tags + :type tags: dict[str, str] + """ + + _validation = { + 'type': {'readonly': True}, + 'sku': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'TypeValue'}, + 'sku': {'key': 'sku', 'type': 'B2CResourceSKU'}, + 'billing_config': {'key': 'properties.billingConfig', 'type': 'B2CTenantResourcePropertiesBillingConfig'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku, location: str, billing_config=None, tenant_id: str=None, tags=None, **kwargs) -> None: + super(B2CTenantResource, self).__init__(**kwargs) + self.type = None + self.sku = sku + self.billing_config = billing_config + self.tenant_id = tenant_id + self.id = None + self.name = None + self.location = location + self.tags = tags + + +class B2CTenantResourcePropertiesBillingConfig(Model): + """The billing configuration for the tenant. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param billing_type: The type of billing. Will be MAU for all new + customers. If 'Auths', it can be updated to 'MAU'. Cannot be changed if + value is 'MAU'. Learn more about Azure AD B2C billing at + [aka.ms/b2cBilling](https://aka.ms/b2cbilling). Possible values include: + 'MAU', 'Auths' + :type billing_type: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.BillingType + :ivar effective_start_date_utc: The data from which the billing type took + effect + :vartype effective_start_date_utc: str + """ + + _validation = { + 'effective_start_date_utc': {'readonly': True}, + } + + _attribute_map = { + 'billing_type': {'key': 'billingType', 'type': 'BillingType'}, + 'effective_start_date_utc': {'key': 'effectiveStartDateUtc', 'type': 'str'}, + } + + def __init__(self, *, billing_type=None, **kwargs) -> None: + super(B2CTenantResourcePropertiesBillingConfig, self).__init__(**kwargs) + self.billing_type = billing_type + self.effective_start_date_utc = None + + +class B2CTenantUpdateRequest(Model): + """The request body to update the Azure AD B2C tenant resource. + + :param sku: + :type sku: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKU + :param billing_config: The billing configuration for the tenant. + :type billing_config: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResourcePropertiesBillingConfig + :param tenant_id: An identifier of the B2C tenant. + :type tenant_id: str + :param tags: Resource Tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'B2CResourceSKU'}, + 'billing_config': {'key': 'properties.billingConfig', 'type': 'B2CTenantResourcePropertiesBillingConfig'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku=None, billing_config=None, tenant_id: str=None, tags=None, **kwargs) -> None: + super(B2CTenantUpdateRequest, self).__init__(**kwargs) + self.sku = sku + self.billing_config = billing_config + self.tenant_id = tenant_id + self.tags = tags + + +class CheckNameAvailabilityRequestBody(Model): + """The information required to check the availability of the name for the + tenant. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The domain name to check for availability. + :type name: str + :param country_code: Required. + :type country_code: str + """ + + _validation = { + 'name': {'required': True}, + 'country_code': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + } + + def __init__(self, *, name: str, country_code: str, **kwargs) -> None: + super(CheckNameAvailabilityRequestBody, self).__init__(**kwargs) + self.name = name + self.country_code = country_code + + +class CloudError(Model): + """An error response for a resource management request. + + :param error: + :type error: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CreateTenantRequestBody(Model): + """The information needed to create the Azure AD B2C tenant and corresponding + Azure resource, which is used for billing purposes. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location in which the resource is hosted + and data resides. Refer to [this + documentation](https://aka.ms/B2CDataResidency) to see valid data + residency locations. Please choose one of 'United States', 'Europe', and + 'Asia Pacific'. + :type location: str + :param properties: Required. + :type properties: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.CreateTenantRequestBodyProperties + :param sku: Required. + :type sku: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CResourceSKU + :param tags: Resource Tags + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CreateTenantRequestBodyProperties'}, + 'sku': {'key': 'sku', 'type': 'B2CResourceSKU'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, properties, sku, tags=None, **kwargs) -> None: + super(CreateTenantRequestBody, self).__init__(**kwargs) + self.location = location + self.properties = properties + self.sku = sku + self.tags = tags + + +class CreateTenantRequestBodyProperties(Model): + """CreateTenantRequestBodyProperties. + + :param display_name: The display name of the B2C tenant. + :type display_name: str + :param country_code: + :type country_code: str + """ + + _attribute_map = { + 'display_name': {'key': 'createTenantProperties.displayName', 'type': 'str'}, + 'country_code': {'key': 'createTenantProperties.countryCode', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, country_code: str=None, **kwargs) -> None: + super(CreateTenantRequestBodyProperties, self).__init__(**kwargs) + self.display_name = display_name + self.country_code = country_code + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + 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 target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.azureadb2c.v2019_01_01_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.azureadb2c.v2019_01_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class NameAvailabilityResponse(Model): + """Response of the CheckNameAvailability operation. + + :param message: Description of the reason if name is not available. + :type message: str + :param name_available: True if the name is available and can be used to + create a new tenant. Otherwise false. + :type name_available: bool + :param reason: Possible values include: 'AlreadyExists', 'Invalid' + :type reason: str or + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.NameAvailabilityReasonType + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'NameAvailabilityReasonType'}, + } + + def __init__(self, *, message: str=None, name_available: bool=None, reason=None, **kwargs) -> None: + super(NameAvailabilityResponse, self).__init__(**kwargs) + self.message = message + self.name_available = name_available + self.reason = reason + + +class Operation(Model): + """Microsoft.AzureActiveDirectory REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.AzureActiveDirectory. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: GuestUsages, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + :param description: Friendly name of the operation + :type description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = description diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_paged_models.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..623d4b37d5cc --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/models/_paged_models.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.paging import Paged + + +class B2CTenantResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`B2CTenantResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[B2CTenantResource]'} + } + + def __init__(self, *args, **kwargs): + + super(B2CTenantResourcePaged, self).__init__(*args, **kwargs) +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/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/operations/__init__.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/operations/__init__.py new file mode 100644 index 000000000000..0c55da7514df --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/operations/__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 ._b2_ctenants_operations import B2CTenantsOperations +from ._operations import Operations + +__all__ = [ + 'B2CTenantsOperations', + 'Operations', +] diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/operations/_b2_ctenants_operations.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/operations/_b2_ctenants_operations.py new file mode 100644 index 000000000000..0ac5536d72d7 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/operations/_b2_ctenants_operations.py @@ -0,0 +1,594 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 B2CTenantsOperations(object): + """B2CTenantsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + + self.config = config + + def check_name_availability( + self, name, country_code, custom_headers=None, raw=False, **operation_config): + """Checks the availability and validity of a domain name for the tenant. + + :param name: The domain name to check for availability. + :type name: str + :param country_code: + :type country_code: 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: NameAvailabilityResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.NameAvailabilityResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + check_name_availability_request_body = None + if name is not None or country_code is not None: + check_name_availability_request_body = models.CheckNameAvailabilityRequestBody(name=name, country_code=country_code) + + # 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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if 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 check_name_availability_request_body is not None: + body_content = self._serialize.body(check_name_availability_request_body, 'CheckNameAvailabilityRequestBody') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('NameAvailabilityResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureActiveDirectory/checkNameAvailability'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all the Azure AD B2C tenant resources in 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 B2CTenantResource + :rtype: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResourcePaged[~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.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') + } + 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['Accept'] = 'application/json' + if 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.B2CTenantResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/b2cDirectories'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Get all the Azure AD B2C tenant resources in a 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 B2CTenantResource + :rtype: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResourcePaged[~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.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['Accept'] = 'application/json' + if 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.B2CTenantResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureActiveDirectory/b2cDirectories'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the Azure AD B2C tenant resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The initial domain name of the B2C tenant. + :type resource_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: B2CTenantResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'resourceName': self._serialize.url("resource_name", resource_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['Accept'] = 'application/json' + if 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, header_parameters) + response = self._client.send(request, 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('B2CTenantResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/b2cDirectories/{resourceName}'} + + def update( + self, resource_group_name, resource_name, update_tenant_request_body=None, custom_headers=None, raw=False, **operation_config): + """Update the Azure AD B2C tenant resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The initial domain name of the B2C tenant. + :type resource_name: str + :param update_tenant_request_body: + :type update_tenant_request_body: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantUpdateRequest + :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: B2CTenantResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.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'), + 'resourceName': self._serialize.url("resource_name", resource_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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if 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 update_tenant_request_body is not None: + body_content = self._serialize.body(update_tenant_request_body, 'B2CTenantUpdateRequest') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('B2CTenantResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/b2cDirectories/{resourceName}'} + + + def _create_initial( + self, resource_group_name, resource_name, create_tenant_request_body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.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'), + 'resourceName': self._serialize.url("resource_name", resource_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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if 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 create_tenant_request_body is not None: + body_content = self._serialize.body(create_tenant_request_body, 'CreateTenantRequestBody') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('B2CTenantResource', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('B2CTenantResource', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, resource_name, create_tenant_request_body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Initiates an async request to create both the Azure AD B2C tenant and + the corresponding Azure resource linked to a subscription. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The initial domain name of the B2C tenant. + :type resource_name: str + :param create_tenant_request_body: + :type create_tenant_request_body: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.CreateTenantRequestBody + :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 B2CTenantResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azureadb2c.v2019_01_01_preview.models.B2CTenantResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + create_tenant_request_body=create_tenant_request_body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('B2CTenantResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/b2cDirectories/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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'), + 'resourceName': self._serialize.url("resource_name", resource_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 = {} + if 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Initiates an async operation to delete the Azure AD B2C tenant and + Azure resource. The resource deletion can only happen as the last step + in [the tenant deletion process](https://aka.ms/deleteB2Ctenant). . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The initial domain name of the B2C tenant. + :type resource_name: 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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Location': 'str', + 'Retry-After': 'str', + }) + return client_raw_response + + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/b2cDirectories/{resourceName}'} diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/operations/_operations.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/operations/_operations.py new file mode 100644 index 000000000000..802a72cba9dc --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/operations/_operations.py @@ -0,0 +1,161 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the operations available from this 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.azureadb2c.v2019_01_01_preview.models.OperationPaged[~azure.mgmt.azureadb2c.v2019_01_01_preview.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + if 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.AzureActiveDirectory/operations'} + + def get_async_status( + self, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the status of the async operation. + + :param operation_id: The operation ID. + :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: AsyncOperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.azureadb2c.v2019_01_01_preview.models.AsyncOperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_async_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') + } + 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['Accept'] = 'application/json' + if 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, header_parameters) + response = self._client.send(request, 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('AsyncOperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_async_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureActiveDirectory/operations/{operationId}'} diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/version.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/version.py new file mode 100644 index 000000000000..e253a7fc624a --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2019_01_01_preview/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 = "2019-01-01-preview" + diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/__init__.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/__init__.py new file mode 100644 index 000000000000..1ef36714e76e --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import CPIMConfigurationClientConfiguration +from ._cpim_configuration_client import CPIMConfigurationClient +__all__ = ['CPIMConfigurationClient', 'CPIMConfigurationClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/_configuration.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/_configuration.py new file mode 100644 index 000000000000..5273d88242fd --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/_configuration.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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class CPIMConfigurationClientConfiguration(AzureConfiguration): + """Configuration for CPIMConfigurationClient + 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: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + 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(CPIMConfigurationClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-azureadb2c/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/_cpim_configuration_client.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/_cpim_configuration_client.py new file mode 100644 index 000000000000..6647f0b022c5 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/_cpim_configuration_client.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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import CPIMConfigurationClientConfiguration +from .operations import Operations +from .operations import GuestUsagesOperations +from . import models + + +class CPIMConfigurationClient(SDKClient): + """CPIM Configuration Client + + :ivar config: Configuration for client. + :vartype config: CPIMConfigurationClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.azureadb2c.v2020_05_01_preview.operations.Operations + :ivar guest_usages: GuestUsages operations + :vartype guest_usages: azure.mgmt.azureadb2c.v2020_05_01_preview.operations.GuestUsagesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = CPIMConfigurationClientConfiguration(credentials, subscription_id, base_url) + super(CPIMConfigurationClient, 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 = '2020-05-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.guest_usages = GuestUsagesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/__init__.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/__init__.py new file mode 100644 index 000000000000..7fa0d249d711 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/__init__.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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse + from ._models_py3 import GuestUsagesResource + from ._models_py3 import GuestUsagesResourcePatch + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay +except (SyntaxError, ImportError): + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse + from ._models import GuestUsagesResource + from ._models import GuestUsagesResourcePatch + from ._models import Operation + from ._models import OperationDisplay +from ._paged_models import GuestUsagesResourcePaged +from ._paged_models import OperationPaged + +__all__ = [ + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'GuestUsagesResource', + 'GuestUsagesResourcePatch', + 'Operation', + 'OperationDisplay', + 'OperationPaged', + 'GuestUsagesResourcePaged', +] diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/_models.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/_models.py new file mode 100644 index 000000000000..bc3d20a4e038 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/_models.py @@ -0,0 +1,249 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """An error response for a resource management request. + + :param error: + :type error: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + 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 target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.azureadb2c.v2020_05_01_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.azureadb2c.v2020_05_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class GuestUsagesResource(Model): + """Guest Usages Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: An identifier that represents the Guest Usages resource. + :vartype id: str + :ivar name: The name of the Guest Usages resource. + :vartype name: str + :ivar type: The type of the Guest Usages resource. + :vartype type: str + :param location: Location of the Guest Usages resource. + :type location: str + :param tags: Key-value pairs of additional resource provisioning + properties. + :type tags: dict[str, str] + :param tenant_id: An identifier for the tenant for which the resource is + being created + :type tenant_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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GuestUsagesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.tenant_id = kwargs.get('tenant_id', None) + + +class GuestUsagesResourcePatch(Model): + """Guest Usages Resource for Patch. + + :param tags: Key-value pairs of additional resource provisioning + properties. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(GuestUsagesResourcePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class Operation(Model): + """Microsoft.AzureActiveDirectory REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.AzureActiveDirectory. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: GuestUsages, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + :param description: Friendly name of the operation + :type description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = kwargs.get('description', None) diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/_models_py3.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..6536d54ddd1a --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/_models_py3.py @@ -0,0 +1,249 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """An error response for a resource management request. + + :param error: + :type error: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + 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 target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.azureadb2c.v2020_05_01_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.azureadb2c.v2020_05_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class GuestUsagesResource(Model): + """Guest Usages Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: An identifier that represents the Guest Usages resource. + :vartype id: str + :ivar name: The name of the Guest Usages resource. + :vartype name: str + :ivar type: The type of the Guest Usages resource. + :vartype type: str + :param location: Location of the Guest Usages resource. + :type location: str + :param tags: Key-value pairs of additional resource provisioning + properties. + :type tags: dict[str, str] + :param tenant_id: An identifier for the tenant for which the resource is + being created + :type tenant_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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, tenant_id: str=None, **kwargs) -> None: + super(GuestUsagesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.tenant_id = tenant_id + + +class GuestUsagesResourcePatch(Model): + """Guest Usages Resource for Patch. + + :param tags: Key-value pairs of additional resource provisioning + properties. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(GuestUsagesResourcePatch, self).__init__(**kwargs) + self.tags = tags + + +class Operation(Model): + """Microsoft.AzureActiveDirectory REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.AzureActiveDirectory. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: GuestUsages, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + :param description: Friendly name of the operation + :type description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = description diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/_paged_models.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..abe9ad04a4a7 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/models/_paged_models.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.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) +class GuestUsagesResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`GuestUsagesResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GuestUsagesResource]'} + } + + def __init__(self, *args, **kwargs): + + super(GuestUsagesResourcePaged, self).__init__(*args, **kwargs) diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/operations/__init__.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/operations/__init__.py new file mode 100644 index 000000000000..9d005191aace --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/operations/__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 ._operations import Operations +from ._guest_usages_operations import GuestUsagesOperations + +__all__ = [ + 'Operations', + 'GuestUsagesOperations', +] diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/operations/_guest_usages_operations.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/operations/_guest_usages_operations.py new file mode 100644 index 000000000000..9e1587f4afe7 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/operations/_guest_usages_operations.py @@ -0,0 +1,456 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 GuestUsagesOperations(object): + """GuestUsagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: The API version to be used with the HTTP request. Constant value: "2020-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-01-preview" + + self.config = config + + def create( + self, resource_group_name, resource_name, resource=None, custom_headers=None, raw=False, **operation_config): + """Creates a Guest Usages resource. + + Creates a Guest Usages resource for the Microsoft.AzureActiveDirectory + resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The initial domain name of the AAD tenant. + :type resource_name: str + :param resource: Guest Usages resource to be created + :type resource: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.GuestUsagesResource + :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: GuestUsagesResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.GuestUsagesResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.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'), + 'resourceName': self._serialize.url("resource_name", resource_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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if 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 resource is not None: + body_content = self._serialize.body(resource, 'GuestUsagesResource') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('GuestUsagesResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/guestUsages/{resourceName}'} + + def update( + self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates a Guest Usages resource. + + Updates a Guest Usages resource for the Microsoft.AzureActiveDirectory + resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The initial domain name of the AAD tenant. + :type resource_name: str + :param tags: Key-value pairs of additional resource provisioning + properties. + :type tags: dict[str, 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: GuestUsagesResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.GuestUsagesResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + resource_patch = None + if tags is not None: + resource_patch = models.GuestUsagesResourcePatch(tags=tags) + + # Construct URL + url = self.update.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'), + 'resourceName': self._serialize.url("resource_name", resource_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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if 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 resource_patch is not None: + body_content = self._serialize.body(resource_patch, 'GuestUsagesResourcePatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('GuestUsagesResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/guestUsages/{resourceName}'} + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Deletes a Guest Usages resource. + + Deletes a Guest Usages resource for the Microsoft.AzureActiveDirectory + resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The initial domain name of the AAD tenant. + :type resource_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 = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_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 = {} + if 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, header_parameters) + response = self._client.send(request, 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/guestUsages/{resourceName}'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a Guest Usages resource. + + Gets a Guest Usages resource for the Microsoft.AzureActiveDirectory + resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The initial domain name of the AAD tenant. + :type resource_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: GuestUsagesResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.GuestUsagesResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'resourceName': self._serialize.url("resource_name", resource_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['Accept'] = 'application/json' + if 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, header_parameters) + response = self._client.send(request, 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('GuestUsagesResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/guestUsages/{resourceName}'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Gets Guest Usages resources under a subscription. + + Gets Guest Usages resources under a subscription for the + Microsoft.AzureActiveDirectory resource 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 GuestUsagesResource + :rtype: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.GuestUsagesResourcePaged[~azure.mgmt.azureadb2c.v2020_05_01_preview.models.GuestUsagesResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.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['Accept'] = 'application/json' + if 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.GuestUsagesResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureActiveDirectory/guestUsages'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets Guest Usages resources under resource group. + + Gets Guest Usages resources under a resource group for the + Microsoft.AzureActiveDirectory resource provider. + + :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 GuestUsagesResource + :rtype: + ~azure.mgmt.azureadb2c.v2020_05_01_preview.models.GuestUsagesResourcePaged[~azure.mgmt.azureadb2c.v2020_05_01_preview.models.GuestUsagesResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.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') + } + 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['Accept'] = 'application/json' + if 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.GuestUsagesResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/guestUsages'} diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/operations/_operations.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/operations/_operations.py new file mode 100644 index 000000000000..1cb7d8e811fc --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/operations/_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: The API version to be used with the HTTP request. Constant value: "2020-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the operations available from this 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.azureadb2c.v2020_05_01_preview.models.OperationPaged[~azure.mgmt.azureadb2c.v2020_05_01_preview.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + if 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.AzureActiveDirectory/operations'} diff --git a/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/version.py b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/version.py new file mode 100644 index 000000000000..fc729cd31949 --- /dev/null +++ b/sdk/azureadb2c/azure-mgmt-azureadb2c/azure/mgmt/azureadb2c/v2020_05_01_preview/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 = "2020-05-01-preview" +