/** * Creates or finds a Bypass from its string representation. * @param name a name to look for * @return the corresponding Bypass */ @JsonCreator public static Bypass fromString(String name) { return fromString(name, Bypass.class); }
/** * Creates or finds a Bypass from its string representation. * @param name a name to look for * @return the corresponding Bypass */ @JsonCreator public static Bypass fromString(String name) { return fromString(name, Bypass.class); }
/** * Add the given bypass to the list of bypass configured for the storage account. * * @param bypass access type to which default network access action is not applied. */ private void addToBypassList(Bypass bypass) { NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(true); final String bypassStr = bypass.toString().toLowerCase(); Set<String> bypassSet = parseBypass(networkRuleSet.bypass()); if (bypassStr.equalsIgnoreCase(BYPASS_NONE_STR)) { bypassSet.clear(); bypassSet.add(BYPASS_NONE_STR); } else { if (bypassSet.contains(BYPASS_NONE_STR)) { bypassSet.remove(BYPASS_NONE_STR); } bypassSet.add(bypassStr); } networkRuleSet.withBypass(Bypass.fromString(StringUtils.join(bypassSet, ", "))); }
/** * Removes the given bypass from the list of bypass configured for the storage account. * * @param bypass access type to which default network access action is not applied. */ private void removeFromBypassList(Bypass bypass) { NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(false); if (networkRuleSet == null) { return; } else { Set<String> bypassSet = parseBypass(networkRuleSet.bypass()); String bypassStr = bypass.toString().toLowerCase(); if (bypassSet.contains(bypassStr)) { bypassSet.remove(bypassStr); } if (bypassSet.isEmpty() && !bypassStr.equalsIgnoreCase(BYPASS_NONE_STR)) { bypassSet.add(BYPASS_NONE_STR); } networkRuleSet.withBypass(Bypass.fromString(StringUtils.join(bypassSet, ", "))); } }
/** * Add the given bypass to the list of bypass configured for the storage account. * * @param bypass access type to which default network access action is not applied. */ private void addToBypassList(Bypass bypass) { NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(true); final String bypassStr = bypass.toString().toLowerCase(); Set<String> bypassSet = parseBypass(networkRuleSet.bypass()); if (bypassStr.equalsIgnoreCase(BYPASS_NONE_STR)) { bypassSet.clear(); bypassSet.add(BYPASS_NONE_STR); } else { if (bypassSet.contains(BYPASS_NONE_STR)) { bypassSet.remove(BYPASS_NONE_STR); } bypassSet.add(bypassStr); } networkRuleSet.withBypass(Bypass.fromString(StringUtils.join(bypassSet, ", "))); }
/** * Removes the given bypass from the list of bypass configured for the storage account. * * @param bypass access type to which default network access action is not applied. */ private void removeFromBypassList(Bypass bypass) { NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(false); if (networkRuleSet == null) { return; } else { Set<String> bypassSet = parseBypass(networkRuleSet.bypass()); String bypassStr = bypass.toString().toLowerCase(); if (bypassSet.contains(bypassStr)) { bypassSet.remove(bypassStr); } if (bypassSet.isEmpty() && !bypassStr.equalsIgnoreCase(BYPASS_NONE_STR)) { bypassSet.add(BYPASS_NONE_STR); } networkRuleSet.withBypass(Bypass.fromString(StringUtils.join(bypassSet, ", "))); } }