# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft 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.cosmosdb import CosmosDBManagementClient

from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy

AZURE_LOCATION = "eastus"


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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_get_cassandra_keyspace_throughput(self, resource_group):
        response = self.client.cassandra_resources.get_cassandra_keyspace_throughput(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
        )

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_update_cassandra_keyspace_throughput(self, resource_group):
        response = self.client.cassandra_resources.begin_update_cassandra_keyspace_throughput(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            update_throughput_parameters={
                "properties": {
                    "resource": {
                        "autoscaleSettings": {
                            "maxThroughput": 0,
                            "autoUpgradePolicy": {"throughputPolicy": {"incrementPercent": 0, "isEnabled": bool}},
                            "targetMaxThroughput": 0,
                        },
                        "instantMaximumThroughput": "str",
                        "minimumThroughput": "str",
                        "offerReplacePending": "str",
                        "softAllowedMaximumThroughput": "str",
                        "throughput": 0,
                        "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0, "isDefaultBucket": bool}],
                    }
                },
                "id": "str",
                "identity": {
                    "principalId": "str",
                    "tenantId": "str",
                    "type": "str",
                    "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
                },
                "location": "str",
                "name": "str",
                "tags": {"str": "str"},
                "type": "str",
            },
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_migrate_cassandra_keyspace_to_autoscale(self, resource_group):
        response = self.client.cassandra_resources.begin_migrate_cassandra_keyspace_to_autoscale(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_migrate_cassandra_keyspace_to_manual_throughput(self, resource_group):
        response = self.client.cassandra_resources.begin_migrate_cassandra_keyspace_to_manual_throughput(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_get_cassandra_table_throughput(self, resource_group):
        response = self.client.cassandra_resources.get_cassandra_table_throughput(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            table_name="str",
        )

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_update_cassandra_table_throughput(self, resource_group):
        response = self.client.cassandra_resources.begin_update_cassandra_table_throughput(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            table_name="str",
            update_throughput_parameters={
                "properties": {
                    "resource": {
                        "autoscaleSettings": {
                            "maxThroughput": 0,
                            "autoUpgradePolicy": {"throughputPolicy": {"incrementPercent": 0, "isEnabled": bool}},
                            "targetMaxThroughput": 0,
                        },
                        "instantMaximumThroughput": "str",
                        "minimumThroughput": "str",
                        "offerReplacePending": "str",
                        "softAllowedMaximumThroughput": "str",
                        "throughput": 0,
                        "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0, "isDefaultBucket": bool}],
                    }
                },
                "id": "str",
                "identity": {
                    "principalId": "str",
                    "tenantId": "str",
                    "type": "str",
                    "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
                },
                "location": "str",
                "name": "str",
                "tags": {"str": "str"},
                "type": "str",
            },
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_migrate_cassandra_table_to_autoscale(self, resource_group):
        response = self.client.cassandra_resources.begin_migrate_cassandra_table_to_autoscale(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            table_name="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_migrate_cassandra_table_to_manual_throughput(self, resource_group):
        response = self.client.cassandra_resources.begin_migrate_cassandra_table_to_manual_throughput(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            table_name="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_get_cassandra_view_throughput(self, resource_group):
        response = self.client.cassandra_resources.get_cassandra_view_throughput(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            view_name="str",
        )

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_update_cassandra_view_throughput(self, resource_group):
        response = self.client.cassandra_resources.begin_update_cassandra_view_throughput(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            view_name="str",
            update_throughput_parameters={
                "properties": {
                    "resource": {
                        "autoscaleSettings": {
                            "maxThroughput": 0,
                            "autoUpgradePolicy": {"throughputPolicy": {"incrementPercent": 0, "isEnabled": bool}},
                            "targetMaxThroughput": 0,
                        },
                        "instantMaximumThroughput": "str",
                        "minimumThroughput": "str",
                        "offerReplacePending": "str",
                        "softAllowedMaximumThroughput": "str",
                        "throughput": 0,
                        "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0, "isDefaultBucket": bool}],
                    }
                },
                "id": "str",
                "identity": {
                    "principalId": "str",
                    "tenantId": "str",
                    "type": "str",
                    "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
                },
                "location": "str",
                "name": "str",
                "tags": {"str": "str"},
                "type": "str",
            },
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_migrate_cassandra_view_to_autoscale(self, resource_group):
        response = self.client.cassandra_resources.begin_migrate_cassandra_view_to_autoscale(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            view_name="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_migrate_cassandra_view_to_manual_throughput(self, resource_group):
        response = self.client.cassandra_resources.begin_migrate_cassandra_view_to_manual_throughput(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            view_name="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_get_cassandra_keyspace(self, resource_group):
        response = self.client.cassandra_resources.get_cassandra_keyspace(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
        )

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_create_update_cassandra_keyspace(self, resource_group):
        response = self.client.cassandra_resources.begin_create_update_cassandra_keyspace(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            create_update_cassandra_keyspace_parameters={
                "properties": {
                    "resource": {"id": "str"},
                    "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0},
                },
                "id": "str",
                "identity": {
                    "principalId": "str",
                    "tenantId": "str",
                    "type": "str",
                    "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
                },
                "location": "str",
                "name": "str",
                "tags": {"str": "str"},
                "type": "str",
            },
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_delete_cassandra_keyspace(self, resource_group):
        response = self.client.cassandra_resources.begin_delete_cassandra_keyspace(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_list_cassandra_keyspaces(self, resource_group):
        response = self.client.cassandra_resources.list_cassandra_keyspaces(
            resource_group_name=resource_group.name,
            account_name="str",
        )
        result = [r for r in response]
        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_get_cassandra_table(self, resource_group):
        response = self.client.cassandra_resources.get_cassandra_table(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            table_name="str",
        )

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_create_update_cassandra_table(self, resource_group):
        response = self.client.cassandra_resources.begin_create_update_cassandra_table(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            table_name="str",
            create_update_cassandra_table_parameters={
                "properties": {
                    "resource": {
                        "id": "str",
                        "analyticalStorageTtl": 0,
                        "defaultTtl": 0,
                        "schema": {
                            "clusterKeys": [{"name": "str", "orderBy": "str"}],
                            "columns": [{"name": "str", "type": "str"}],
                            "partitionKeys": [{"name": "str"}],
                        },
                    },
                    "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0},
                },
                "id": "str",
                "identity": {
                    "principalId": "str",
                    "tenantId": "str",
                    "type": "str",
                    "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
                },
                "location": "str",
                "name": "str",
                "tags": {"str": "str"},
                "type": "str",
            },
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_delete_cassandra_table(self, resource_group):
        response = self.client.cassandra_resources.begin_delete_cassandra_table(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            table_name="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_list_cassandra_tables(self, resource_group):
        response = self.client.cassandra_resources.list_cassandra_tables(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
        )
        result = [r for r in response]
        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_get_cassandra_view(self, resource_group):
        response = self.client.cassandra_resources.get_cassandra_view(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            view_name="str",
        )

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_create_update_cassandra_view(self, resource_group):
        response = self.client.cassandra_resources.begin_create_update_cassandra_view(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            view_name="str",
            create_update_cassandra_view_parameters={
                "properties": {
                    "resource": {"id": "str", "viewDefinition": "str"},
                    "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0},
                },
                "id": "str",
                "identity": {
                    "principalId": "str",
                    "tenantId": "str",
                    "type": "str",
                    "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
                },
                "location": "str",
                "name": "str",
                "tags": {"str": "str"},
                "type": "str",
            },
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_delete_cassandra_view(self, resource_group):
        response = self.client.cassandra_resources.begin_delete_cassandra_view(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
            view_name="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_list_cassandra_views(self, resource_group):
        response = self.client.cassandra_resources.list_cassandra_views(
            resource_group_name=resource_group.name,
            account_name="str",
            keyspace_name="str",
        )
        result = [r for r in response]
        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_get_cassandra_role_definition(self, resource_group):
        response = self.client.cassandra_resources.get_cassandra_role_definition(
            resource_group_name=resource_group.name,
            account_name="str",
            role_definition_id="str",
        )

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_create_update_cassandra_role_definition(self, resource_group):
        response = self.client.cassandra_resources.begin_create_update_cassandra_role_definition(
            resource_group_name=resource_group.name,
            account_name="str",
            role_definition_id="str",
            create_update_cassandra_role_definition_parameters={
                "id": "str",
                "name": "str",
                "properties": {
                    "assignableScopes": ["str"],
                    "id": "str",
                    "permissions": [{"dataActions": ["str"], "id": "str", "notDataActions": ["str"]}],
                    "roleName": "str",
                    "type": "str",
                },
                "systemData": {
                    "createdAt": "2020-02-20 00:00:00",
                    "createdBy": "str",
                    "createdByType": "str",
                    "lastModifiedAt": "2020-02-20 00:00:00",
                    "lastModifiedBy": "str",
                    "lastModifiedByType": "str",
                },
                "type": "str",
            },
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_delete_cassandra_role_definition(self, resource_group):
        response = self.client.cassandra_resources.begin_delete_cassandra_role_definition(
            resource_group_name=resource_group.name,
            account_name="str",
            role_definition_id="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_list_cassandra_role_definitions(self, resource_group):
        response = self.client.cassandra_resources.list_cassandra_role_definitions(
            resource_group_name=resource_group.name,
            account_name="str",
        )
        result = [r for r in response]
        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_get_cassandra_role_assignment(self, resource_group):
        response = self.client.cassandra_resources.get_cassandra_role_assignment(
            resource_group_name=resource_group.name,
            account_name="str",
            role_assignment_id="str",
        )

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_create_update_cassandra_role_assignment(self, resource_group):
        response = self.client.cassandra_resources.begin_create_update_cassandra_role_assignment(
            resource_group_name=resource_group.name,
            account_name="str",
            role_assignment_id="str",
            create_update_cassandra_role_assignment_parameters={
                "id": "str",
                "name": "str",
                "properties": {
                    "principalId": "str",
                    "provisioningState": "str",
                    "roleDefinitionId": "str",
                    "scope": "str",
                },
                "systemData": {
                    "createdAt": "2020-02-20 00:00:00",
                    "createdBy": "str",
                    "createdByType": "str",
                    "lastModifiedAt": "2020-02-20 00:00:00",
                    "lastModifiedBy": "str",
                    "lastModifiedByType": "str",
                },
                "type": "str",
            },
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_begin_delete_cassandra_role_assignment(self, resource_group):
        response = self.client.cassandra_resources.begin_delete_cassandra_role_assignment(
            resource_group_name=resource_group.name,
            account_name="str",
            role_assignment_id="str",
        ).result()  # call '.result()' to poll until service return final result

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

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_cassandra_resources_list_cassandra_role_assignments(self, resource_group):
        response = self.client.cassandra_resources.list_cassandra_role_assignments(
            resource_group_name=resource_group.name,
            account_name="str",
        )
        result = [r for r in response]
        # please add some check logic here by yourself
        # ...
