///GENMHASH:78875D7320F151C84C51611FC09D4CC2:3EAA4712B5C494AD4AB8E1AA820E5A1C
        protected LoadBalancerFrontendImpl EnsureUniqueFrontend()
        {
            string name = SdkContext.RandomResourceName("frontend", 20);
            LoadBalancerFrontendImpl frontend = DefineFrontend(name);

            frontend.Attach();
            return(frontend);
        }
 ///GENMHASH:246406B860B0B19EFB0E9B11EC82DA0F:833B17009FF35743D36834ABBB879D14
 internal LoadBalancerImpl WithFrontend(LoadBalancerFrontendImpl frontend)
 {
     if (frontend != null)
     {
         frontends[frontend.Name()] = frontend;
     }
     return(this);
 }
        ///GENMHASH:38719597698E42AABAD5A9917188C155:D9C6887E0B146C62C173F2FC8A940200
        private void InitializeFrontendsFromInner()
        {
            frontends = new Dictionary <string, ILoadBalancerFrontend>();
            IList <FrontendIPConfigurationInner> frontendsInner = Inner.FrontendIPConfigurations;

            if (frontendsInner != null)
            {
                foreach (var frontendInner in frontendsInner)
                {
                    var frontend = new LoadBalancerFrontendImpl(frontendInner, this);
                    frontends.Add(frontendInner.Name, frontend);
                }
            }
        }
        ///GENMHASH:5368AC7579C6EE249C0AD6A90678BF35:DBC4E47BA426D019C948CDD4FF3805F0
        internal ILoadBalancerPublicFrontend EnsurePublicFrontendWithPip(string pipId)
        {
            var frontend = FindFrontendByPublicIPAddress(pipId);

            if (pipId == null)
            {
                return(null);
            }
            else if (frontend != null)
            {
                return(frontend);
            }
            else
            {
                // Create new frontend
                LoadBalancerFrontendImpl fe = EnsureUniqueFrontend()
                                              .WithExistingPublicIPAddress(pipId);
                fe.Attach();
                return(fe);
            }
        }
        ///GENMHASH:19F616FD24A9FEB061A4AD97B44DD095:345305550E7CF60E8C5F17B68CA0E7FE
        internal ILoadBalancerPrivateFrontend EnsurePrivateFrontendWithSubnet(string networkId, string subnetName)
        {
            var frontend = FindPrivateFrontendWithSubnet(networkId, subnetName);

            if (networkId == null || subnetName == null)
            {
                return(null);
            }
            else if (frontend != null)
            {
                return(frontend);
            }
            else
            {
                // Create new frontend
                LoadBalancerFrontendImpl fe = this.EnsureUniqueFrontend()
                                              .WithExistingSubnet(networkId, subnetName)
                                              .WithPrivateIPAddressDynamic();
                fe.Attach();
                return(fe);
            }
        }