Beispiel #1
0
        internal static Endpoints DeserializeEndpoints(JsonElement element)
        {
            Optional <string> blob  = default;
            Optional <string> queue = default;
            Optional <string> table = default;
            Optional <string> file  = default;
            Optional <string> web   = default;
            Optional <string> dfs   = default;
            Optional <StorageAccountMicrosoftEndpoints> microsoftEndpoints = default;
            Optional <StorageAccountInternetEndpoints>  internetEndpoints  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("blob"))
                {
                    blob = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("queue"))
                {
                    queue = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("table"))
                {
                    table = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("file"))
                {
                    file = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("web"))
                {
                    web = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dfs"))
                {
                    dfs = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("microsoftEndpoints"))
                {
                    microsoftEndpoints = StorageAccountMicrosoftEndpoints.DeserializeStorageAccountMicrosoftEndpoints(property.Value);
                    continue;
                }
                if (property.NameEquals("internetEndpoints"))
                {
                    internetEndpoints = StorageAccountInternetEndpoints.DeserializeStorageAccountInternetEndpoints(property.Value);
                    continue;
                }
            }
            return(new Endpoints(blob.Value, queue.Value, table.Value, file.Value, web.Value, dfs.Value, microsoftEndpoints.Value, internetEndpoints.Value));
        }
Beispiel #2
0
        internal static Endpoints DeserializeEndpoints(JsonElement element)
        {
            string blob  = default;
            string queue = default;
            string table = default;
            string file  = default;
            string web   = default;
            string dfs   = default;
            StorageAccountMicrosoftEndpoints microsoftEndpoints = default;
            StorageAccountInternetEndpoints  internetEndpoints  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("blob"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    blob = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("queue"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    queue = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("table"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    table = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("file"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    file = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("web"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    web = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dfs"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    dfs = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("microsoftEndpoints"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    microsoftEndpoints = StorageAccountMicrosoftEndpoints.DeserializeStorageAccountMicrosoftEndpoints(property.Value);
                    continue;
                }
                if (property.NameEquals("internetEndpoints"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    internetEndpoints = StorageAccountInternetEndpoints.DeserializeStorageAccountInternetEndpoints(property.Value);
                    continue;
                }
            }
            return(new Endpoints(blob, queue, table, file, web, dfs, microsoftEndpoints, internetEndpoints));
        }