Microsoft.Azure.Commands.Network.AzureApplicationGatewayRequestRoutingRuleBase.NewObject C# (CSharp) Method

NewObject() public method

public NewObject ( ) : PSApplicationGatewayRequestRoutingRule
return Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayRequestRoutingRule
        public PSApplicationGatewayRequestRoutingRule NewObject()
        {
            var requestRoutingRule = new PSApplicationGatewayRequestRoutingRule();
            requestRoutingRule.Name = this.Name;
            requestRoutingRule.RuleType = this.RuleType;

            if (!string.IsNullOrEmpty(this.BackendHttpSettingsId))
            {
                requestRoutingRule.BackendHttpSettings = new PSResourceId();
                requestRoutingRule.BackendHttpSettings.Id = this.BackendHttpSettingsId;
            }

            if (!string.IsNullOrEmpty(this.HttpListenerId))
            {
                requestRoutingRule.HttpListener = new PSResourceId();
                requestRoutingRule.HttpListener.Id = this.HttpListenerId;
            }
            if (!string.IsNullOrEmpty(this.BackendAddressPoolId))
            {
                requestRoutingRule.BackendAddressPool = new PSResourceId();
                requestRoutingRule.BackendAddressPool.Id = this.BackendAddressPoolId;
            }
            if (!string.IsNullOrEmpty(this.UrlPathMapId))
            {
                requestRoutingRule.UrlPathMap = new PSResourceId();
                requestRoutingRule.UrlPathMap.Id = this.UrlPathMapId;
            }

            requestRoutingRule.Id = ApplicationGatewayChildResourceHelper.GetResourceNotSetId(
                                this.NetworkClient.NetworkManagementClient.SubscriptionId,
                                Microsoft.Azure.Commands.Network.Properties.Resources.ApplicationGatewayRequestRoutingRuleName,
                                this.Name);

            return requestRoutingRule;
        }
    }
AzureApplicationGatewayRequestRoutingRuleBase