def METHOD_NAME(cmd,
                         client,
                         registry_name,
                         subnet=None,
                         vnet_name=None,
                         ip_address=None,
                         resource_group_name=None):
    _, resource_group_name = validate_premium_registry(
        cmd, registry_name, resource_group_name, NETWORK_RULE_NOT_SUPPORTED)
    client = cf_acr_network_rules(cmd.cli_ctx)
    registry = client.get(resource_group_name, registry_name)
    rules = registry.network_rule_set
    if subnet or vnet_name:
        rules.virtual_network_rules = rules.virtual_network_rules if rules.virtual_network_rules else []
        subnet_id = _validate_subnet(cmd.cli_ctx, subnet, vnet_name, resource_group_name)
        rules.virtual_network_rules.append(VirtualNetworkRule(virtual_network_resource_id=subnet_id))
    if ip_address:
        rules.ip_rules = rules.ip_rules if rules.ip_rules else []
        IPRule = cmd.get_models('IPRule')
        rules.ip_rules.append(IPRule(ip_address_or_range=ip_address))
    RegistryUpdateParameters = cmd.get_models('RegistryUpdateParameters')
    parameters = RegistryUpdateParameters(network_rule_set=rules)
    return client.begin_update(resource_group_name, registry_name, parameters)