# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=unused-argument

from .. import try_manual


# EXAMPLE: /DomainServices/put/Create Domain Service
@try_manual
def step_ds_create(test, rg_2, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az ad ds create '
             '--domain "{myDomainService}" '
             '--replica-sets location="West US" subnet-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi'
             'ders/Microsoft.Network/virtualNetworks/{vn}/subnets/default" '
             '--name "{myDomainService}" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DomainServices/get/Get Domain Service
@try_manual
def step_ds_show(test, rg_2, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az ad ds show '
             '--name "{myDomainService}" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DomainServices/get/List Domain Service By Group
@try_manual
def step_ds_list(test, rg_2, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az ad ds list '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DomainServices/get/List Domain Service By Sub
@try_manual
def step_ds_list2(test, rg_2, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az ad ds list '
             '-g ""',
             checks=checks)


# EXAMPLE: /DomainServices/patch/Update Domain Service
@try_manual
def step_ds_update(test, rg_2, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az ad ds update '
             '--replica-sets location="West US" subnet-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi'
             'ders/Microsoft.Network/virtualNetworks/{vn}/subnets/default" '
             '--replica-sets location="West US" subnet-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi'
             'ders/Microsoft.Network/virtualNetworks/{vn_2}/subnets/default" '
             '--name "{myDomainService}" '
             '--resource-group "{rg}"',
             checks=checks)


@try_manual
def step_ds_update_security_settings(test, rg_2, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az ad ds update '
             '--ntlm-v1 Disabled '
             '--name "{myDomainService}" '
             '--resource-group "{rg}"',
             checks=checks)


@try_manual
def step_ds_update_notification_settings(test, rg_2, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az ad ds update '
             '--notify-others "jicha@microsoft.com" "caalmont@microsoft.com" '
             '--name "{myDomainService}" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DomainServices/delete/Delete Domain Service
@try_manual
def step_ds_delete(test, rg_2, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az ad ds delete -y '
             '--name "{myDomainService}" '
             '--resource-group "{rg}"',
             checks=checks)
