# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.apimanagement.aio import ApiManagementClient

from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
from devtools_testutils.aio import recorded_by_proxy_async

AZURE_LOCATION = "eastus"


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestApiManagementSubscriptionOperationsAsync(AzureMgmtRecordedTestCase):
    def setup_method(self, method):
        self.client = self.create_mgmt_client(ApiManagementClient, is_async=True)

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy_async
    async def test_subscription_get(self, resource_group):
        response = await self.client.subscription.get(
            resource_group_name=resource_group.name,
            service_name="str",
            sid="str",
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy_async
    async def test_subscription_get_entity_tag(self, resource_group):
        response = await self.client.subscription.get_entity_tag(
            resource_group_name=resource_group.name,
            service_name="str",
            sid="str",
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy_async
    async def test_subscription_create_or_update(self, resource_group):
        response = await self.client.subscription.create_or_update(
            resource_group_name=resource_group.name,
            service_name="str",
            sid="str",
            parameters={
                "properties": {
                    "displayName": "str",
                    "scope": "str",
                    "allowTracing": bool,
                    "ownerId": "str",
                    "primaryKey": "str",
                    "secondaryKey": "str",
                    "state": "str",
                }
            },
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy_async
    async def test_subscription_update(self, resource_group):
        response = await self.client.subscription.update(
            resource_group_name=resource_group.name,
            service_name="str",
            sid="str",
            parameters={
                "properties": {
                    "allowTracing": bool,
                    "displayName": "str",
                    "expirationDate": "2020-02-20 00:00:00",
                    "ownerId": "str",
                    "primaryKey": "str",
                    "scope": "str",
                    "secondaryKey": "str",
                    "state": "str",
                    "stateComment": "str",
                }
            },
            etag="str",
            match_condition=~azure.core.MatchConditions,
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy_async
    async def test_subscription_delete(self, resource_group):
        response = await self.client.subscription.delete(
            resource_group_name=resource_group.name,
            service_name="str",
            sid="str",
            etag="str",
            match_condition=~azure.core.MatchConditions,
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy_async
    async def test_subscription_list(self, resource_group):
        response = self.client.subscription.list(
            resource_group_name=resource_group.name,
            service_name="str",
        )
        result = [r async for r in response]
        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy_async
    async def test_subscription_regenerate_primary_key(self, resource_group):
        response = await self.client.subscription.regenerate_primary_key(
            resource_group_name=resource_group.name,
            service_name="str",
            sid="str",
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy_async
    async def test_subscription_regenerate_secondary_key(self, resource_group):
        response = await self.client.subscription.regenerate_secondary_key(
            resource_group_name=resource_group.name,
            service_name="str",
            sid="str",
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy_async
    async def test_subscription_list_secrets(self, resource_group):
        response = await self.client.subscription.list_secrets(
            resource_group_name=resource_group.name,
            service_name="str",
            sid="str",
        )

        # please add some check logic here by yourself
        # ...
