///GENMHASH:8200D5EDD19C5D72B80F6841AD9D0FF0:F58B9D6D280E3F1581C12EFC5360F4C9
 public RouteTableImpl WithRoute(string destinationAddressPrefix, RouteNextHopType nextHop)
 {
     return(DefineRoute(SdkContext.RandomResourceName("route_" + Name, 20))
            .WithDestinationAddressPrefix(destinationAddressPrefix)
            .WithNextHop(nextHop)
            .Attach());
 }
        internal static RouteData DeserializeRouteData(JsonElement element)
        {
            Optional <string>            name              = default;
            Optional <string>            etag              = default;
            Optional <string>            type              = default;
            Optional <string>            id                = default;
            Optional <string>            addressPrefix     = default;
            Optional <RouteNextHopType>  nextHopType       = default;
            Optional <string>            nextHopIpAddress  = default;
            Optional <ProvisioningState> provisioningState = default;
            Optional <bool> hasBgpOverride = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("addressPrefix"))
                        {
                            addressPrefix = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("nextHopType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            nextHopType = new RouteNextHopType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("nextHopIpAddress"))
                        {
                            nextHopIpAddress = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("hasBgpOverride"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            hasBgpOverride = property0.Value.GetBoolean();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new RouteData(id.Value, name.Value, etag.Value, type.Value, addressPrefix.Value, Optional.ToNullable(nextHopType), nextHopIpAddress.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(hasBgpOverride)));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="RouteNextHopType" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RouteNextHopType.CreateFrom(sourceValue);
 /// <summary>
 /// Creates a non-virtual appliance route.
 /// The name is generated automatically.
 /// </summary>
 /// <param name="destinationAddressPrefix">The destination address prefix, expressed in the CIDR notation, for the route to apply to.</param>
 /// <param name="nextHop">The next hop type.</param>
 /// <return>The next stage of the update.</return>
 RouteTable.Update.IUpdate RouteTable.Update.IWithRoute.WithRoute(string destinationAddressPrefix, RouteNextHopType nextHop)
 {
     return(this.WithRoute(destinationAddressPrefix, nextHop) as RouteTable.Update.IUpdate);
 }
 ///GENMHASH:8250561E62A0930DA1780FF8F83EA1AE:F0C4F9C231DA6D3EC53103DC8186BB72
 public RouteImpl WithNextHop(RouteNextHopType nextHopType)
 {
     Inner.NextHopType = nextHopType.ToString();
     return(this);
 }
 ///GENMHASH:41D73337A94BA1CFBD7B6D9FBD76CDA8:3FBB22911E1E512603F245E0624E5230
 public RouteNextHopType NextHopType()
 {
     return(RouteNextHopType.Parse(Inner.NextHopType));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Specifies the next hop type.
 /// To use a virtual appliance, use  .withNextHopToVirtualAppliance(String) instead and specify its IP address.
 /// </summary>
 /// <param name="nextHopType">A hop type.</param>
 /// <return>The next stage of the update.</return>
 Route.Update.IUpdate Route.Update.IWithNextHopType.WithNextHop(RouteNextHopType nextHopType)
 {
     return(this.WithNextHop(nextHopType) as Route.Update.IUpdate);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Specifies the next hop type.
 /// To use a virtual appliance, use  .withNextHopToVirtualAppliance(String) instead and specify its IP address.
 /// </summary>
 /// <param name="nextHopType">A hop type.</param>
 /// <return>The next stage of the definition.</return>
 Route.UpdateDefinition.IWithAttach <RouteTable.Update.IUpdate> Route.UpdateDefinition.IWithNextHopType <RouteTable.Update.IUpdate> .WithNextHop(RouteNextHopType nextHopType)
 {
     return(this.WithNextHop(nextHopType) as Route.UpdateDefinition.IWithAttach <RouteTable.Update.IUpdate>);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Creates a non-virtual appliance route.
 /// The name is generated automatically.
 /// </summary>
 /// <param name="destinationAddressPrefix">The destination address prefix, expressed in the CIDR notation, for the route to apply to.</param>
 /// <param name="nextHop">The next hop type.</param>
 /// <return>The next stage of the definition.</return>
 RouteTable.Definition.IWithCreate RouteTable.Definition.IWithRoute.WithRoute(string destinationAddressPrefix, RouteNextHopType nextHop)
 {
     return(this.WithRoute(destinationAddressPrefix, nextHop));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Specifies the next hop type.
 /// To use a virtual appliance, use  .withNextHopToVirtualAppliance(String) instead and specify its IP address.
 /// </summary>
 /// <param name="nextHopType">A hop type.</param>
 /// <return>The next stage of the definition.</return>
 Route.Definition.IWithAttach <RouteTable.Definition.IWithCreate> Route.Definition.IWithNextHopType <RouteTable.Definition.IWithCreate> .WithNextHop(RouteNextHopType nextHopType)
 {
     return(this.WithNextHop(nextHopType));
 }