diff --git a/src/communication/HISTORY.rst b/src/communication/HISTORY.rst index 1c139576ba0..4338ead44df 100644 --- a/src/communication/HISTORY.rst +++ b/src/communication/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +1.0.0 +++++++ +* GA release. + +'az communication show-status' has been removed + + 0.1.0 ++++++ * Initial release. diff --git a/src/communication/README.md b/src/communication/README.md index a53ba4aceb6..cd4b143a40b 100644 --- a/src/communication/README.md +++ b/src/communication/README.md @@ -49,7 +49,3 @@ az communication regenerate-key --name "MyCommunicationResource" --key-type "Pri ``` az communication delete --name "MyCommunicationResource" --resource-group "MyResourceGroup" ``` -##### Show-status ##### -``` -az communication show-status --operation-id "db5f291f-284d-46e9-9152-d5c83f7c14b8" --location "westus2" -``` diff --git a/src/communication/azext_communication/azext_metadata.json b/src/communication/azext_communication/azext_metadata.json index 4f48fa652a5..3695b0d7077 100644 --- a/src/communication/azext_communication/azext_metadata.json +++ b/src/communication/azext_communication/azext_metadata.json @@ -1,4 +1,3 @@ { - "azext.isExperimental": true, - "azext.minCliCoreVersion": "2.11.0" + "azext.minCliCoreVersion": "2.15.0" } \ No newline at end of file diff --git a/src/communication/azext_communication/generated/_client_factory.py b/src/communication/azext_communication/generated/_client_factory.py index f92a99614b7..98dce81dedb 100644 --- a/src/communication/azext_communication/generated/_client_factory.py +++ b/src/communication/azext_communication/generated/_client_factory.py @@ -18,7 +18,3 @@ def cf_communication_cl(cli_ctx, *_): def cf_communication_service(cli_ctx, *_): return cf_communication_cl(cli_ctx).communication_service - - -def cf_operation_statuses(cli_ctx, *_): - return cf_communication_cl(cli_ctx).operation_statuses diff --git a/src/communication/azext_communication/generated/_help.py b/src/communication/azext_communication/generated/_help.py index 8a1b8dc72fb..2952f316776 100644 --- a/src/communication/azext_communication/generated/_help.py +++ b/src/communication/azext_communication/generated/_help.py @@ -14,7 +14,7 @@ helps['communication'] = """ type: group - short-summary: Manage service with communication + short-summary: Manage communication service with communication """ helps['communication list'] = """ @@ -111,17 +111,3 @@ text: |- az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" --deleted """ - -helps['communication'] = """ - type: group - short-summary: Manage status with communication -""" - -helps['communication show-status'] = """ - type: command - short-summary: "Gets the current status of an async operation." - examples: - - name: Get OperationStatus - text: |- - az communication show-status --operation-id "db5f291f-284d-46e9-9152-d5c83f7c14b8" --location "westus2" -""" diff --git a/src/communication/azext_communication/generated/_params.py b/src/communication/azext_communication/generated/_params.py index 15934e30f87..92d78176074 100644 --- a/src/communication/azext_communication/generated/_params.py +++ b/src/communication/azext_communication/generated/_params.py @@ -43,7 +43,11 @@ def load_arguments(self, _): c.argument('resource_group_name', resource_group_name_type) c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService ' 'resource.', id_part='name') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) c.argument('tags', tags_type) + c.argument('data_location', type=str, help='The location where the communication service stores its data at ' + 'rest.') with self.argument_context('communication delete') as c: c.argument('resource_group_name', resource_group_name_type) @@ -73,7 +77,3 @@ def load_arguments(self, _): c.argument('resource_group_name', resource_group_name_type) c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService ' 'resource.', id_part='name') - - with self.argument_context('communication show-status') as c: - c.argument('location', arg_type=get_location_type(self.cli_ctx)) - c.argument('operation_id', type=str, help='The ID of an ongoing async operation') diff --git a/src/communication/azext_communication/generated/commands.py b/src/communication/azext_communication/generated/commands.py index 098603f5cc4..97020e860f9 100644 --- a/src/communication/azext_communication/generated/commands.py +++ b/src/communication/azext_communication/generated/commands.py @@ -21,7 +21,7 @@ def load_command_table(self, _): 'ommunicationServiceOperations.{}', client_factory=cf_communication_service) with self.command_group('communication', communication_communication_service, - client_factory=cf_communication_service, is_preview=True) as g: + client_factory=cf_communication_service) as g: g.custom_command('list', 'communication_list') g.custom_show_command('show', 'communication_show') g.custom_command('create', 'communication_create', supports_no_wait=True) @@ -31,12 +31,3 @@ def load_command_table(self, _): g.custom_command('list-key', 'communication_list_key') g.custom_command('regenerate-key', 'communication_regenerate_key') g.custom_wait_command('wait', 'communication_show') - - from azext_communication.generated._client_factory import cf_operation_statuses - communication_operation_statuses = CliCommandType( - operations_tmpl='azext_communication.vendored_sdks.communication.operations._operation_statuses_operations#Oper' - 'ationStatusesOperations.{}', - client_factory=cf_operation_statuses) - with self.command_group('communication', communication_operation_statuses, client_factory=cf_operation_statuses, - is_preview=True) as g: - g.custom_command('show-status', 'communication_show_status') diff --git a/src/communication/azext_communication/generated/custom.py b/src/communication/azext_communication/generated/custom.py index fa5ac314567..ceac075124e 100644 --- a/src/communication/azext_communication/generated/custom.py +++ b/src/communication/azext_communication/generated/custom.py @@ -33,22 +33,30 @@ def communication_create(client, tags=None, data_location=None, no_wait=False): + parameters = {} + parameters['location'] = location + parameters['tags'] = tags + parameters['data_location'] = data_location return sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name=resource_group_name, communication_service_name=name, - location=location, - tags=tags, - data_location=data_location) + parameters=parameters) def communication_update(client, resource_group_name, name, - tags=None): + location=None, + tags=None, + data_location=None): + parameters = {} + parameters['location'] = location + parameters['tags'] = tags + parameters['data_location'] = data_location return client.update(resource_group_name=resource_group_name, communication_service_name=name, - tags=tags) + parameters=parameters) def communication_delete(client, @@ -66,30 +74,27 @@ def communication_link_notification_hub(client, name, resource_id=None, connection_string=None): + link_notification_hub_parameters = {} + link_notification_hub_parameters['resource_id'] = resource_id + link_notification_hub_parameters['connection_string'] = connection_string return client.link_notification_hub(resource_group_name=resource_group_name, communication_service_name=name, - resource_id=resource_id, - connection_string=connection_string) + link_notification_hub_parameters=link_notification_hub_parameters) def communication_list_key(client, resource_group_name, name): - return client.list_key(resource_group_name=resource_group_name, - communication_service_name=name) + return client.list_keys(resource_group_name=resource_group_name, + communication_service_name=name) def communication_regenerate_key(client, resource_group_name, name, key_type=None): + parameters = {} + parameters['key_type'] = key_type return client.regenerate_key(resource_group_name=resource_group_name, communication_service_name=name, - key_type=key_type) - - -def communication_show_status(client, - location, - operation_id): - return client.get(location=location, - operation_id=operation_id) + parameters=parameters) diff --git a/src/communication/azext_communication/manual/_help.py b/src/communication/azext_communication/manual/_help.py index e7e921e5cc8..2952f316776 100644 --- a/src/communication/azext_communication/manual/_help.py +++ b/src/communication/azext_communication/manual/_help.py @@ -14,61 +14,65 @@ helps['communication'] = """ type: group - short-summary: Manage communication service + short-summary: Manage communication service with communication """ helps['communication list'] = """ type: command - short-summary: "List all resources in a subscription or a resource group." + short-summary: "Handles requests to list all resources in a resource group. And Handles requests to list all \ +resources in a subscription." examples: - name: List by resource group text: |- az communication list --resource-group "MyResourceGroup" + - name: List by subscription + text: |- + az communication list """ helps['communication show'] = """ type: command - short-summary: "Get the Communication Service and its properties." + short-summary: "Get the CommunicationService and its properties." examples: - - name: Get the detail of a Communication Service + - name: Get resource text: |- az communication show --name "MyCommunicationResource" --resource-group "MyResourceGroup" """ helps['communication create'] = """ type: command - short-summary: "Create a new Communication Service or update an existing Communication Service." + short-summary: "Create a new CommunicationService or update an existing CommunicationService." examples: - - name: Create a Communication Service + - name: Create or update resource text: |- - az communication create --name "MyCommunicationResource" --location "Global" --data-location \ -"United States" --resource-group "MyResourceGroup" + az communication create --name "MyCommunicationResource" --location "Global" --data-location "United \ +States" --resource-group "MyResourceGroup" """ helps['communication update'] = """ type: command - short-summary: "Operation to update an existing Communication Service." + short-summary: "Operation to update an existing CommunicationService." examples: - - name: Update a Communication Service + - name: Update resource text: |- - az communication update --name "MyCommunicationResource" --tags newTag="newVal" \ ---resource-group "MyResourceGroup" + az communication update --name "MyCommunicationResource" --tags newTag="newVal" --resource-group \ +"MyResourceGroup" """ helps['communication delete'] = """ type: command - short-summary: "Operation to delete a Communication Service." + short-summary: "Operation to delete a CommunicationService." examples: - - name: Delete a Communication Service + - name: Delete resource text: |- az communication delete --name "MyCommunicationResource" --resource-group "MyResourceGroup" """ helps['communication link-notification-hub'] = """ type: command - short-summary: "Link an Azure Notification Hub to this communication." + short-summary: "Links an Azure Notification Hub to this communication service." examples: - - name: Link a Communication Service to a existing notification hub + - name: Link notification hub text: |- az communication link-notification-hub --name "MyCommunicationResource" --connection-string \ "Endpoint=sb://MyNamespace.servicebus.windows.net/;SharedAccessKey=abcd1234" --resource-id \ @@ -78,22 +82,22 @@ helps['communication list-key'] = """ type: command - short-summary: "Get the access keys of the Communication Service resource." + short-summary: "Get the access keys of the CommunicationService resource." examples: - - name: List access keys of a Communication Service + - name: List keys text: |- az communication list-key --name "MyCommunicationResource" --resource-group "MyResourceGroup" """ helps['communication regenerate-key'] = """ type: command - short-summary: "Regenerate Communication Service access key. PrimaryKey and SecondaryKey cannot be regenerated at \ + short-summary: "Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at \ the same time." examples: - - name: Regenerate primary access keys of a Communication Service + - name: Regenerate key text: |- - az communication regenerate-key --name "MyCommunicationResource" --key-type "Primary" \ ---resource-group "MyResourceGroup" + az communication regenerate-key --name "MyCommunicationResource" --key-type "Primary" --resource-group \ +"MyResourceGroup" """ helps['communication wait'] = """ @@ -102,19 +106,8 @@ examples: - name: Pause executing next line of CLI script until the communication is successfully created. text: |- - az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" \ ---created + az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" --created - name: Pause executing next line of CLI script until the communication is successfully deleted. text: |- - az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" \ ---deleted -""" - -helps['communication show-status'] = """ - type: command - short-summary: "Get the current status of an async operation." - examples: - - name: Get the current status of a specific operation - text: |- - az communication show-status --operation-id "db5f291f-284d-46e9-9152-d5c83f7c14b8" --location "westus2" + az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" --deleted """ diff --git a/src/communication/azext_communication/manual/_params.py b/src/communication/azext_communication/manual/_params.py new file mode 100644 index 00000000000..0cd6a145d7a --- /dev/null +++ b/src/communication/azext_communication/manual/_params.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def load_arguments(self, _): + with self.argument_context('communication update') as c: + c.argument('location', validator=None) diff --git a/src/communication/azext_communication/tests/__init__.py b/src/communication/azext_communication/tests/__init__.py index 50e0627daff..70488e93851 100644 --- a/src/communication/azext_communication/tests/__init__.py +++ b/src/communication/azext_communication/tests/__init__.py @@ -31,8 +31,8 @@ def try_manual(func): def import_manual_function(origin_func): from importlib import import_module - decorated_path = inspect.getfile(origin_func) - module_path = __path__[0] + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() if not decorated_path.startswith(module_path): raise Exception("Decorator can only be used in submodules!") manual_path = os.path.join( @@ -46,7 +46,6 @@ def import_manual_function(origin_func): def get_func_to_call(): func_to_call = func try: - func_to_call = import_manual_function(func) func_to_call = import_manual_function(func) logger.info("Found manual override for %s(...)", func.__name__) except (ImportError, AttributeError): @@ -66,6 +65,9 @@ def wrapper(*args, **kwargs): ret = func_to_call(*args, **kwargs) except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() test_map[func.__name__]["result"] = FAILED test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] diff --git a/src/communication/azext_communication/tests/latest/example_steps.py b/src/communication/azext_communication/tests/latest/example_steps.py index fe08b27d392..7e46a91d362 100644 --- a/src/communication/azext_communication/tests/latest/example_steps.py +++ b/src/communication/azext_communication/tests/latest/example_steps.py @@ -25,8 +25,7 @@ def step_create(test, rg_2, rg, checks=None): checks=checks) test.cmd('az communication wait --created ' '--name "{myCommunicationService}" ' - '--resource-group "{rg}"', - checks=[]) + '--resource-group "{rg}"') # EXAMPLE: /CommunicationService/get/Get resource @@ -119,13 +118,3 @@ def step_delete(test, rg_2, rg, checks=None): '--resource-group "{rg}"', checks=checks) - -# EXAMPLE: /OperationStatuses/get/Get OperationStatus -@try_manual -def step_show_status(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az communication show-status ' - '--operation-id "db5f291f-284d-46e9-9152-d5c83f7c14b8" ' - '--location "westus2"', - checks=checks) diff --git a/src/communication/azext_communication/tests/latest/recordings/test_communication_Scenario.yaml b/src/communication/azext_communication/tests/latest/recordings/test_communication_Scenario.yaml new file mode 100644 index 00000000000..cca240ef61c --- /dev/null +++ b/src/communication/azext_communication/tests/latest/recordings/test_communication_Scenario.yaml @@ -0,0 +1,660 @@ +interactions: +- request: + body: '{"location": "Global", "properties": {"dataLocation": "United States"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication create + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json + ParameterSetName: + - --name --location --data-location --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001?api-version=2020-08-20 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001","name":"MyCommunica000001","type":"microsoft.communication/communicationservices","location":"Global","systemData":{"createdBy":"kairu@microsoft.com","createdByType":"User","createdAt":"2021-07-15T05:11:28.9683653Z","lastModifiedBy":"kairu@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-07-15T05:11:28.9683653Z"},"properties":{"dataLocation":"United + States","provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/bb56224b-5c9b-45cd-a4f0-83d12887bd23?api-version=2020-08-20 + cache-control: + - no-cache + content-length: + - '646' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:11:33 GMT + etag: + - '"4800c903-0000-0700-0000-60efc3840000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - communication create + Connection: + - keep-alive + ParameterSetName: + - --name --location --data-location --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/bb56224b-5c9b-45cd-a4f0-83d12887bd23?api-version=2020-08-20 + response: + body: + string: '{"id":"/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/bb56224b-5c9b-45cd-a4f0-83d12887bd23","name":"bb56224b-5c9b-45cd-a4f0-83d12887bd23","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001","status":"Succeeded","startTime":"2021-07-15T05:11:31.3597706Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '482' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:03 GMT + etag: + - '"1c006a18-0000-0800-0000-60efc39a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - communication create + Connection: + - keep-alive + ParameterSetName: + - --name --location --data-location --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001?api-version=2020-08-20 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001","name":"MyCommunica000001","type":"microsoft.communication/communicationservices","location":"Global","systemData":{"createdBy":"kairu@microsoft.com","createdByType":"User","createdAt":"2021-07-15T05:11:28.9683653Z","lastModifiedBy":"kairu@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-07-15T05:11:28.9683653Z"},"properties":{"provisioningState":"Succeeded","hostName":"mycommunicau3s63ukzwwyw.communication.azure.com","immutableResourceId":"34c728a2-02c4-4560-a704-6d443f3d1304","dataLocation":"United + States"}}' + headers: + cache-control: + - no-cache + content-length: + - '769' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:04 GMT + etag: + - '"4800fb03-0000-0700-0000-60efc39a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication wait + Connection: + - keep-alive + ParameterSetName: + - --created --name --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001?api-version=2020-08-20 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001","name":"MyCommunica000001","type":"microsoft.communication/communicationservices","location":"Global","systemData":{"createdBy":"kairu@microsoft.com","createdByType":"User","createdAt":"2021-07-15T05:11:28.9683653Z","lastModifiedBy":"kairu@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-07-15T05:11:28.9683653Z"},"properties":{"provisioningState":"Succeeded","hostName":"mycommunicau3s63ukzwwyw.communication.azure.com","immutableResourceId":"34c728a2-02c4-4560-a704-6d443f3d1304","dataLocation":"United + States"}}' + headers: + cache-control: + - no-cache + content-length: + - '769' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:05 GMT + etag: + - '"4800fb03-0000-0700-0000-60efc39a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001?api-version=2020-08-20 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001","name":"MyCommunica000001","type":"microsoft.communication/communicationservices","location":"Global","systemData":{"createdBy":"kairu@microsoft.com","createdByType":"User","createdAt":"2021-07-15T05:11:28.9683653Z","lastModifiedBy":"kairu@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-07-15T05:11:28.9683653Z"},"properties":{"provisioningState":"Succeeded","hostName":"mycommunicau3s63ukzwwyw.communication.azure.com","immutableResourceId":"34c728a2-02c4-4560-a704-6d443f3d1304","dataLocation":"United + States"}}' + headers: + cache-control: + - no-cache + content-length: + - '769' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:06 GMT + etag: + - '"4800fb03-0000-0700-0000-60efc39a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices?api-version=2020-08-20 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001","name":"MyCommunica000001","type":"microsoft.communication/communicationservices","location":"Global","systemData":{"createdBy":"kairu@microsoft.com","createdByType":"User","createdAt":"2021-07-15T05:11:28.9683653Z","lastModifiedBy":"kairu@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-07-15T05:11:28.9683653Z"},"properties":{"provisioningState":"Succeeded","hostName":"mycommunicau3s63ukzwwyw.communication.azure.com","immutableResourceId":"34c728a2-02c4-4560-a704-6d443f3d1304","dataLocation":"United + States"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '781' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Communication/communicationServices?api-version=2020-08-20 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001","name":"MyCommunica000001","type":"microsoft.communication/communicationservices","location":"Global","systemData":{"createdBy":"kairu@microsoft.com","createdByType":"User","createdAt":"2021-07-15T05:11:28.9683653Z","lastModifiedBy":"kairu@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-07-15T05:11:28.9683653Z"},"properties":{"provisioningState":"Succeeded","hostName":"mycommunicau3s63ukzwwyw.communication.azure.com","immutableResourceId":"34c728a2-02c4-4560-a704-6d443f3d1304","dataLocation":"United + States"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '781' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"tags": {"newTag": "newVal"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication update + Connection: + - keep-alive + Content-Length: + - '30' + Content-Type: + - application/json + ParameterSetName: + - --name --tags --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001?api-version=2020-08-20 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001","name":"MyCommunica000001","type":"microsoft.communication/communicationservices","location":"Global","tags":{"newTag":"newVal"},"systemData":{"createdBy":"kairu@microsoft.com","createdByType":"User","createdAt":"2021-07-15T05:11:28.9683653Z","lastModifiedBy":"kairu@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-07-15T05:12:11.1294403Z"},"properties":{"provisioningState":"Succeeded","hostName":"mycommunicau3s63ukzwwyw.communication.azure.com","immutableResourceId":"34c728a2-02c4-4560-a704-6d443f3d1304","dataLocation":"United + States"}}' + headers: + cache-control: + - no-cache + content-length: + - '796' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:15 GMT + etag: + - '"48000f04-0000-0700-0000-60efc3ac0000"' + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId= + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000002/providers/Microsoft.NotificationHubs/namespaces/MyNamespace/notificationHubs/MyHub", + "connectionString": "Endpoint=sb://MyNamespace.servicebus.windows.net/;SharedAccessKey=abcd1234"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication link-notification-hub + Connection: + - keep-alive + Content-Length: + - '341' + Content-Type: + - application/json + ParameterSetName: + - --name --connection-string --resource-id --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001/linkNotificationHub?api-version=2020-08-20 + response: + body: + string: '{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000002/providers/Microsoft.NotificationHubs/namespaces/MyNamespace/notificationHubs/MyHub"}' + headers: + cache-control: + - no-cache + content-length: + - '242' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:17 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId= + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication list-key + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001/listKeys?api-version=2020-08-20 + response: + body: + string: '{"primaryKey":"XXXXXXXX","secondaryKey":"XXXXXXXX","primaryConnectionString":"endpoint=https://mycommunicau3s63ukzwwyw.communication.azure.com/;accesskey=XXXXXXXX","secondaryConnectionString":"endpoint=https://mycommunicau3s63ukzwwyw.communication.azure.com/;accesskey=XXXXXXXX"}' + headers: + cache-control: + - no-cache + content-length: + - '599' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:19 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId= + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"keyType": "Primary"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication regenerate-key + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + ParameterSetName: + - --name --key-type --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001/regenerateKey?api-version=2020-08-20 + response: + body: + string: '{"primaryKey":"XXXXXXXX","primaryConnectionString":"endpoint=https://mycommunicau3s63ukzwwyw.communication.azure.com/;accesskey=XXXXXXXX"}' + headers: + cache-control: + - no-cache + content-length: + - '298' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:21 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId= + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - communication delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001?api-version=2020-08-20 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/0e4b1591-b06e-478d-91e6-5ed141c710db?api-version=2020-08-20 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:23 GMT + etag: + - '"48003104-0000-0700-0000-60efc3b70000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/0e4b1591-b06e-478d-91e6-5ed141c710db?api-version=2020-08-20 + pragma: + - no-cache + request-context: + - appId= + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - communication delete + Connection: + - keep-alive + ParameterSetName: + - -y --name --resource-group + User-Agent: + - AZURECLI/2.26.0 azsdk-python-mgmt-communication/1.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/0e4b1591-b06e-478d-91e6-5ed141c710db?api-version=2020-08-20 + response: + body: + string: '{"id":"/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/0e4b1591-b06e-478d-91e6-5ed141c710db","name":"0e4b1591-b06e-478d-91e6-5ed141c710db","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000003/providers/Microsoft.Communication/communicationServices/MyCommunica000001","status":"Succeeded","startTime":"2021-07-15T05:12:23.1447165Z","endTime":"2021-07-15T05:12:25.5840953Z","percentComplete":100.0,"properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '547' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Jul 2021 05:12:54 GMT + etag: + - '"1c00a018-0000-0800-0000-60efc3b90000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 \ No newline at end of file diff --git a/src/communication/azext_communication/tests/latest/recordings/test_service_create_and_update.yaml b/src/communication/azext_communication/tests/latest/recordings/test_service_create_and_update.yaml deleted file mode 100644 index 2a51812f758..00000000000 --- a/src/communication/azext_communication/tests/latest/recordings/test_service_create_and_update.yaml +++ /dev/null @@ -1,554 +0,0 @@ -interactions: -- request: - body: '{"location": "Global", "properties": {"dataLocation": "United States"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication create - Connection: - - keep-alive - Content-Length: - - '71' - Content-Type: - - application/json - ParameterSetName: - - --name --location --data-location --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001","name":"comm-100001","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Accepted","hostName":"comm-100001.communication.azure.com","immutableResourceId":"12373ed5-45b2-45e9-a36b-03658846b02c","dataLocation":"United - States"}}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/ac960592-8f9c-479b-93a5-41cf07c0f597?api-version=2020-08-20-preview - cache-control: - - no-cache - content-length: - - '502' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:11:41 GMT - etag: - - '"47031021-0000-0700-0000-5fb4ad0c0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication create - Connection: - - keep-alive - ParameterSetName: - - --name --location --data-location --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/ac960592-8f9c-479b-93a5-41cf07c0f597?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/ac960592-8f9c-479b-93a5-41cf07c0f597","name":"ac960592-8f9c-479b-93a5-41cf07c0f597","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001","status":"Succeeded","startTime":"2020-11-18T05:11:38.6137767Z","endTime":"2020-11-18T05:11:40.8154319Z","percentComplete":100.0,"properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '535' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:12 GMT - etag: - - '"020033e0-0000-0800-0000-5fb4ad0c0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication create - Connection: - - keep-alive - ParameterSetName: - - --name --location --data-location --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001","name":"comm-100001","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Succeeded","hostName":"comm-100001.communication.azure.com","immutableResourceId":"12373ed5-45b2-45e9-a36b-03658846b02c","dataLocation":"United - States"}}' - headers: - cache-control: - - no-cache - content-length: - - '503' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:12 GMT - etag: - - '"47031121-0000-0700-0000-5fb4ad0c0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication wait - Connection: - - keep-alive - ParameterSetName: - - --created --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001","name":"comm-100001","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Succeeded","hostName":"comm-100001.communication.azure.com","immutableResourceId":"12373ed5-45b2-45e9-a36b-03658846b02c","dataLocation":"United - States"}}' - headers: - cache-control: - - no-cache - content-length: - - '503' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:14 GMT - etag: - - '"47031121-0000-0700-0000-5fb4ad0c0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication show - Connection: - - keep-alive - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001","name":"comm-100001","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Succeeded","hostName":"comm-100001.communication.azure.com","immutableResourceId":"12373ed5-45b2-45e9-a36b-03658846b02c","dataLocation":"United - States"}}' - headers: - cache-control: - - no-cache - content-length: - - '503' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:15 GMT - etag: - - '"47031121-0000-0700-0000-5fb4ad0c0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication list - Connection: - - keep-alive - ParameterSetName: - - --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices?api-version=2020-08-20-preview - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001","name":"comm-100001","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Succeeded","hostName":"comm-100001.communication.azure.com","immutableResourceId":"12373ed5-45b2-45e9-a36b-03658846b02c","dataLocation":"United - States"}}]}' - headers: - cache-control: - - no-cache - content-length: - - '515' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:17 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"tags": {"newTag": "newVal"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication update - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - application/json - ParameterSetName: - - --name --tags --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001","name":"comm-100001","type":"Microsoft.Communication/communicationServices","location":"Global","tags":{"newTag":"newVal"},"properties":{"provisioningState":"Succeeded","hostName":"comm-100001.communication.azure.com","immutableResourceId":"12373ed5-45b2-45e9-a36b-03658846b02c","dataLocation":"United - States"}}' - headers: - cache-control: - - no-cache - content-length: - - '530' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:22 GMT - etag: - - '"47038c22-0000-0700-0000-5fb4ad340000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication show - Connection: - - keep-alive - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001","name":"comm-100001","type":"Microsoft.Communication/communicationServices","location":"Global","tags":{"newTag":"newVal"},"properties":{"provisioningState":"Succeeded","hostName":"comm-100001.communication.azure.com","immutableResourceId":"12373ed5-45b2-45e9-a36b-03658846b02c","dataLocation":"United - States"}}' - headers: - cache-control: - - no-cache - content-length: - - '530' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:23 GMT - etag: - - '"47038c22-0000-0700-0000-5fb4ad340000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -y --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001?api-version=2020-08-20-preview - response: - body: - string: 'null' - headers: - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:26 GMT - etag: - - '"4703ab22-0000-0700-0000-5fb4ad3a0000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/cd1a735b-e9b4-4bab-a3a9-19635243e6f9?api-version=2020-08-20-preview - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication delete - Connection: - - keep-alive - ParameterSetName: - - -y --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/cd1a735b-e9b4-4bab-a3a9-19635243e6f9?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/cd1a735b-e9b4-4bab-a3a9-19635243e6f9","name":"cd1a735b-e9b4-4bab-a3a9-19635243e6f9","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001","status":"Deleted","startTime":"2020-11-18T05:12:25.7559804Z","endTime":"2020-11-18T05:12:27.7518745Z","percentComplete":100.0}' - headers: - cache-control: - - no-cache - content-length: - - '515' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:57 GMT - etag: - - '"02005ae0-0000-0800-0000-5fb4ad3b0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication show - Connection: - - keep-alive - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_create_and_update_000001/providers/Microsoft.Communication/communicationServices/comm-100001?api-version=2020-08-20-preview - response: - body: - string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Communication/CommunicationServices/comm-100001'' - under resource group ''test_service_create_and_update_000001'' was not found. - For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' - headers: - cache-control: - - no-cache - content-length: - - '304' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:12:58 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 404 - message: Not Found -version: 1 diff --git a/src/communication/azext_communication/tests/latest/recordings/test_service_link_to_notification_hub.yaml b/src/communication/azext_communication/tests/latest/recordings/test_service_link_to_notification_hub.yaml deleted file mode 100644 index 93ea4d8c76a..00000000000 --- a/src/communication/azext_communication/tests/latest/recordings/test_service_link_to_notification_hub.yaml +++ /dev/null @@ -1,359 +0,0 @@ -interactions: -- request: - body: '{"location": "Global", "properties": {"dataLocation": "United States"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication service create - Connection: - - keep-alive - Content-Length: - - '71' - Content-Type: - - application/json - ParameterSetName: - - --name --location --data-location --resource-group - User-Agent: - - AZURECLI/2.14.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-112-generic-x86_64-with-debian-buster-sid) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003","name":"comm-100003","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Accepted","hostName":"comm-100003.communication.azure.com","immutableResourceId":"cf885d43-3011-43de-b772-90ec9a327a2d","dataLocation":"United - States"}}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/0cf4a077-5602-4100-9785-9855ae19b552?api-version=2020-08-20-preview - cache-control: - - no-cache - content-length: - - '502' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Nov 2020 06:35:58 GMT - etag: - - '"2401b653-0000-0700-0000-5fa39d4d0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication service create - Connection: - - keep-alive - ParameterSetName: - - --name --location --data-location --resource-group - User-Agent: - - AZURECLI/2.14.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-112-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/0cf4a077-5602-4100-9785-9855ae19b552?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/0cf4a077-5602-4100-9785-9855ae19b552","name":"0cf4a077-5602-4100-9785-9855ae19b552","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003","status":"Succeeded","startTime":"2020-11-05T06:35:54.4355227Z","percentComplete":100.0,"properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '494' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Nov 2020 06:36:29 GMT - etag: - - '"7b00f707-0000-0800-0000-5fa39d4d0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication service create - Connection: - - keep-alive - ParameterSetName: - - --name --location --data-location --resource-group - User-Agent: - - AZURECLI/2.14.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-112-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003","name":"comm-100003","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Succeeded","hostName":"comm-100003.communication.azure.com","immutableResourceId":"cf885d43-3011-43de-b772-90ec9a327a2d","dataLocation":"United - States"}}' - headers: - cache-control: - - no-cache - content-length: - - '503' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Nov 2020 06:36:31 GMT - etag: - - '"2401b753-0000-0700-0000-5fa39d4e0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication service wait - Connection: - - keep-alive - ParameterSetName: - - --created --name --resource-group - User-Agent: - - AZURECLI/2.14.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-112-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003","name":"comm-100003","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Succeeded","hostName":"comm-100003.communication.azure.com","immutableResourceId":"cf885d43-3011-43de-b772-90ec9a327a2d","dataLocation":"United - States"}}' - headers: - cache-control: - - no-cache - content-length: - - '503' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Nov 2020 06:36:32 GMT - etag: - - '"2401b753-0000-0700-0000-5fa39d4e0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/harold/providers/Microsoft.NotificationHubs/namespaces/testcommunication1/notificationHubs/puhs-hub-1", - "connectionString": "Endpoint=sb://testcommunication1.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=4szS1x2H6uI/smTk3C8nEaGrCLLZr1g/kY1fGJgPE7I="}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication service link-notification-hub - Connection: - - keep-alive - Content-Length: - - '382' - Content-Type: - - application/json - ParameterSetName: - - --name --connection-string --resource-id --resource-group - User-Agent: - - AZURECLI/2.14.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-112-generic-x86_64-with-debian-buster-sid) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003/linkNotificationHub?api-version=2020-08-20-preview - response: - body: - string: '{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/harold/providers/Microsoft.NotificationHubs/namespaces/testcommunication1/notificationHubs/puhs-hub-1"}' - headers: - cache-control: - - no-cache - content-length: - - '185' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Nov 2020 06:36:37 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication service delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -y --name --resource-group - User-Agent: - - AZURECLI/2.14.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-112-generic-x86_64-with-debian-buster-sid) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003?api-version=2020-08-20-preview - response: - body: - string: 'null' - headers: - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Nov 2020 06:36:40 GMT - etag: - - '"24017b5b-0000-0700-0000-5fa39d780000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/a40b876c-7c82-4c97-9952-e3810a636382?api-version=2020-08-20-preview - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication service delete - Connection: - - keep-alive - ParameterSetName: - - -y --name --resource-group - User-Agent: - - AZURECLI/2.14.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-112-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/a40b876c-7c82-4c97-9952-e3810a636382?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/a40b876c-7c82-4c97-9952-e3810a636382","name":"a40b876c-7c82-4c97-9952-e3810a636382","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_link_to_notification_hub_000001/providers/Microsoft.Communication/communicationServices/comm-100003","status":"Deleted","startTime":"2020-11-05T06:36:39.2304965Z","percentComplete":100.0}' - headers: - cache-control: - - no-cache - content-length: - - '474' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Nov 2020 06:37:10 GMT - etag: - - '"7b003209-0000-0800-0000-5fa39d790000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/src/communication/azext_communication/tests/latest/recordings/test_service_regenerate_and_link_key.yaml b/src/communication/azext_communication/tests/latest/recordings/test_service_regenerate_and_link_key.yaml deleted file mode 100644 index c98264266b9..00000000000 --- a/src/communication/azext_communication/tests/latest/recordings/test_service_regenerate_and_link_key.yaml +++ /dev/null @@ -1,460 +0,0 @@ -interactions: -- request: - body: '{"location": "Global", "properties": {"dataLocation": "United States"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication create - Connection: - - keep-alive - Content-Length: - - '71' - Content-Type: - - application/json - ParameterSetName: - - --name --location --data-location --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002","name":"comm-100002","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Accepted","hostName":"comm-100002.communication.azure.com","immutableResourceId":"9506682b-91ee-4920-8b3b-22dc70417bed","dataLocation":"United - States"}}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/2b399864-b25d-4961-9b87-4fb868d02c10?api-version=2020-08-20-preview - cache-control: - - no-cache - content-length: - - '502' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:13:24 GMT - etag: - - '"47034624-0000-0700-0000-5fb4ad740000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication create - Connection: - - keep-alive - ParameterSetName: - - --name --location --data-location --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/2b399864-b25d-4961-9b87-4fb868d02c10?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/2b399864-b25d-4961-9b87-4fb868d02c10","name":"2b399864-b25d-4961-9b87-4fb868d02c10","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002","status":"Succeeded","startTime":"2020-11-18T05:13:22.0369635Z","endTime":"2020-11-18T05:13:24.7671626Z","percentComplete":100.0,"properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '535' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:13:55 GMT - etag: - - '"020078e0-0000-0800-0000-5fb4ad740000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication create - Connection: - - keep-alive - ParameterSetName: - - --name --location --data-location --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002","name":"comm-100002","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Succeeded","hostName":"comm-100002.communication.azure.com","immutableResourceId":"9506682b-91ee-4920-8b3b-22dc70417bed","dataLocation":"United - States"}}' - headers: - cache-control: - - no-cache - content-length: - - '503' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:13:55 GMT - etag: - - '"47034924-0000-0700-0000-5fb4ad740000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication wait - Connection: - - keep-alive - ParameterSetName: - - --created --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002","name":"comm-100002","type":"Microsoft.Communication/communicationServices","location":"Global","properties":{"provisioningState":"Succeeded","hostName":"comm-100002.communication.azure.com","immutableResourceId":"9506682b-91ee-4920-8b3b-22dc70417bed","dataLocation":"United - States"}}' - headers: - cache-control: - - no-cache - content-length: - - '503' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:13:58 GMT - etag: - - '"47034924-0000-0700-0000-5fb4ad740000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication list-key - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002/listKeys?api-version=2020-08-20-preview - response: - body: - string: '{"primaryKey":"GWe2ldvoC9iK6ce39GcVoO9jUFg4R/5cfis7jZMzRCnVMsViYkyEiexbEK5OAfqZcL4/0PYwgak5GpFWht8+2Q==","secondaryKey":"DvEG6hLF5cGUNcjVBsVNffb80Avw3u0vhl8/bRPo5FyeDc1v91wwgoNZ4SjBAYJoY1kp9lnGd7IB/siBRFl20A==","primaryConnectionString":"endpoint=https://comm-100002.communication.azure.com/;accesskey=GWe2ldvoC9iK6ce39GcVoO9jUFg4R/5cfis7jZMzRCnVMsViYkyEiexbEK5OAfqZcL4/0PYwgak5GpFWht8+2Q==","secondaryConnectionString":"endpoint=https://comm-100002.communication.azure.com/;accesskey=DvEG6hLF5cGUNcjVBsVNffb80Avw3u0vhl8/bRPo5FyeDc1v91wwgoNZ4SjBAYJoY1kp9lnGd7IB/siBRFl20A=="}' - headers: - cache-control: - - no-cache - content-length: - - '575' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:14:00 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: '{"keyType": "Primary"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication regenerate-key - Connection: - - keep-alive - Content-Length: - - '22' - Content-Type: - - application/json - ParameterSetName: - - --name --key-type --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002/regenerateKey?api-version=2020-08-20-preview - response: - body: - string: '{"primaryKey":"TvIzocFsecfvuTj08ag1ptkMwbqXZR8/Ozdipu9WN03GfqhmaI6XPyP316tdgqX4BqVXe9qVYJJT/96SaF1CEg==","primaryConnectionString":"endpoint=https://comm-100002.communication.azure.com/;accesskey=TvIzocFsecfvuTj08ag1ptkMwbqXZR8/Ozdipu9WN03GfqhmaI6XPyP316tdgqX4BqVXe9qVYJJT/96SaF1CEg=="}' - headers: - cache-control: - - no-cache - content-length: - - '286' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:14:03 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication list-key - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002/listKeys?api-version=2020-08-20-preview - response: - body: - string: '{"primaryKey":"TvIzocFsecfvuTj08ag1ptkMwbqXZR8/Ozdipu9WN03GfqhmaI6XPyP316tdgqX4BqVXe9qVYJJT/96SaF1CEg==","secondaryKey":"DvEG6hLF5cGUNcjVBsVNffb80Avw3u0vhl8/bRPo5FyeDc1v91wwgoNZ4SjBAYJoY1kp9lnGd7IB/siBRFl20A==","primaryConnectionString":"endpoint=https://comm-100002.communication.azure.com/;accesskey=TvIzocFsecfvuTj08ag1ptkMwbqXZR8/Ozdipu9WN03GfqhmaI6XPyP316tdgqX4BqVXe9qVYJJT/96SaF1CEg==","secondaryConnectionString":"endpoint=https://comm-100002.communication.azure.com/;accesskey=DvEG6hLF5cGUNcjVBsVNffb80Avw3u0vhl8/bRPo5FyeDc1v91wwgoNZ4SjBAYJoY1kp9lnGd7IB/siBRFl20A=="}' - headers: - cache-control: - - no-cache - content-length: - - '575' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:14:05 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - communication delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -y --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002?api-version=2020-08-20-preview - response: - body: - string: 'null' - headers: - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:14:09 GMT - etag: - - '"4703e026-0000-0700-0000-5fb4ada20000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/ee41e1dc-9617-4f2a-9d31-f653917ca7ac?api-version=2020-08-20-preview - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - communication delete - Connection: - - keep-alive - ParameterSetName: - - -y --name --resource-group - User-Agent: - - AZURECLI/2.15.0 azsdk-python-communicationservicemanagementclient/unknown - Python/3.7.4 (Linux-4.15.0-123-generic-x86_64-with-debian-buster-sid) - method: GET - uri: https://management.azure.com/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/ee41e1dc-9617-4f2a-9d31-f653917ca7ac?api-version=2020-08-20-preview - response: - body: - string: '{"id":"/providers/Microsoft.Communication/locations/WESTUS2/operationStatuses/ee41e1dc-9617-4f2a-9d31-f653917ca7ac","name":"ee41e1dc-9617-4f2a-9d31-f653917ca7ac","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_service_generate_and_link_key_000001/providers/Microsoft.Communication/communicationServices/comm-100002","status":"Deleted","startTime":"2020-11-18T05:14:08.0894801Z","endTime":"2020-11-18T05:14:19.3788299Z"}' - headers: - cache-control: - - no-cache - content-length: - - '491' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 18 Nov 2020 05:14:40 GMT - etag: - - '"02009fe0-0000-0800-0000-5fb4adab0000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/src/communication/azext_communication/tests/latest/test_communication_scenario.py b/src/communication/azext_communication/tests/latest/test_communication_scenario.py index e32f248a1eb..1fafcaaf46f 100644 --- a/src/communication/azext_communication/tests/latest/test_communication_scenario.py +++ b/src/communication/azext_communication/tests/latest/test_communication_scenario.py @@ -9,22 +9,21 @@ # -------------------------------------------------------------------------- import os -from azure.cli.testsdk import ScenarioTest, record_only +from azure.cli.testsdk import ScenarioTest from azure.cli.testsdk import ResourceGroupPreparer from .example_steps import step_create from .example_steps import step_show from .example_steps import step_list -from .example_steps import step_list +from .example_steps import step_list2 from .example_steps import step_update from .example_steps import step_link_notification_hub from .example_steps import step_list_key from .example_steps import step_regenerate_key from .example_steps import step_delete -from .example_steps import step_show_status from .. import ( try_manual, - # raise_if, - # calc_coverage + raise_if, + calc_coverage ) @@ -44,131 +43,58 @@ def cleanup_scenario(test, rg_2, rg): # Testcase: Scenario -# @try_manual -# def call_scenario(test, rg_2, rg): -# setup_scenario(test, rg_2, rg) -# step_create(test, rg_2, rg, checks=[ -# test.check("name", "{myCommunicationService}", case_sensitive=False), -# test.check("location", "Global", case_sensitive=False), -# test.check("dataLocation", "United States", case_sensitive=False), -# ]) -# step_show(test, rg_2, rg, checks=[ -# test.check("name", "{myCommunicationService}", case_sensitive=False), -# test.check("location", "Global", case_sensitive=False), -# test.check("dataLocation", "United States", case_sensitive=False), -# ]) -# step_list(test, rg_2, rg, checks=[ -# test.check('length(@)', 1), -# ]) -# step_list(test, rg_2, rg, checks=[ -# test.check('length(@)', 1), -# ]) -# step_update(test, rg_2, rg, checks=[ -# test.check("name", "{myCommunicationService}", case_sensitive=False), -# test.check("location", "Global", case_sensitive=False), -# test.check("dataLocation", "United States", case_sensitive=False), -# test.check("tags.newTag", "newVal", case_sensitive=False), -# ]) -# step_link_notification_hub(test, rg_2, rg, checks=[]) -# step_list_key(test, rg_2, rg, checks=[]) -# step_regenerate_key(test, rg_2, rg, checks=[]) -# step_delete(test, rg_2, rg, checks=[]) -# step_show_status(test, rg_2, rg, checks=[]) -# cleanup_scenario(test, rg_2, rg) - - -# # Test class for Scenario -# @try_manual -# class CommunicationScenarioTest(ScenarioTest): - -# @ResourceGroupPreparer(name_prefix='clitestcommunication_MyOtherResourceGroup'[:7], key='rg_2', -# parameter_name='rg_2') -# @ResourceGroupPreparer(name_prefix='clitestcommunication_MyResourceGroup'[:7], key='rg', parameter_name='rg') -# def test_communication_Scenario(self, rg_2, rg): - -# self.kwargs.update({ -# 'subscription_id': self.get_subscription_id() -# }) - -# self.kwargs.update({ -# 'myCommunicationService': 'MyCommunicationResource', -# }) - -# call_scenario(self, rg_2, rg) -# calc_coverage(__file__) -# raise_if() - - -class CommunicationServiceScenarioTest(ScenarioTest): - - @ResourceGroupPreparer(name_prefix="test_service_create_and_update_") - def test_service_create_and_update(self, resource_group): - - self.kwargs.update({ - "myCommunicationService": "comm-100001", - }) - - # create a communication service - step_create(self, rg_2=None, rg=resource_group) - - # show that communication service - step_show(self, rg_2=None, rg=resource_group) - - # list all communication services by resource group - step_list(self, rg_2=None, rg=resource_group) - - # update tag of that service - step_update(self, rg_2=None, rg=resource_group) - # show that communication service - step_show(self, rg_2=None, rg=resource_group) - - # delete that service - step_delete(self, rg_2=None, rg=resource_group) - - # list current all communication services by resource group - step_show(self, rg_2=None, rg=resource_group) - - @ResourceGroupPreparer(name_prefix="test_service_generate_and_link_key_") - def test_service_regenerate_and_link_key(self, resource_group): +@try_manual +def call_scenario(test, rg_2, rg): + setup_scenario(test, rg_2, rg) + step_create(test, rg_2, rg, checks=[ + test.check("name", "{myCommunicationService}", case_sensitive=False), + test.check("location", "Global", case_sensitive=False), + test.check("dataLocation", "United States", case_sensitive=False), + ]) + step_show(test, rg_2, rg, checks=[ + test.check("name", "{myCommunicationService}", case_sensitive=False), + test.check("location", "Global", case_sensitive=False), + test.check("dataLocation", "United States", case_sensitive=False), + ]) + step_list(test, rg_2, rg, checks=[ + test.check('length(@)', 1), + ]) + step_list2(test, rg_2, rg, checks=[ + test.check('length(@)', 1), + ]) + step_update(test, rg_2, rg, checks=[ + test.check("name", "{myCommunicationService}", case_sensitive=False), + test.check("location", "Global", case_sensitive=False), + test.check("dataLocation", "United States", case_sensitive=False), + test.check("tags.newTag", "newVal", case_sensitive=False), + ]) + step_link_notification_hub(test, rg_2, rg, checks=[]) + step_list_key(test, rg_2, rg, checks=[]) + step_regenerate_key(test, rg_2, rg, checks=[]) + step_delete(test, rg_2, rg, checks=[]) + cleanup_scenario(test, rg_2, rg) + + +# Test class for Scenario +@try_manual +class CommunicationScenarioTest(ScenarioTest): + def __init__(self, *args, **kwargs): + super(CommunicationScenarioTest, self).__init__(*args, **kwargs) self.kwargs.update({ - "myCommunicationService": "comm-100002", + 'subscription_id': self.get_subscription_id() }) - # create a communication service - step_create(self, rg_2=None, rg=resource_group) - - step_list_key(self, rg_2=None, rg=resource_group) - - # regenerate a new one - step_regenerate_key(self, rg_2=None, rg=resource_group) - - # the listed keys would be different with the previous one - step_list_key(self, rg_2=None, rg=resource_group) - - # delete that service - step_delete(self, rg_2=None, rg=resource_group) - - @record_only() # notification hub is an extension - @ResourceGroupPreparer(name_prefix="test_service_link_to_notification_hub_") - def test_service_link_to_notification_hub(self, resource_group): - - # notification-hub is an extension self.kwargs.update({ - "myCommunicationService": "comm-100003", - "notificationHubID": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/harold/providers/Microsoft.NotificationHubs/namespaces/testcommunication1/notificationHubs/puhs-hub-1" + 'myCommunicationService': self.create_random_name(prefix='MyCommunicationResource'[:11], length=23), }) - # create a communication service - step_create(self, rg_2=None, rg=resource_group) - # link a notification hub - self.cmd('az communication link-notification-hub ' - '--name "{myCommunicationService}" ' - '--connection-string "Endpoint=sb://testcommunication1.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=4szS1x2H6uI/smTk3C8nEaGrCLLZr1g/kY1fGJgPE7I=" ' - '--resource-id "{notificationHubID}" ' - '--resource-group "{rg}"', - checks=[]) + @ResourceGroupPreparer(name_prefix='clitestcommunication_MyOtherResourceGroup'[:7], key='rg_2', + parameter_name='rg_2') + @ResourceGroupPreparer(name_prefix='clitestcommunication_MyResourceGroup'[:7], key='rg', parameter_name='rg') + def test_communication_Scenario(self, rg_2, rg): + call_scenario(self, rg_2, rg) + calc_coverage(__file__) + raise_if() - # delete that service - step_delete(self, rg_2=None, rg=resource_group) diff --git a/src/communication/azext_communication/tests/latest/test_communication_scenario_coverage.md b/src/communication/azext_communication/tests/latest/test_communication_scenario_coverage.md new file mode 100644 index 00000000000..53d24e8680b --- /dev/null +++ b/src/communication/azext_communication/tests/latest/test_communication_scenario_coverage.md @@ -0,0 +1,11 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_create|successed||||2021-07-15 05:28:42.600879|2021-07-15 05:28:44.014667| +|step_show|successed||||2021-07-15 05:28:44.015669|2021-07-15 05:28:44.150585| +|step_list|successed||||2021-07-15 05:28:44.151889|2021-07-15 05:28:44.335519| +|step_list2|successed||||2021-07-15 05:28:44.335519|2021-07-15 05:28:44.479516| +|step_update|successed||||2021-07-15 05:28:44.479516|2021-07-15 05:28:44.628518| +|step_link_notification_hub|successed||||2021-07-15 05:28:44.628518|2021-07-15 05:28:44.841516| +|step_list_key|successed||||2021-07-15 05:28:44.841516|2021-07-15 05:28:44.984517| +|step_regenerate_key|successed||||2021-07-15 05:28:44.985517|2021-07-15 05:28:45.130055| +|step_delete|successed||||2021-07-15 05:28:45.130055|2021-07-15 05:28:45.385899| +Coverage: 9/9 diff --git a/src/communication/azext_communication/vendored_sdks/communication/__init__.py b/src/communication/azext_communication/vendored_sdks/communication/__init__.py index 8d413db78e1..97e20afe912 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/__init__.py +++ b/src/communication/azext_communication/vendored_sdks/communication/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._communication_service_management_client import CommunicationServiceManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['CommunicationServiceManagementClient'] try: diff --git a/src/communication/azext_communication/vendored_sdks/communication/_communication_service_management_client.py b/src/communication/azext_communication/vendored_sdks/communication/_communication_service_management_client.py index d84699af73c..3d088f03beb 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/_communication_service_management_client.py +++ b/src/communication/azext_communication/vendored_sdks/communication/_communication_service_management_client.py @@ -18,21 +18,18 @@ from azure.core.credentials import TokenCredential from ._configuration import CommunicationServiceManagementClientConfiguration -from .operations import OperationOperations +from .operations import Operations from .operations import CommunicationServiceOperations -from .operations import OperationStatusesOperations from . import models class CommunicationServiceManagementClient(object): """REST API for Azure Communication Services. - :ivar operation: OperationOperations operations - :vartype operation: communication_service_management_client.operations.OperationOperations + :ivar operations: Operations operations + :vartype operations: communication_service_management_client.operations.Operations :ivar communication_service: CommunicationServiceOperations operations :vartype communication_service: communication_service_management_client.operations.CommunicationServiceOperations - :ivar operation_statuses: OperationStatusesOperations operations - :vartype operation_statuses: communication_service_management_client.operations.OperationStatusesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. @@ -59,12 +56,10 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.operation = OperationOperations( + self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.communication_service = CommunicationServiceOperations( self._client, self._config, self._serialize, self._deserialize) - self.operation_statuses = OperationStatusesOperations( - self._client, self._config, self._serialize, self._deserialize) def close(self): # type: () -> None diff --git a/src/communication/azext_communication/vendored_sdks/communication/_configuration.py b/src/communication/azext_communication/vendored_sdks/communication/_configuration.py index 800d9f9e817..640d900bbf7 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/_configuration.py +++ b/src/communication/azext_communication/vendored_sdks/communication/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class CommunicationServiceManagementClientConfiguration(Configuration): """Configuration for CommunicationServiceManagementClient. @@ -47,9 +48,9 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-08-20-preview" + self.api_version = "2020-08-20" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'communicationservicemanagementclient/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-communication/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/__init__.py b/src/communication/azext_communication/vendored_sdks/communication/_version.py similarity index 58% rename from src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/__init__.py rename to src/communication/azext_communication/vendored_sdks/communication/_version.py index da42819d211..c47f66669f1 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/__init__.py +++ b/src/communication/azext_communication/vendored_sdks/communication/_version.py @@ -6,12 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._operation_operations_async import OperationOperations -from ._communication_service_operations_async import CommunicationServiceOperations -from ._operation_statuses_operations_async import OperationStatusesOperations - -__all__ = [ - 'OperationOperations', - 'CommunicationServiceOperations', - 'OperationStatusesOperations', -] +VERSION = "1.0.0" diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/_communication_service_management_client.py b/src/communication/azext_communication/vendored_sdks/communication/aio/_communication_service_management_client.py index 0f8fc9a88aa..e760335d816 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/_communication_service_management_client.py +++ b/src/communication/azext_communication/vendored_sdks/communication/aio/_communication_service_management_client.py @@ -16,21 +16,18 @@ from azure.core.credentials_async import AsyncTokenCredential from ._configuration import CommunicationServiceManagementClientConfiguration -from .operations import OperationOperations +from .operations import Operations from .operations import CommunicationServiceOperations -from .operations import OperationStatusesOperations from .. import models class CommunicationServiceManagementClient(object): """REST API for Azure Communication Services. - :ivar operation: OperationOperations operations - :vartype operation: communication_service_management_client.aio.operations.OperationOperations + :ivar operations: Operations operations + :vartype operations: communication_service_management_client.aio.operations.Operations :ivar communication_service: CommunicationServiceOperations operations :vartype communication_service: communication_service_management_client.aio.operations.CommunicationServiceOperations - :ivar operation_statuses: OperationStatusesOperations operations - :vartype operation_statuses: communication_service_management_client.aio.operations.OperationStatusesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. @@ -56,12 +53,10 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.operation = OperationOperations( + self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.communication_service = CommunicationServiceOperations( self._client, self._config, self._serialize, self._deserialize) - self.operation_statuses = OperationStatusesOperations( - self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: await self._client.close() diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/_communication_service_management_client_async.py b/src/communication/azext_communication/vendored_sdks/communication/aio/_communication_service_management_client_async.py deleted file mode 100644 index 1b4dcf9d399..00000000000 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/_communication_service_management_client_async.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration_async import CommunicationServiceManagementClientConfiguration -from .operations_async import OperationOperations -from .operations_async import CommunicationServiceOperations -from .operations_async import OperationStatusesOperations -from .. import models - - -class CommunicationServiceManagementClient(object): - """REST API for Azure Communication Services. - - :ivar operation: OperationOperations operations - :vartype operation: communication_service_management_client.aio.operations_async.OperationOperations - :ivar communication_service: CommunicationServiceOperations operations - :vartype communication_service: communication_service_management_client.aio.operations_async.CommunicationServiceOperations - :ivar operation_statuses: OperationStatusesOperations operations - :vartype operation_statuses: communication_service_management_client.aio.operations_async.OperationStatusesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = CommunicationServiceManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.operation = OperationOperations( - self._client, self._config, self._serialize, self._deserialize) - self.communication_service = CommunicationServiceOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operation_statuses = OperationStatusesOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "CommunicationServiceManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/_configuration.py b/src/communication/azext_communication/vendored_sdks/communication/aio/_configuration.py index 5398ab08c0d..6df95a18905 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/_configuration.py +++ b/src/communication/azext_communication/vendored_sdks/communication/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class CommunicationServiceManagementClientConfiguration(Configuration): """Configuration for CommunicationServiceManagementClient. @@ -44,9 +45,9 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-08-20-preview" + self.api_version = "2020-08-20" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'communicationservicemanagementclient/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-communication/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/_configuration_async.py b/src/communication/azext_communication/vendored_sdks/communication/aio/_configuration_async.py deleted file mode 100644 index ae3fd146a35..00000000000 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/_configuration_async.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class CommunicationServiceManagementClientConfiguration(Configuration): - """Configuration for CommunicationServiceManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - super(CommunicationServiceManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2020-08-20-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) - kwargs.setdefault('sdk_moniker', 'communicationservicemanagementclient/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/operations/__init__.py b/src/communication/azext_communication/vendored_sdks/communication/aio/operations/__init__.py index 34e927cfe39..0a595e4791c 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/operations/__init__.py +++ b/src/communication/azext_communication/vendored_sdks/communication/aio/operations/__init__.py @@ -6,12 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._operation_operations import OperationOperations +from ._operations import Operations from ._communication_service_operations import CommunicationServiceOperations -from ._operation_statuses_operations import OperationStatusesOperations __all__ = [ - 'OperationOperations', + 'Operations', 'CommunicationServiceOperations', - 'OperationStatusesOperations', ] diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_communication_service_operations.py b/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_communication_service_operations.py index 63a76db65cb..653c522839a 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_communication_service_operations.py +++ b/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_communication_service_operations.py @@ -45,20 +45,15 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - type: Optional[str] = None, - name: Optional[str] = None, + name_availability_parameters: Optional["models.NameAvailabilityParameters"] = None, **kwargs ) -> "models.NameAvailability": """Check Name Availability. Checks that the CommunicationService name is valid and is not already in use. - :param type: The resource type. Should be always - "Microsoft.Communication/CommunicationServices". - :type type: str - :param name: The CommunicationService name to validate. e.g."my-CommunicationService-name- - here". - :type name: str + :param name_availability_parameters: Parameters supplied to the operation. + :type name_availability_parameters: ~communication_service_management_client.models.NameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability, or the result of cls(response) :rtype: ~communication_service_management_client.models.NameAvailability @@ -69,9 +64,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - name_availability_parameters = models.NameAvailabilityParameters(type=type, name=name) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -118,23 +111,19 @@ async def link_notification_hub( self, resource_group_name: str, communication_service_name: str, - resource_id: Optional[str] = None, - connection_string: Optional[str] = None, + link_notification_hub_parameters: Optional["models.LinkNotificationHubParameters"] = None, **kwargs ) -> "models.LinkedNotificationHub": """Link Notification Hub. Links an Azure Notification Hub to this communication service. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str - :param resource_id: The resource ID of the notification hub. - :type resource_id: str - :param connection_string: Connection string for the notification hub. - :type connection_string: str + :param link_notification_hub_parameters: Parameters supplied to the operation. + :type link_notification_hub_parameters: ~communication_service_management_client.models.LinkNotificationHubParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: LinkedNotificationHub, or the result of cls(response) :rtype: ~communication_service_management_client.models.LinkedNotificationHub @@ -145,9 +134,7 @@ async def link_notification_hub( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - link_notification_hub_parameters = models.LinkNotificationHubParameters(resource_id=resource_id, connection_string=connection_string) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -155,8 +142,8 @@ async def link_notification_hub( url = self.link_notification_hub.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -210,7 +197,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" def prepare_request(next_link=None): @@ -270,8 +257,7 @@ def list_by_resource_group( Handles requests to list all resources in a resource group. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CommunicationServiceResourceList or the result of cls(response) @@ -283,7 +269,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" def prepare_request(next_link=None): @@ -296,7 +282,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -339,20 +325,19 @@ async def update( self, resource_group_name: str, communication_service_name: str, - tags: Optional[Dict[str, str]] = None, + parameters: Optional["models.CommunicationServiceResource"] = None, **kwargs ) -> "models.CommunicationServiceResource": """Update. Operation to update an existing CommunicationService. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str - :param tags: Tags of the service which is a list of key value pairs that describe the resource. - :type tags: dict[str, str] + :param parameters: Parameters for the update operation. + :type parameters: ~communication_service_management_client.models.CommunicationServiceResource :keyword callable cls: A custom type or function that will be passed the direct response :return: CommunicationServiceResource, or the result of cls(response) :rtype: ~communication_service_management_client.models.CommunicationServiceResource @@ -363,9 +348,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - parameters = models.TaggedResource(tags=tags) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -373,8 +356,8 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -389,7 +372,7 @@ async def update( body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: - body_content = self._serialize.body(parameters, 'TaggedResource') + body_content = self._serialize.body(parameters, 'CommunicationServiceResource') else: body_content = None body_content_kwargs['content'] = body_content @@ -420,8 +403,7 @@ async def get( Get the CommunicationService and its properties. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str @@ -435,15 +417,15 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -476,9 +458,7 @@ async def _create_or_update_initial( self, resource_group_name: str, communication_service_name: str, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - data_location: Optional[str] = None, + parameters: Optional["models.CommunicationServiceResource"] = None, **kwargs ) -> "models.CommunicationServiceResource": cls = kwargs.pop('cls', None) # type: ClsType["models.CommunicationServiceResource"] @@ -486,9 +466,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - parameters = models.CommunicationServiceResource(location=location, tags=tags, data_location=data_location) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -496,8 +474,8 @@ async def _create_or_update_initial( url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -543,26 +521,19 @@ async def begin_create_or_update( self, resource_group_name: str, communication_service_name: str, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - data_location: Optional[str] = None, + parameters: Optional["models.CommunicationServiceResource"] = None, **kwargs ) -> AsyncLROPoller["models.CommunicationServiceResource"]: """Create Or Update. Create a new CommunicationService or update an existing CommunicationService. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str - :param location: The Azure location where the CommunicationService is running. - :type location: str - :param tags: Tags of the service which is a list of key value pairs that describe the resource. - :type tags: dict[str, str] - :param data_location: The location where the communication service stores its data at rest. - :type data_location: str + :param parameters: Parameters for the create or update operation. + :type parameters: ~communication_service_management_client.models.CommunicationServiceResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -584,9 +555,7 @@ async def begin_create_or_update( raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, communication_service_name=communication_service_name, - location=location, - tags=tags, - data_location=data_location, + parameters=parameters, cls=lambda x,y,z: x, **kwargs ) @@ -606,11 +575,11 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -635,15 +604,15 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -683,8 +652,7 @@ async def begin_delete( Operation to delete a CommunicationService. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str @@ -722,11 +690,11 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -740,7 +708,7 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}'} # type: ignore - async def list_key( + async def list_keys( self, resource_group_name: str, communication_service_name: str, @@ -750,8 +718,7 @@ async def list_key( Get the access keys of the CommunicationService resource. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str @@ -765,15 +732,15 @@ async def list_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" # Construct URL - url = self.list_key.metadata['url'] # type: ignore + url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -800,13 +767,13 @@ async def list_key( return cls(pipeline_response, deserialized, {}) return deserialized - list_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/listKeys'} # type: ignore + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/listKeys'} # type: ignore async def regenerate_key( self, resource_group_name: str, communication_service_name: str, - key_type: Optional[Union[str, "models.KeyType"]] = None, + parameters: "models.RegenerateKeyParameters", **kwargs ) -> "models.CommunicationServiceKeys": """Regenerate Key. @@ -814,14 +781,12 @@ async def regenerate_key( Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str - :param key_type: The keyType to regenerate. Must be either 'primary' or 'secondary'(case- - insensitive). - :type key_type: str or ~communication_service_management_client.models.KeyType + :param parameters: Parameter that describes the Regenerate Key Operation. + :type parameters: ~communication_service_management_client.models.RegenerateKeyParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: CommunicationServiceKeys, or the result of cls(response) :rtype: ~communication_service_management_client.models.CommunicationServiceKeys @@ -832,9 +797,7 @@ async def regenerate_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - parameters = models.RegenerateKeyParameters(key_type=key_type) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -842,8 +805,8 @@ async def regenerate_key( url = self.regenerate_key.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -857,25 +820,18 @@ async def regenerate_key( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if parameters is not None: - body_content = self._serialize.body(parameters, 'RegenerateKeyParameters') - else: - body_content = None + body_content = self._serialize.body(parameters, 'RegenerateKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('CommunicationServiceKeys', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CommunicationServiceKeys', pipeline_response) + deserialized = self._deserialize('CommunicationServiceKeys', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_operation_statuses_operations.py b/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_operation_statuses_operations.py deleted file mode 100644 index bfa993e7b8f..00000000000 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_operation_statuses_operations.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OperationStatusesOperations: - """OperationStatusesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~communication_service_management_client.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def get( - self, - location: str, - operation_id: str, - **kwargs - ) -> "models.OperationStatus": - """Get Operation Status. - - Gets the current status of an async operation. - - :param location: The Azure region. - :type location: str - :param operation_id: The ID of an ongoing async operation. - :type operation_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationStatus, or the result of cls(response) - :rtype: ~communication_service_management_client.models.OperationStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/providers/Microsoft.Communication/locations/{location}/operationStatuses/{operationId}'} # type: ignore diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_operation_operations.py b/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_operations.py similarity index 92% rename from src/communication/azext_communication/vendored_sdks/communication/aio/operations/_operation_operations.py rename to src/communication/azext_communication/vendored_sdks/communication/aio/operations/_operations.py index a9a224fe7d3..cab8774de0c 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_operation_operations.py +++ b/src/communication/azext_communication/vendored_sdks/communication/aio/operations/_operations.py @@ -19,8 +19,8 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class OperationOperations: - """OperationOperations async operations. +class Operations: + """Operations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. @@ -44,22 +44,22 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationList"]: + ) -> AsyncIterable["models.OperationListResult"]: """List Operations. Lists all of the available REST API operations of the Microsoft.Communication provider. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~communication_service_management_client.models.OperationList] + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~communication_service_management_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" def prepare_request(next_link=None): @@ -82,7 +82,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize('OperationListResult', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/_communication_service_operations_async.py b/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/_communication_service_operations_async.py deleted file mode 100644 index d2d126c9d8e..00000000000 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/_communication_service_operations_async.py +++ /dev/null @@ -1,846 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CommunicationServiceOperations: - """CommunicationServiceOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~communication_service_management_client.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def check_name_availability( - self, - type: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ) -> "models.NameAvailability": - """Check Name Availability. - - Checks that the CommunicationService name is valid and is not already in use. - - :param type: The resource type. Should be always - "Microsoft.Communication/CommunicationServices". - :type type: str - :param name: The CommunicationService name to validate. e.g."my-CommunicationService-name- - here". - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NameAvailability, or the result of cls(response) - :rtype: ~communication_service_management_client.models.NameAvailability - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NameAvailability"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - - name_availability_parameters = models.NameAvailabilityParameters(type=type, name=name) - api_version = "2020-08-20-preview" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self.check_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - body_content_kwargs = {} # type: Dict[str, Any] - if name_availability_parameters is not None: - body_content = self._serialize.body(name_availability_parameters, 'NameAvailabilityParameters') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NameAvailability', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Communication/checkNameAvailability'} # type: ignore - - async def link_notification_hub( - self, - resource_group_name: str, - communication_service_name: str, - resource_id: Optional[str] = None, - connection_string: Optional[str] = None, - **kwargs - ) -> "models.LinkedNotificationHub": - """Link Notification Hub. - - Links an Azure Notification Hub to this communication service. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param communication_service_name: The name of the CommunicationService resource. - :type communication_service_name: str - :param resource_id: The resource ID of the notification hub. - :type resource_id: str - :param connection_string: Connection string for the notification hub. - :type connection_string: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LinkedNotificationHub, or the result of cls(response) - :rtype: ~communication_service_management_client.models.LinkedNotificationHub - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LinkedNotificationHub"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - - link_notification_hub_parameters = models.LinkNotificationHubParameters(resource_id=resource_id, connection_string=connection_string) - api_version = "2020-08-20-preview" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self.link_notification_hub.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - body_content_kwargs = {} # type: Dict[str, Any] - if link_notification_hub_parameters is not None: - body_content = self._serialize.body(link_notification_hub_parameters, 'LinkNotificationHubParameters') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LinkedNotificationHub', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - link_notification_hub.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/linkNotificationHub'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.CommunicationServiceResourceList"]: - """List By Subscription. - - Handles requests to list all resources in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CommunicationServiceResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~communication_service_management_client.models.CommunicationServiceResourceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CommunicationServiceResourceList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('CommunicationServiceResourceList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Communication/communicationServices'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.CommunicationServiceResourceList"]: - """List By Resource Group. - - Handles requests to list all resources in a resource group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CommunicationServiceResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~communication_service_management_client.models.CommunicationServiceResourceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CommunicationServiceResourceList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('CommunicationServiceResourceList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices'} # type: ignore - - async def update( - self, - resource_group_name: str, - communication_service_name: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ) -> "models.CommunicationServiceResource": - """Update. - - Operation to update an existing CommunicationService. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param communication_service_name: The name of the CommunicationService resource. - :type communication_service_name: str - :param tags: Tags of the service which is a list of key value pairs that describe the resource. - :type tags: dict[str, str] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunicationServiceResource, or the result of cls(response) - :rtype: ~communication_service_management_client.models.CommunicationServiceResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CommunicationServiceResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - - parameters = models.TaggedResource(tags=tags) - api_version = "2020-08-20-preview" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - body_content_kwargs = {} # type: Dict[str, Any] - if parameters is not None: - body_content = self._serialize.body(parameters, 'TaggedResource') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CommunicationServiceResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - communication_service_name: str, - **kwargs - ) -> "models.CommunicationServiceResource": - """Get. - - Get the CommunicationService and its properties. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param communication_service_name: The name of the CommunicationService resource. - :type communication_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunicationServiceResource, or the result of cls(response) - :rtype: ~communication_service_management_client.models.CommunicationServiceResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CommunicationServiceResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CommunicationServiceResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - communication_service_name: str, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - data_location: Optional[str] = None, - **kwargs - ) -> "models.CommunicationServiceResource": - cls = kwargs.pop('cls', None) # type: ClsType["models.CommunicationServiceResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - - parameters = models.CommunicationServiceResource(location=location, tags=tags, data_location=data_location) - api_version = "2020-08-20-preview" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - body_content_kwargs = {} # type: Dict[str, Any] - if parameters is not None: - body_content = self._serialize.body(parameters, 'CommunicationServiceResource') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CommunicationServiceResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - deserialized = self._deserialize('CommunicationServiceResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - communication_service_name: str, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - data_location: Optional[str] = None, - **kwargs - ) -> AsyncLROPoller["models.CommunicationServiceResource"]: - """Create Or Update. - - Create a new CommunicationService or update an existing CommunicationService. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param communication_service_name: The name of the CommunicationService resource. - :type communication_service_name: str - :param location: The Azure location where the CommunicationService is running. - :type location: str - :param tags: Tags of the service which is a list of key value pairs that describe the resource. - :type tags: dict[str, str] - :param data_location: The location where the communication service stores its data at rest. - :type data_location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CommunicationServiceResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~communication_service_management_client.models.CommunicationServiceResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CommunicationServiceResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - communication_service_name=communication_service_name, - location=location, - tags=tags, - data_location=data_location, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - deserialized = self._deserialize('CommunicationServiceResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - communication_service_name: str, - **kwargs - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['location']=self._deserialize('str', response.headers.get('location')) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - communication_service_name: str, - **kwargs - ) -> AsyncLROPoller[None]: - """Delete. - - Operation to delete a CommunicationService. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param communication_service_name: The name of the CommunicationService resource. - :type communication_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - communication_service_name=communication_service_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}'} # type: ignore - - async def list_key( - self, - resource_group_name: str, - communication_service_name: str, - **kwargs - ) -> "models.CommunicationServiceKeys": - """List Keys. - - Get the access keys of the CommunicationService resource. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param communication_service_name: The name of the CommunicationService resource. - :type communication_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunicationServiceKeys, or the result of cls(response) - :rtype: ~communication_service_management_client.models.CommunicationServiceKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CommunicationServiceKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" - - # Construct URL - url = self.list_key.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CommunicationServiceKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/listKeys'} # type: ignore - - async def regenerate_key( - self, - resource_group_name: str, - communication_service_name: str, - key_type: Optional[Union[str, "models.KeyType"]] = None, - **kwargs - ) -> "models.CommunicationServiceKeys": - """Regenerate Key. - - Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated - at the same time. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param communication_service_name: The name of the CommunicationService resource. - :type communication_service_name: str - :param key_type: The keyType to regenerate. Must be either 'primary' or 'secondary'(case- - insensitive). - :type key_type: str or ~communication_service_management_client.models.KeyType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunicationServiceKeys, or the result of cls(response) - :rtype: ~communication_service_management_client.models.CommunicationServiceKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CommunicationServiceKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - - parameters = models.RegenerateKeyParameters(key_type=key_type) - api_version = "2020-08-20-preview" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self.regenerate_key.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - body_content_kwargs = {} # type: Dict[str, Any] - if parameters is not None: - body_content = self._serialize.body(parameters, 'RegenerateKeyParameters') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CommunicationServiceKeys', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CommunicationServiceKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/regenerateKey'} # type: ignore diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/_operation_operations_async.py b/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/_operation_operations_async.py deleted file mode 100644 index 49f365c3d17..00000000000 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/_operation_operations_async.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OperationOperations: - """OperationOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~communication_service_management_client.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs - ) -> AsyncIterable["models.OperationList"]: - """List Operations. - - Lists all of the available REST API operations of the Microsoft.Communication provider. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~communication_service_management_client.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.Communication/operations'} # type: ignore diff --git a/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/_operation_statuses_operations_async.py b/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/_operation_statuses_operations_async.py deleted file mode 100644 index 7666c4c9f61..00000000000 --- a/src/communication/azext_communication/vendored_sdks/communication/aio/operations_async/_operation_statuses_operations_async.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OperationStatusesOperations: - """OperationStatusesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~communication_service_management_client.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def get( - self, - location: str, - operation_id: str, - **kwargs - ) -> "models.OperationStatus": - """Get Operation Status. - - Gets the current status of an async operation. - - :param location: The Azure region. - :type location: str - :param operation_id: The ID of an ongoing async operation. - :type operation_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationStatus, or the result of cls(response) - :rtype: ~communication_service_management_client.models.OperationStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/providers/Microsoft.Communication/locations/{location}/operationStatuses/{operationId}'} # type: ignore diff --git a/src/communication/azext_communication/vendored_sdks/communication/models/__init__.py b/src/communication/azext_communication/vendored_sdks/communication/models/__init__.py index 9b1c0f734ca..87bc0dedc26 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/models/__init__.py +++ b/src/communication/azext_communication/vendored_sdks/communication/models/__init__.py @@ -10,78 +10,71 @@ from ._models_py3 import CommunicationServiceKeys from ._models_py3 import CommunicationServiceResource from ._models_py3 import CommunicationServiceResourceList - from ._models_py3 import Dimension + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse - from ._models_py3 import ErrorResponseError from ._models_py3 import LinkNotificationHubParameters from ._models_py3 import LinkedNotificationHub from ._models_py3 import LocationResource - from ._models_py3 import MetricSpecification from ._models_py3 import NameAvailability from ._models_py3 import NameAvailabilityParameters from ._models_py3 import Operation from ._models_py3 import OperationDisplay - from ._models_py3 import OperationList - from ._models_py3 import OperationProperties - from ._models_py3 import OperationStatus + from ._models_py3 import OperationListResult from ._models_py3 import RegenerateKeyParameters from ._models_py3 import Resource - from ._models_py3 import ServiceSpecification + from ._models_py3 import SystemData from ._models_py3 import TaggedResource except (SyntaxError, ImportError): from ._models import CommunicationServiceKeys # type: ignore from ._models import CommunicationServiceResource # type: ignore from ._models import CommunicationServiceResourceList # type: ignore - from ._models import Dimension # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore from ._models import ErrorResponse # type: ignore - from ._models import ErrorResponseError # type: ignore from ._models import LinkNotificationHubParameters # type: ignore from ._models import LinkedNotificationHub # type: ignore from ._models import LocationResource # type: ignore - from ._models import MetricSpecification # type: ignore from ._models import NameAvailability # type: ignore from ._models import NameAvailabilityParameters # type: ignore from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import OperationProperties # type: ignore - from ._models import OperationStatus # type: ignore + from ._models import OperationListResult # type: ignore from ._models import RegenerateKeyParameters # type: ignore from ._models import Resource # type: ignore - from ._models import ServiceSpecification # type: ignore + from ._models import SystemData # type: ignore from ._models import TaggedResource # type: ignore from ._communication_service_management_client_enums import ( - AggregationType, + ActionType, + CreatedByType, KeyType, + Origin, ProvisioningState, - Status, ) __all__ = [ 'CommunicationServiceKeys', 'CommunicationServiceResource', 'CommunicationServiceResourceList', - 'Dimension', + 'ErrorAdditionalInfo', + 'ErrorDetail', 'ErrorResponse', - 'ErrorResponseError', 'LinkNotificationHubParameters', 'LinkedNotificationHub', 'LocationResource', - 'MetricSpecification', 'NameAvailability', 'NameAvailabilityParameters', 'Operation', 'OperationDisplay', - 'OperationList', - 'OperationProperties', - 'OperationStatus', + 'OperationListResult', 'RegenerateKeyParameters', 'Resource', - 'ServiceSpecification', + 'SystemData', 'TaggedResource', - 'AggregationType', + 'ActionType', + 'CreatedByType', 'KeyType', + 'Origin', 'ProvisioningState', - 'Status', ] diff --git a/src/communication/azext_communication/vendored_sdks/communication/models/_communication_service_management_client_enums.py b/src/communication/azext_communication/vendored_sdks/communication/models/_communication_service_management_client_enums.py index d7eeddc32d0..6cfd385f1f3 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/models/_communication_service_management_client_enums.py +++ b/src/communication/azext_communication/vendored_sdks/communication/models/_communication_service_management_client_enums.py @@ -26,15 +26,20 @@ def __getattr__(cls, name): raise AttributeError(name) -class AggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The method for aggregating the metric. +class ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. """ - AVERAGE = "Average" - MINIMUM = "Minimum" - MAXIMUM = "Maximum" - TOTAL = "Total" - COUNT = "Count" + INTERNAL = "Internal" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" class KeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). @@ -43,6 +48,15 @@ class KeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PRIMARY = "Primary" SECONDARY = "Secondary" +class Origin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system" + """ + + USER = "user" + SYSTEM = "system" + USER_SYSTEM = "user,system" + class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Provisioning state of the resource. """ @@ -56,14 +70,3 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UPDATING = "Updating" DELETING = "Deleting" MOVING = "Moving" - -class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state of the resource. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - DELETING = "Deleting" - MOVING = "Moving" diff --git a/src/communication/azext_communication/vendored_sdks/communication/models/_models.py b/src/communication/azext_communication/vendored_sdks/communication/models/_models.py index 959f9c5ad2b..8b2d4d4032e 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/models/_models.py +++ b/src/communication/azext_communication/vendored_sdks/communication/models/_models.py @@ -83,15 +83,17 @@ def __init__( class Resource(msrest.serialization.Model): - """The core properties of ARM resources. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the service - e.g. "Microsoft.Communication/CommunicationServices". + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -127,12 +129,16 @@ class CommunicationServiceResource(Resource, LocationResource, TaggedResource): :type tags: dict[str, str] :param location: The Azure location where the CommunicationService is running. :type location: str - :ivar id: Fully qualified resource ID for the resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the service - e.g. "Microsoft.Communication/CommunicationServices". + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~communication_service_management_client.models.SystemData :ivar provisioning_state: Provisioning state of the resource. Possible values include: "Unknown", "Succeeded", "Failed", "Canceled", "Running", "Creating", "Updating", "Deleting", "Moving". @@ -155,6 +161,7 @@ class CommunicationServiceResource(Resource, LocationResource, TaggedResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'host_name': {'readonly': True}, 'notification_hub_id': {'readonly': True}, @@ -168,6 +175,7 @@ class CommunicationServiceResource(Resource, LocationResource, TaggedResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'host_name': {'key': 'properties.hostName', 'type': 'str'}, 'data_location': {'key': 'properties.dataLocation', 'type': 'str'}, @@ -183,6 +191,7 @@ def __init__( super(CommunicationServiceResource, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) self.location = kwargs.get('location', None) + self.system_data = None self.provisioning_state = None self.host_name = None self.data_location = kwargs.get('data_location', None) @@ -193,6 +202,7 @@ def __init__( self.id = None self.name = None self.type = None + self.system_data = None self.provisioning_state = None self.host_name = None self.data_location = kwargs.get('data_location', None) @@ -203,6 +213,7 @@ def __init__( self.id = None self.name = None self.type = None + self.system_data = None self.provisioning_state = None self.host_name = None self.data_location = kwargs.get('data_location', None) @@ -236,78 +247,99 @@ def __init__( self.next_link = kwargs.get('next_link', None) -class Dimension(msrest.serialization.Model): - """Specifications of the Dimension of metrics. +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. - :param name: The public facing name of the dimension. - :type name: str - :param display_name: Localized friendly display name of the dimension. - :type display_name: str - :param internal_name: Name of the dimension as it appears in MDM. - :type internal_name: str - :param to_be_exported_for_shoebox: A Boolean flag indicating whether this dimension should be - included for the shoebox export scenario. - :type to_be_exported_for_shoebox: bool + 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 = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'internal_name': {'key': 'internalName', 'type': 'str'}, - 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__( self, **kwargs ): - super(Dimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.internal_name = kwargs.get('internal_name', None) - self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None -class ErrorResponse(msrest.serialization.Model): - """Error response indicating why the requested operation could not be performed. +class ErrorDetail(msrest.serialization.Model): + """The error detail. - :param error: The error. - :type error: ~communication_service_management_client.models.ErrorResponseError + 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[~communication_service_management_client.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~communication_service_management_client.models.ErrorAdditionalInfo] """ + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__( self, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None -class ErrorResponseError(msrest.serialization.Model): - """The error. +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str + :param error: The error object. + :type error: ~communication_service_management_client.models.ErrorDetail """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__( self, **kwargs ): - super(ErrorResponseError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) class LinkedNotificationHub(msrest.serialization.Model): @@ -359,60 +391,6 @@ def __init__( self.connection_string = kwargs['connection_string'] -class MetricSpecification(msrest.serialization.Model): - """Specifications of the Metrics for Azure Monitoring. - - :param name: Name of the metric. - :type name: str - :param display_name: Localized friendly display name of the metric. - :type display_name: str - :param display_description: Localized friendly description of the metric. - :type display_description: str - :param unit: The unit that makes sense for the metric. - :type unit: str - :param aggregation_type: The method for aggregating the metric. Possible values include: - "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~communication_service_management_client.models.AggregationType - :param fill_gap_with_zero: Optional. If set to true, then zero will be returned for time - duration where no metric is emitted/published. - Ex. a metric that returns the number of times a particular error code was emitted. The error - code may not appear - often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where - nothing was emitted. - :type fill_gap_with_zero: str - :param category: The name of the metric category that the metric belongs to. A metric can only - belong to a single category. - :type category: str - :param dimensions: The dimensions of the metrics. - :type dimensions: list[~communication_service_management_client.models.Dimension] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - } - - def __init__( - self, - **kwargs - ): - super(MetricSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) - self.category = kwargs.get('category', None) - self.dimensions = kwargs.get('dimensions', None) - - class NameAvailability(msrest.serialization.Model): """Result of the request to check name availability. It contains a flag and possible reason of failure. @@ -473,24 +451,40 @@ def __init__( class Operation(msrest.serialization.Model): - """REST API operation supported by CommunicationService resource provider. + """Details of a REST API operation, returned from the Resource Provider Operations API. - :param name: Name of the operation with format: {provider}/{resource}/{operation}. - :type name: str - :param display: The object that describes the operation. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for data- + plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :param display: Localized display information for this particular operation. :type display: ~communication_service_management_client.models.OperationDisplay - :param origin: Optional. The intended executor of the operation; governs the display of the - operation in the RBAC UX and the audit logs UX. - :type origin: str - :param properties: Extra properties for the operation. - :type properties: ~communication_service_management_client.models.OperationProperties + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", + "system", "user,system". + :vartype origin: str or ~communication_service_management_client.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. Possible values include: "Internal". + :vartype action_type: str or ~communication_service_management_client.models.ActionType """ + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'action_type': {'readonly': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OperationProperties'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, } def __init__( @@ -498,25 +492,39 @@ def __init__( **kwargs ): super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = None + self.is_data_action = None self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) + self.origin = None + self.action_type = None class OperationDisplay(msrest.serialization.Model): - """The object that describes a operation. - - :param provider: Friendly name of the resource provider. - :type provider: str - :param resource: Resource type on which the operation is performed. - :type resource: str - :param operation: The localized friendly name for the operation. - :type operation: str - :param description: The localized friendly description for the operation. - :type description: str + """Localized display information for this particular operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str """ + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, @@ -529,105 +537,40 @@ def __init__( **kwargs ): super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class OperationList(msrest.serialization.Model): - """Result of the request to list REST API operations. It contains a list of operations. - - :param value: List of operations supported by the resource provider. - :type value: list[~communication_service_management_client.models.Operation] - :param next_link: The URL the client should use to fetch the next page (per server side - paging). - It's null for now, added for future use. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class OperationProperties(msrest.serialization.Model): - """Extra Operation properties. - - :param service_specification: The service specifications. - :type service_specification: - ~communication_service_management_client.models.ServiceSpecification - """ - - _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationProperties, self).__init__(**kwargs) - self.service_specification = kwargs.get('service_specification', None) + self.provider = None + self.resource = None + self.operation = None + self.description = None -class OperationStatus(msrest.serialization.Model): - """The current status of an async operation. +class OperationListResult(msrest.serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified ID for the operation status. - :vartype id: str - :ivar status: Provisioning state of the resource. Possible values include: "Succeeded", - "Failed", "Canceled", "Creating", "Deleting", "Moving". - :vartype status: str or ~communication_service_management_client.models.Status - :ivar start_time: The start time of the operation. - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time of the operation. - :vartype end_time: ~datetime.datetime - :ivar percent_complete: Percent of the operation that is complete. - :vartype percent_complete: float - :param error: The error. - :type error: ~communication_service_management_client.models.ErrorResponseError + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~communication_service_management_client.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str """ _validation = { - 'id': {'readonly': True}, - 'status': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'percent_complete': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'float'}, - 'error': {'key': 'error.error', 'type': 'ErrorResponseError'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(OperationStatus, self).__init__(**kwargs) - self.id = None - self.status = None - self.start_time = None - self.end_time = None - self.percent_complete = None - self.error = kwargs.get('error', None) + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None class RegenerateKeyParameters(msrest.serialization.Model): @@ -650,21 +593,43 @@ def __init__( self.key_type = kwargs.get('key_type', None) -class ServiceSpecification(msrest.serialization.Model): - """An object that describes a specification. - - :param metric_specifications: Specifications of the Metrics for Azure Monitoring. - :type metric_specifications: - list[~communication_service_management_client.models.MetricSpecification] +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~communication_service_management_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~communication_service_management_client.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime """ _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/communication/azext_communication/vendored_sdks/communication/models/_models_py3.py b/src/communication/azext_communication/vendored_sdks/communication/models/_models_py3.py index 4218612797e..0fc54319e8a 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/models/_models_py3.py +++ b/src/communication/azext_communication/vendored_sdks/communication/models/_models_py3.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError @@ -96,15 +97,17 @@ def __init__( class Resource(msrest.serialization.Model): - """The core properties of ARM resources. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the service - e.g. "Microsoft.Communication/CommunicationServices". + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -140,12 +143,16 @@ class CommunicationServiceResource(Resource, LocationResource, TaggedResource): :type tags: dict[str, str] :param location: The Azure location where the CommunicationService is running. :type location: str - :ivar id: Fully qualified resource ID for the resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the service - e.g. "Microsoft.Communication/CommunicationServices". + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~communication_service_management_client.models.SystemData :ivar provisioning_state: Provisioning state of the resource. Possible values include: "Unknown", "Succeeded", "Failed", "Canceled", "Running", "Creating", "Updating", "Deleting", "Moving". @@ -168,6 +175,7 @@ class CommunicationServiceResource(Resource, LocationResource, TaggedResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'host_name': {'readonly': True}, 'notification_hub_id': {'readonly': True}, @@ -181,6 +189,7 @@ class CommunicationServiceResource(Resource, LocationResource, TaggedResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'host_name': {'key': 'properties.hostName', 'type': 'str'}, 'data_location': {'key': 'properties.dataLocation', 'type': 'str'}, @@ -200,6 +209,7 @@ def __init__( super(CommunicationServiceResource, self).__init__(location=location, tags=tags, **kwargs) self.tags = tags self.location = location + self.system_data = None self.provisioning_state = None self.host_name = None self.data_location = data_location @@ -210,6 +220,7 @@ def __init__( self.id = None self.name = None self.type = None + self.system_data = None self.provisioning_state = None self.host_name = None self.data_location = data_location @@ -220,6 +231,7 @@ def __init__( self.id = None self.name = None self.type = None + self.system_data = None self.provisioning_state = None self.host_name = None self.data_location = data_location @@ -256,88 +268,101 @@ def __init__( self.next_link = next_link -class Dimension(msrest.serialization.Model): - """Specifications of the Dimension of metrics. +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. - :param name: The public facing name of the dimension. - :type name: str - :param display_name: Localized friendly display name of the dimension. - :type display_name: str - :param internal_name: Name of the dimension as it appears in MDM. - :type internal_name: str - :param to_be_exported_for_shoebox: A Boolean flag indicating whether this dimension should be - included for the shoebox export scenario. - :type to_be_exported_for_shoebox: bool + 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 = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'internal_name': {'key': 'internalName', 'type': 'str'}, - 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__( self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - internal_name: Optional[str] = None, - to_be_exported_for_shoebox: Optional[bool] = None, **kwargs ): - super(Dimension, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.internal_name = internal_name - self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None -class ErrorResponse(msrest.serialization.Model): - """Error response indicating why the requested operation could not be performed. +class ErrorDetail(msrest.serialization.Model): + """The error detail. - :param error: The error. - :type error: ~communication_service_management_client.models.ErrorResponseError + 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[~communication_service_management_client.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~communication_service_management_client.models.ErrorAdditionalInfo] """ + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__( self, - *, - error: Optional["ErrorResponseError"] = None, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = error + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None -class ErrorResponseError(msrest.serialization.Model): - """The error. +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str + :param error: The error object. + :type error: ~communication_service_management_client.models.ErrorDetail """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__( self, *, - code: Optional[str] = None, - message: Optional[str] = None, + error: Optional["ErrorDetail"] = None, **kwargs ): - super(ErrorResponseError, self).__init__(**kwargs) - self.code = code - self.message = message + super(ErrorResponse, self).__init__(**kwargs) + self.error = error class LinkedNotificationHub(msrest.serialization.Model): @@ -394,69 +419,6 @@ def __init__( self.connection_string = connection_string -class MetricSpecification(msrest.serialization.Model): - """Specifications of the Metrics for Azure Monitoring. - - :param name: Name of the metric. - :type name: str - :param display_name: Localized friendly display name of the metric. - :type display_name: str - :param display_description: Localized friendly description of the metric. - :type display_description: str - :param unit: The unit that makes sense for the metric. - :type unit: str - :param aggregation_type: The method for aggregating the metric. Possible values include: - "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~communication_service_management_client.models.AggregationType - :param fill_gap_with_zero: Optional. If set to true, then zero will be returned for time - duration where no metric is emitted/published. - Ex. a metric that returns the number of times a particular error code was emitted. The error - code may not appear - often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where - nothing was emitted. - :type fill_gap_with_zero: str - :param category: The name of the metric category that the metric belongs to. A metric can only - belong to a single category. - :type category: str - :param dimensions: The dimensions of the metrics. - :type dimensions: list[~communication_service_management_client.models.Dimension] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - display_description: Optional[str] = None, - unit: Optional[str] = None, - aggregation_type: Optional[Union[str, "AggregationType"]] = None, - fill_gap_with_zero: Optional[str] = None, - category: Optional[str] = None, - dimensions: Optional[List["Dimension"]] = None, - **kwargs - ): - super(MetricSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.dimensions = dimensions - - class NameAvailability(msrest.serialization.Model): """Result of the request to check name availability. It contains a flag and possible reason of failure. @@ -524,55 +486,82 @@ def __init__( class Operation(msrest.serialization.Model): - """REST API operation supported by CommunicationService resource provider. + """Details of a REST API operation, returned from the Resource Provider Operations API. - :param name: Name of the operation with format: {provider}/{resource}/{operation}. - :type name: str - :param display: The object that describes the operation. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for data- + plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :param display: Localized display information for this particular operation. :type display: ~communication_service_management_client.models.OperationDisplay - :param origin: Optional. The intended executor of the operation; governs the display of the - operation in the RBAC UX and the audit logs UX. - :type origin: str - :param properties: Extra properties for the operation. - :type properties: ~communication_service_management_client.models.OperationProperties + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", + "system", "user,system". + :vartype origin: str or ~communication_service_management_client.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. Possible values include: "Internal". + :vartype action_type: str or ~communication_service_management_client.models.ActionType """ + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'action_type': {'readonly': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OperationProperties'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, } def __init__( self, *, - name: Optional[str] = None, display: Optional["OperationDisplay"] = None, - origin: Optional[str] = None, - properties: Optional["OperationProperties"] = None, **kwargs ): super(Operation, self).__init__(**kwargs) - self.name = name + self.name = None + self.is_data_action = None self.display = display - self.origin = origin - self.properties = properties + self.origin = None + self.action_type = None class OperationDisplay(msrest.serialization.Model): - """The object that describes a operation. - - :param provider: Friendly name of the resource provider. - :type provider: str - :param resource: Resource type on which the operation is performed. - :type resource: str - :param operation: The localized friendly name for the operation. - :type operation: str - :param description: The localized friendly description for the operation. - :type description: str + """Localized display information for this particular operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str """ + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, @@ -582,120 +571,43 @@ class OperationDisplay(msrest.serialization.Model): def __init__( self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, **kwargs ): super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class OperationList(msrest.serialization.Model): - """Result of the request to list REST API operations. It contains a list of operations. - - :param value: List of operations supported by the resource provider. - :type value: list[~communication_service_management_client.models.Operation] - :param next_link: The URL the client should use to fetch the next page (per server side - paging). - It's null for now, added for future use. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Operation"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class OperationProperties(msrest.serialization.Model): - """Extra Operation properties. + self.provider = None + self.resource = None + self.operation = None + self.description = None - :param service_specification: The service specifications. - :type service_specification: - ~communication_service_management_client.models.ServiceSpecification - """ - _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__( - self, - *, - service_specification: Optional["ServiceSpecification"] = None, - **kwargs - ): - super(OperationProperties, self).__init__(**kwargs) - self.service_specification = service_specification - - -class OperationStatus(msrest.serialization.Model): - """The current status of an async operation. +class OperationListResult(msrest.serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified ID for the operation status. - :vartype id: str - :ivar status: Provisioning state of the resource. Possible values include: "Succeeded", - "Failed", "Canceled", "Creating", "Deleting", "Moving". - :vartype status: str or ~communication_service_management_client.models.Status - :ivar start_time: The start time of the operation. - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time of the operation. - :vartype end_time: ~datetime.datetime - :ivar percent_complete: Percent of the operation that is complete. - :vartype percent_complete: float - :param error: The error. - :type error: ~communication_service_management_client.models.ErrorResponseError + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~communication_service_management_client.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str """ _validation = { - 'id': {'readonly': True}, - 'status': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'percent_complete': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'float'}, - 'error': {'key': 'error.error', 'type': 'ErrorResponseError'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, - *, - error: Optional["ErrorResponseError"] = None, **kwargs ): - super(OperationStatus, self).__init__(**kwargs) - self.id = None - self.status = None - self.start_time = None - self.end_time = None - self.percent_complete = None - self.error = error + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None class RegenerateKeyParameters(msrest.serialization.Model): @@ -720,23 +632,50 @@ def __init__( self.key_type = key_type -class ServiceSpecification(msrest.serialization.Model): - """An object that describes a specification. - - :param metric_specifications: Specifications of the Metrics for Azure Monitoring. - :type metric_specifications: - list[~communication_service_management_client.models.MetricSpecification] +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~communication_service_management_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~communication_service_management_client.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime """ _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, *, - metric_specifications: Optional[List["MetricSpecification"]] = None, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, **kwargs ): - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = metric_specifications + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/src/communication/azext_communication/vendored_sdks/communication/operations/__init__.py b/src/communication/azext_communication/vendored_sdks/communication/operations/__init__.py index 34e927cfe39..0a595e4791c 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/operations/__init__.py +++ b/src/communication/azext_communication/vendored_sdks/communication/operations/__init__.py @@ -6,12 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._operation_operations import OperationOperations +from ._operations import Operations from ._communication_service_operations import CommunicationServiceOperations -from ._operation_statuses_operations import OperationStatusesOperations __all__ = [ - 'OperationOperations', + 'Operations', 'CommunicationServiceOperations', - 'OperationStatusesOperations', ] diff --git a/src/communication/azext_communication/vendored_sdks/communication/operations/_communication_service_operations.py b/src/communication/azext_communication/vendored_sdks/communication/operations/_communication_service_operations.py index d7d1ac8d71f..fe42efc70c1 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/operations/_communication_service_operations.py +++ b/src/communication/azext_communication/vendored_sdks/communication/operations/_communication_service_operations.py @@ -49,8 +49,7 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - type=None, # type: Optional[str] - name=None, # type: Optional[str] + name_availability_parameters=None, # type: Optional["models.NameAvailabilityParameters"] **kwargs # type: Any ): # type: (...) -> "models.NameAvailability" @@ -58,12 +57,8 @@ def check_name_availability( Checks that the CommunicationService name is valid and is not already in use. - :param type: The resource type. Should be always - "Microsoft.Communication/CommunicationServices". - :type type: str - :param name: The CommunicationService name to validate. e.g."my-CommunicationService-name- - here". - :type name: str + :param name_availability_parameters: Parameters supplied to the operation. + :type name_availability_parameters: ~communication_service_management_client.models.NameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability, or the result of cls(response) :rtype: ~communication_service_management_client.models.NameAvailability @@ -74,9 +69,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - name_availability_parameters = models.NameAvailabilityParameters(type=type, name=name) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -123,8 +116,7 @@ def link_notification_hub( self, resource_group_name, # type: str communication_service_name, # type: str - resource_id=None, # type: Optional[str] - connection_string=None, # type: Optional[str] + link_notification_hub_parameters=None, # type: Optional["models.LinkNotificationHubParameters"] **kwargs # type: Any ): # type: (...) -> "models.LinkedNotificationHub" @@ -132,15 +124,12 @@ def link_notification_hub( Links an Azure Notification Hub to this communication service. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str - :param resource_id: The resource ID of the notification hub. - :type resource_id: str - :param connection_string: Connection string for the notification hub. - :type connection_string: str + :param link_notification_hub_parameters: Parameters supplied to the operation. + :type link_notification_hub_parameters: ~communication_service_management_client.models.LinkNotificationHubParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: LinkedNotificationHub, or the result of cls(response) :rtype: ~communication_service_management_client.models.LinkedNotificationHub @@ -151,9 +140,7 @@ def link_notification_hub( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - link_notification_hub_parameters = models.LinkNotificationHubParameters(resource_id=resource_id, connection_string=connection_string) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -161,8 +148,8 @@ def link_notification_hub( url = self.link_notification_hub.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -217,7 +204,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" def prepare_request(next_link=None): @@ -278,8 +265,7 @@ def list_by_resource_group( Handles requests to list all resources in a resource group. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CommunicationServiceResourceList or the result of cls(response) @@ -291,7 +277,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" def prepare_request(next_link=None): @@ -304,7 +290,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -347,7 +333,7 @@ def update( self, resource_group_name, # type: str communication_service_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + parameters=None, # type: Optional["models.CommunicationServiceResource"] **kwargs # type: Any ): # type: (...) -> "models.CommunicationServiceResource" @@ -355,13 +341,12 @@ def update( Operation to update an existing CommunicationService. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str - :param tags: Tags of the service which is a list of key value pairs that describe the resource. - :type tags: dict[str, str] + :param parameters: Parameters for the update operation. + :type parameters: ~communication_service_management_client.models.CommunicationServiceResource :keyword callable cls: A custom type or function that will be passed the direct response :return: CommunicationServiceResource, or the result of cls(response) :rtype: ~communication_service_management_client.models.CommunicationServiceResource @@ -372,9 +357,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - parameters = models.TaggedResource(tags=tags) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -382,8 +365,8 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -398,7 +381,7 @@ def update( body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: - body_content = self._serialize.body(parameters, 'TaggedResource') + body_content = self._serialize.body(parameters, 'CommunicationServiceResource') else: body_content = None body_content_kwargs['content'] = body_content @@ -430,8 +413,7 @@ def get( Get the CommunicationService and its properties. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str @@ -445,15 +427,15 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -486,9 +468,7 @@ def _create_or_update_initial( self, resource_group_name, # type: str communication_service_name, # type: str - location=None, # type: Optional[str] - tags=None, # type: Optional[Dict[str, str]] - data_location=None, # type: Optional[str] + parameters=None, # type: Optional["models.CommunicationServiceResource"] **kwargs # type: Any ): # type: (...) -> "models.CommunicationServiceResource" @@ -497,9 +477,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - parameters = models.CommunicationServiceResource(location=location, tags=tags, data_location=data_location) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -507,8 +485,8 @@ def _create_or_update_initial( url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -554,9 +532,7 @@ def begin_create_or_update( self, resource_group_name, # type: str communication_service_name, # type: str - location=None, # type: Optional[str] - tags=None, # type: Optional[Dict[str, str]] - data_location=None, # type: Optional[str] + parameters=None, # type: Optional["models.CommunicationServiceResource"] **kwargs # type: Any ): # type: (...) -> LROPoller["models.CommunicationServiceResource"] @@ -564,17 +540,12 @@ def begin_create_or_update( Create a new CommunicationService or update an existing CommunicationService. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str - :param location: The Azure location where the CommunicationService is running. - :type location: str - :param tags: Tags of the service which is a list of key value pairs that describe the resource. - :type tags: dict[str, str] - :param data_location: The location where the communication service stores its data at rest. - :type data_location: str + :param parameters: Parameters for the create or update operation. + :type parameters: ~communication_service_management_client.models.CommunicationServiceResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -596,9 +567,7 @@ def begin_create_or_update( raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, communication_service_name=communication_service_name, - location=location, - tags=tags, - data_location=data_location, + parameters=parameters, cls=lambda x,y,z: x, **kwargs ) @@ -618,11 +587,11 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -648,15 +617,15 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -697,8 +666,7 @@ def begin_delete( Operation to delete a CommunicationService. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str @@ -736,11 +704,11 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -754,7 +722,7 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}'} # type: ignore - def list_key( + def list_keys( self, resource_group_name, # type: str communication_service_name, # type: str @@ -765,8 +733,7 @@ def list_key( Get the access keys of the CommunicationService resource. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str @@ -780,15 +747,15 @@ def list_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" # Construct URL - url = self.list_key.metadata['url'] # type: ignore + url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -815,13 +782,13 @@ def list_key( return cls(pipeline_response, deserialized, {}) return deserialized - list_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/listKeys'} # type: ignore + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/listKeys'} # type: ignore def regenerate_key( self, resource_group_name, # type: str communication_service_name, # type: str - key_type=None, # type: Optional[Union[str, "models.KeyType"]] + parameters, # type: "models.RegenerateKeyParameters" **kwargs # type: Any ): # type: (...) -> "models.CommunicationServiceKeys" @@ -830,14 +797,12 @@ def regenerate_key( Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param communication_service_name: The name of the CommunicationService resource. :type communication_service_name: str - :param key_type: The keyType to regenerate. Must be either 'primary' or 'secondary'(case- - insensitive). - :type key_type: str or ~communication_service_management_client.models.KeyType + :param parameters: Parameter that describes the Regenerate Key Operation. + :type parameters: ~communication_service_management_client.models.RegenerateKeyParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: CommunicationServiceKeys, or the result of cls(response) :rtype: ~communication_service_management_client.models.CommunicationServiceKeys @@ -848,9 +813,7 @@ def regenerate_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - parameters = models.RegenerateKeyParameters(key_type=key_type) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -858,8 +821,8 @@ def regenerate_key( url = self.regenerate_key.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -873,25 +836,18 @@ def regenerate_key( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if parameters is not None: - body_content = self._serialize.body(parameters, 'RegenerateKeyParameters') - else: - body_content = None + body_content = self._serialize.body(parameters, 'RegenerateKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('CommunicationServiceKeys', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CommunicationServiceKeys', pipeline_response) + deserialized = self._deserialize('CommunicationServiceKeys', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/src/communication/azext_communication/vendored_sdks/communication/operations/_operation_statuses_operations.py b/src/communication/azext_communication/vendored_sdks/communication/operations/_operation_statuses_operations.py deleted file mode 100644 index 9e3f99b57d1..00000000000 --- a/src/communication/azext_communication/vendored_sdks/communication/operations/_operation_statuses_operations.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class OperationStatusesOperations(object): - """OperationStatusesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~communication_service_management_client.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - location, # type: str - operation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.OperationStatus" - """Get Operation Status. - - Gets the current status of an async operation. - - :param location: The Azure region. - :type location: str - :param operation_id: The ID of an ongoing async operation. - :type operation_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationStatus, or the result of cls(response) - :rtype: ~communication_service_management_client.models.OperationStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/providers/Microsoft.Communication/locations/{location}/operationStatuses/{operationId}'} # type: ignore diff --git a/src/communication/azext_communication/vendored_sdks/communication/operations/_operation_operations.py b/src/communication/azext_communication/vendored_sdks/communication/operations/_operations.py similarity index 92% rename from src/communication/azext_communication/vendored_sdks/communication/operations/_operation_operations.py rename to src/communication/azext_communication/vendored_sdks/communication/operations/_operations.py index 060096b89f9..703916fa8c0 100644 --- a/src/communication/azext_communication/vendored_sdks/communication/operations/_operation_operations.py +++ b/src/communication/azext_communication/vendored_sdks/communication/operations/_operations.py @@ -23,8 +23,8 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -class OperationOperations(object): - """OperationOperations operations. +class Operations(object): + """Operations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. @@ -49,22 +49,22 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationList"] + # type: (...) -> Iterable["models.OperationListResult"] """List Operations. Lists all of the available REST API operations of the Microsoft.Communication provider. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~communication_service_management_client.models.OperationList] + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~communication_service_management_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-20-preview" + api_version = "2020-08-20" accept = "application/json" def prepare_request(next_link=None): @@ -87,7 +87,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize('OperationListResult', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) diff --git a/src/communication/gen.zip b/src/communication/gen.zip index fcc0ccb6fe7..6ba8b2791c4 100644 Binary files a/src/communication/gen.zip and b/src/communication/gen.zip differ diff --git a/src/communication/report.md b/src/communication/report.md index f808e8de323..095e6ddbed3 100644 --- a/src/communication/report.md +++ b/src/communication/report.md @@ -10,7 +10,6 @@ |CLI Command Group|Group Swagger name|Commands| |---------|------------|--------| |az communication|CommunicationService|[commands](#CommandsInCommunicationService)| -|az communication|OperationStatuses|[commands](#CommandsInOperationStatuses)| ## COMMANDS ### Commands in `az communication` group @@ -26,11 +25,6 @@ |[az communication list-key](#CommunicationServiceListKeys)|ListKeys|[Parameters](#ParametersCommunicationServiceListKeys)|[Example](#ExamplesCommunicationServiceListKeys)| |[az communication regenerate-key](#CommunicationServiceRegenerateKey)|RegenerateKey|[Parameters](#ParametersCommunicationServiceRegenerateKey)|[Example](#ExamplesCommunicationServiceRegenerateKey)| -### Commands in `az communication` group -|CLI Command|Operation Swagger name|Parameters|Examples| -|---------|------------|--------|-----------| -|[az communication show-status](#OperationStatusesGet)|Get|[Parameters](#ParametersOperationStatusesGet)|[Example](#ExamplesOperationStatusesGet)| - ## COMMAND DETAILS @@ -44,7 +38,7 @@ az communication list --resource-group "MyResourceGroup" ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| #### Command `az communication list` @@ -64,7 +58,7 @@ az communication show --name "MyCommunicationResource" --resource-group "MyResou ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--name**|string|The name of the CommunicationService resource.|name|communicationServiceName| #### Command `az communication create` @@ -77,7 +71,7 @@ az communication create --name "MyCommunicationResource" --location "Global" --d ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--name**|string|The name of the CommunicationService resource.|name|communicationServiceName| |**--location**|string|The Azure location where the CommunicationService is running.|location|location| |**--tags**|dictionary|Tags of the service which is a list of key value pairs that describe the resource.|tags|tags| @@ -92,9 +86,11 @@ az communication update --name "MyCommunicationResource" --tags newTag="newVal" ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--name**|string|The name of the CommunicationService resource.|name|communicationServiceName| +|**--location**|string|The Azure location where the CommunicationService is running.|location|location| |**--tags**|dictionary|Tags of the service which is a list of key value pairs that describe the resource.|tags|tags| +|**--data-location**|string|The location where the communication service stores its data at rest.|data_location|dataLocation| #### Command `az communication delete` @@ -105,7 +101,7 @@ az communication delete --name "MyCommunicationResource" --resource-group "MyRes ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--name**|string|The name of the CommunicationService resource.|name|communicationServiceName| #### Command `az communication link-notification-hub` @@ -120,7 +116,7 @@ otificationHubs/MyHub" --resource-group "MyResourceGroup" ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--name**|string|The name of the CommunicationService resource.|name|communicationServiceName| |**--resource-id**|string|The resource ID of the notification hub|resource_id|resourceId| |**--connection-string**|string|Connection string for the notification hub|connection_string|connectionString| @@ -134,7 +130,7 @@ az communication list-key --name "MyCommunicationResource" --resource-group "MyR ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--name**|string|The name of the CommunicationService resource.|name|communicationServiceName| #### Command `az communication regenerate-key` @@ -147,19 +143,6 @@ az communication regenerate-key --name "MyCommunicationResource" --key-type "Pri ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--name**|string|The name of the CommunicationService resource.|name|communicationServiceName| |**--key-type**|sealed-choice|The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive).|key_type|keyType| - -### group `az communication` -#### Command `az communication show-status` - -##### Example -``` -az communication show-status --operation-id "db5f291f-284d-46e9-9152-d5c83f7c14b8" --location "westus2" -``` -##### Parameters -|Option|Type|Description|Path (SDK)|Swagger name| -|------|----|-----------|----------|------------| -|**--location**|string|The Azure region|location|location| -|**--operation-id**|string|The ID of an ongoing async operation|operation_id|operationId| diff --git a/src/communication/setup.py b/src/communication/setup.py index 3b81fdb71de..7e24df948cb 100644 --- a/src/communication/setup.py +++ b/src/communication/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # HISTORY.rst entry. -VERSION = '0.1.0' +VERSION = '1.0.0' try: from azext_communication.manual.version import VERSION except ImportError: