internal static string ToSerializedValue(this CustomHostNameDnsRecordType value)
        {
            switch (value)
            {
            case CustomHostNameDnsRecordType.CName:
                return("CName");

            case CustomHostNameDnsRecordType.A:
                return("A");
            }
            return(null);
        }
Exemple #2
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="CustomHostNameDnsRecordType" />, 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) => CustomHostNameDnsRecordType.CreateFrom(sourceValue);
 /// <summary>
 /// Specifies the DNS record type.
 /// </summary>
 /// <param name="hostNameDnsRecordType">The DNS record type.</param>
 /// <return>The next stage of the definition.</return>
 HostNameBinding.UpdateDefinition.IWithAttach <WebAppBase.Update.IUpdate <FluentT> > HostNameBinding.UpdateDefinition.IWithHostNameDnsRecordType <WebAppBase.Update.IUpdate <FluentT> > .WithDnsRecordType(CustomHostNameDnsRecordType hostNameDnsRecordType)
 {
     return(this.WithDnsRecordType(hostNameDnsRecordType));
 }
        ///GENMHASH:027705B70337BE533ED77421800E496A:3479885A232C974264B5B36BDBB0BC94
        public HostNameBindingImpl <FluentT, FluentImplT, DefAfterRegionT, DefAfterGroupT, UpdateT> WithDnsRecordType(CustomHostNameDnsRecordType hostNameDnsRecordType)
        {
            var regex   = new Regex("([.\\w-]+)\\.([\\w-]+\\.\\w+)");
            var matcher = regex.Match(name);

            if (hostNameDnsRecordType == CustomHostNameDnsRecordType.CName && !matcher.Success)
            {
                throw new ArgumentException("root hostname cannot be assigned with a CName record");
            }
            Inner.CustomHostNameDnsRecordType = hostNameDnsRecordType;
            return(this);
        }
Exemple #5
0
 public static string ToSerialString(this CustomHostNameDnsRecordType value) => value switch
 {
Exemple #6
0
 /// <summary>
 /// Specifies the DNS record type.
 /// </summary>
 /// <param name="hostNameDnsRecordType">The DNS record type.</param>
 /// <return>The next stage of the definition.</return>
 HostNameBinding.Definition.IWithAttach <WebAppBase.Definition.IWithCreate <FluentT> > HostNameBinding.Definition.IWithHostNameDnsRecordType <WebAppBase.Definition.IWithCreate <FluentT> > .WithDnsRecordType(CustomHostNameDnsRecordType hostNameDnsRecordType)
 {
     return(this.WithDnsRecordType(hostNameDnsRecordType) as HostNameBinding.Definition.IWithAttach <WebAppBase.Definition.IWithCreate <FluentT> >);
 }