# --------------------------------------------------------------------------
# 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 .. import try_manual


# EXAMPLE: /DedicatedHsm/put/Create a new or update an existing dedicated HSM
@try_manual
def step_dedicated_hsm_create(test, checks=None):
    if checks is None:
        checks = []
    test.cmd('az hardware-security-modules dedicated-hsm create '
             '--name "hsm1" '
             '--location "westus" '
             '--network-profile-network-interfaces private-ip-address="1.0.0.1" '
             '--api-entity-reference-subnet id="/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsof'
             't.Network/virtualNetworks/{vn}/subnets/{subnets}" '
             '--stamp-id "{vn}" '
             '--sku-name "SafeNet Luna Network HSM A790" '
             '--tags Dept="hsm" Environment="dogfood" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DedicatedHsm/put/Create a new or update an existing payment HSM
@try_manual
def step_dedicated_hsm_create2(test, checks=None):
    if checks is None:
        checks = []
    test.cmd('az hardware-security-modules dedicated-hsm create '
             '--name "hsm1" '
             '--location "westus" '
             '--network-profile-network-interfaces private-ip-address="1.0.0.1" '
             '--api-entity-reference-subnet id="/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsof'
             't.Network/virtualNetworks/{vn}/subnets/{subnets}" '
             '--stamp-id "{vn}" '
             '--sku-name "payShield10K_LMK1_CPS60" '
             '--tags Dept="hsm" Environment="dogfood" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DedicatedHsm/put/Create a new or update an existing payment HSM with management profile
@try_manual
def step_dedicated_hsm_create3(test, checks=None):
    if checks is None:
        checks = []
    test.cmd('az hardware-security-modules dedicated-hsm create '
             '--name "hsm1" '
             '--location "westus" '
             '--network-interfaces private-ip-address="1.0.0.2" '
             '--subnet id="/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Network/virtualNetw'
             'orks/{vn}/subnets/{subnets}" '
             '--network-profile-network-interfaces private-ip-address="1.0.0.1" '
             '--api-entity-reference-subnet id="/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsof'
             't.Network/virtualNetworks/{vn}/subnets/{subnets}" '
             '--stamp-id "{vn}" '
             '--sku-name "payShield10K_LMK1_CPS60" '
             '--tags Dept="hsm" Environment="dogfood" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DedicatedHsm/get/Get a dedicated HSM
@try_manual
def step_dedicated_hsm_show(test, checks=None):
    if checks is None:
        checks = []
    test.cmd('az hardware-security-modules dedicated-hsm show '
             '--name "hsm1" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DedicatedHsm/get/Get a payment HSM
@try_manual
def step_dedicated_hsm_show2(test, checks=None):
    return step_dedicated_hsm_show(test, checks)


# EXAMPLE: /DedicatedHsm/get/Get a payment HSM with 2018-10-31Preview api version
@try_manual
def step_dedicated_hsm_show3(test, checks=None):
    return step_dedicated_hsm_show(test, checks)


# EXAMPLE: /DedicatedHsm/get/List dedicated HSM devices in a resource group
@try_manual
def step_dedicated_hsm_list(test, checks=None):
    if checks is None:
        checks = []
    test.cmd('az hardware-security-modules dedicated-hsm list '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DedicatedHsm/get/List dedicated HSM devices in a resource group including payment HSM
@try_manual
def step_dedicated_hsm_list2(test, checks=None):
    return step_dedicated_hsm_list(test, checks)


# EXAMPLE: /DedicatedHsm/get/List dedicated HSM devices in a subscription
@try_manual
def step_dedicated_hsm_list3(test, checks=None):
    if checks is None:
        checks = []
    test.cmd('az hardware-security-modules dedicated-hsm list '
             '-g ""',
             checks=checks)


# EXAMPLE: /DedicatedHsm/get/List dedicated HSM devices in a subscription including payment HSM
@try_manual
def step_dedicated_hsm_list4(test, checks=None):
    return step_dedicated_hsm_list3(test, checks)


# EXAMPLE: /DedicatedHsm/get/List OutboundNetworkDependenciesEndpoints by Managed Cluster
@try_manual
def step_dedicated_hsm_list5(test, checks=None):
    if checks is None:
        checks = []
    test.cmd('az hardware-security-modules dedicated-hsm list-outbound-network-dependency-endpoint '
             '--name "hsm1" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DedicatedHsm/patch/Update an existing dedicated HSM
@try_manual
def step_dedicated_hsm_update(test, checks=None):
    if checks is None:
        checks = []
    test.cmd('az hardware-security-modules dedicated-hsm update '
             '--name "hsm1" '
             '--tags Dept="hsm" Environment="dogfood" Slice="A" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /DedicatedHsm/patch/Update an existing payment HSM
@try_manual
def step_dedicated_hsm_update2(test, checks=None):
    return step_dedicated_hsm_update(test, checks)


# EXAMPLE: /DedicatedHsm/delete/Delete a dedicated HSM
@try_manual
def step_dedicated_hsm_delete(test, checks=None):
    if checks is None:
        checks = []
    test.cmd('az hardware-security-modules dedicated-hsm delete -y '
             '--name "hsm1" '
             '--resource-group "{rg}"',
             checks=checks)
