コード例 #1
0
 internal ManagementGroupData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, string tenantId, string displayName, ManagementGroupDetails details, IReadOnlyList <ManagementGroupChildInfo> children) : base(id, name, type, systemData)
 {
     TenantId    = tenantId;
     DisplayName = displayName;
     Details     = details;
     Children    = children;
 }
コード例 #2
0
 internal ManagementGroupData(string id, string type, string name, string tenantId, string displayName, ManagementGroupDetails details, IReadOnlyList <ManagementGroupChildInfo> children)
     : base(id, name, type)
 {
     TenantId    = tenantId;
     DisplayName = displayName;
     Details     = details;
     Children    = children;
 }
コード例 #3
0
        internal static ManagementGroupData DeserializeManagementGroupData(JsonElement element)
        {
            ResourceIdentifier id                     = default;
            string             name                   = default;
            ResourceType       type                   = default;
            SystemData         systemData             = default;
            Optional <string>  tenantId               = default;
            Optional <string>  displayName            = default;
            Optional <ManagementGroupDetails> details = default;
            Optional <IReadOnlyList <ManagementGroupChildInfo> > children = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("tenantId"))
                        {
                            tenantId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("displayName"))
                        {
                            displayName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("details"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            details = ManagementGroupDetails.DeserializeManagementGroupDetails(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("children"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                children = null;
                                continue;
                            }
                            List <ManagementGroupChildInfo> array = new List <ManagementGroupChildInfo>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ManagementGroupChildInfo.DeserializeManagementGroupChildInfo(item));
                            }
                            children = array;
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ManagementGroupData(id, name, type, systemData, tenantId.Value, displayName.Value, details.Value, Optional.ToList(children)));
        }