/** * Creates a custom app service pricing tier. * @param tier the tier name * @param size the size of the plan */ public PricingTier(String tier, String size) { this.skuDescription = new SkuDescription() .withName(size) .withTier(tier) .withSize(size); }
private FunctionAppImpl autoSetAlwaysOn(PricingTier pricingTier) { SkuDescription description = pricingTier.toSkuDescription(); if (description.tier().equalsIgnoreCase("Basic") || description.tier().equalsIgnoreCase("Standard") || description.tier().equalsIgnoreCase("Premium")) { return withWebAppAlwaysOn(true); } else { return withWebAppAlwaysOn(false); } }
@Override public AppServicePlanImpl withCapacity(int capacity) { if (capacity < 1) { throw new IllegalArgumentException("Capacity is at least 1."); } inner().sku().withCapacity(capacity); return this; }
@Override public int capacity() { return Utils.toPrimitiveInt(inner().sku().capacity()); }
/** * Parses a serialized value to an AppServicePricingTier instance. * * @param skuDescription the serialized value to parse. * @return the parsed AppServicePricingTier object, or null if unable to parse. */ public static PricingTier fromSkuDescription(SkuDescription skuDescription) { if (skuDescription == null) { return null; } return new PricingTier(skuDescription.tier(), skuDescription.size()); }