def get_snmp_parameters_from_command_context(resource_config, api, force_decrypt=False):
    """
    :param ResourceCommandContext resource_config: command context
    :return:
    """

    if '3' in resource_config.snmp_version:
        return SNMPV3Parameters(ip=resource_config.address,
                                snmp_user=resource_config.snmp_v3_user or '',
                                snmp_password=api.DecryptPassword(resource_config.snmp_v3_password).Value or '',
                                snmp_private_key=resource_config.snmp_v3_private_key or '',
                                auth_protocol=resource_config.snmp_v3_auth_protocol or SNMPV3Parameters.AUTH_NO_AUTH,
                                private_key_protocol=resource_config.snmp_v3_priv_protocol or SNMPV3Parameters.PRIV_NO_PRIV).get_valid()
    else:
        if resource_config.shell_name or force_decrypt:
            write_community = api.DecryptPassword(resource_config.snmp_write_community).Value or ''
        else:
            write_community = resource_config.snmp_write_community or ''

        if write_community:
            return SNMPV2WriteParameters(ip=resource_config.address, snmp_write_community=write_community)
        else:
            if resource_config.shell_name or force_decrypt:
                read_community = api.DecryptPassword(resource_config.snmp_read_community).Value or ''
            else:
                read_community = resource_config.snmp_read_community or ''

            return SNMPV2ReadParameters(ip=resource_config.address, snmp_read_community=read_community)
:param ResourceCommandContext resource_config: command context
    :return: