'Check module params'

def check_params(self):

    if self.cost:
        if self.cost.isdigit():
            if ((int(self.cost) < 1) or (int(self.cost) > 200000000)):
                self.module.fail_json(msg='Error:    The    value    of    cost    is    out    of    [1    -    200000000].')
        else:
            self.module.fail_json(msg='Error:    The    cost    is    not    digit.')
    if self.tc_protection_interval:
        if self.tc_protection_interval.isdigit():
            if ((int(self.tc_protection_interval) < 1) or (int(self.tc_protection_interval) > 600)):
                self.module.fail_json(msg='Error:    The    value    of    tc_protection_interval    is    out    of    [1    -    600].')
        else:
            self.module.fail_json(msg='Error:    The    tc_protection_interval    is    not    digit.')
    if self.tc_protection_threshold:
        if self.tc_protection_threshold.isdigit():
            if ((int(self.tc_protection_threshold) < 1) or (int(self.tc_protection_threshold) > 255)):
                self.module.fail_json(msg='Error:    The    value    of    tc_protection_threshold    is    out    of    [1    -    255].')
        else:
            self.module.fail_json(msg='Error:    The    tc_protection_threshold    is    not    digit.')
    if (self.root_protection or self.loop_protection or self.cost):
        if (not self.interface):
            self.module.fail_json(msg='Error:    Please    input    interface.')
        elif (self.interface == 'all'):
            self.module.fail_json(msg='Error:    Interface    can    not    be    all    when    config    root_protection    or    loop_protection    or    cost.')
    if (self.root_protection and (self.root_protection == 'enable')):
        if (self.loop_protection and (self.loop_protection == 'enable')):
            self.module.fail_json(msg='Error:    Can    not    enable    root_protection    and    loop_protection    at    the    same    interface.')
    if (self.edged_port or self.bpdu_filter):
        if (not self.interface):
            self.module.fail_json(msg='Error:    Please    input    interface.')
