<commit_before>﻿using CenturyLinkCloudSDK.Runtime;
using CenturyLinkCloudSDK.Services;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace CenturyLinkCloudSDK.ServiceModels
{
    /// <summary>
    /// POCO class used for deserialization/serialization of data provided to or returned from API calls.
    /// </summary>
    public class DataCenterGroup
    {
        private string rootHardwareGroupLink;

        internal Authentication Authentication { get; set; }

        public string Id { get; set; }

        public string Name { get; set; }

        [JsonPropertyAttribute]
        private IReadOnlyList<Link> Links { get; set; }

        public bool HasRootHardwareGroup
        {
            get
            {
                if (Links != null)
                {
                    var rootHardwareGroupLink = Links.Where(l => l.Rel.ToUpper() == "GROUP").FirstOrDefault();

                    if (rootHardwareGroupLink != null)
                    {
                        this.rootHardwareGroupLink = rootHardwareGroupLink.Href;
                        return true;
                    }
                }

                return false;
            }
        }

        public async Task<Group> GetRootHardwareGroup()
        {
            if (!HasRootHardwareGroup)
            {
                throw new InvalidOperationException(string.Format(Constants.ExceptionMessages.DataCenterGroupDoesNotHaveRootHardwareGroup, Name));
            }

            var groupService = new GroupService(Authentication);
            var rootGroup = await groupService.GetGroupByLink(rootHardwareGroupLink);
            return rootGroup;
        }
    }
}<commit_msg>Added base uri in GetRootHardwareGroup method<commit_after>﻿using CenturyLinkCloudSDK.Runtime;
using CenturyLinkCloudSDK.Services;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace CenturyLinkCloudSDK.ServiceModels
{
    /// <summary>
    /// POCO class used for deserialization/serialization of data provided to or returned from API calls.
    /// </summary>
    public class DataCenterGroup
    {
        private string rootHardwareGroupLink;

        internal Authentication Authentication { get; set; }

        public string Id { get; set; }

        public string Name { get; set; }

        [JsonPropertyAttribute]
        private IReadOnlyList<Link> Links { get; set; }

        public bool HasRootHardwareGroup
        {
            get
            {
                if (Links != null)
                {
                    var rootHardwareGroupLink = Links.Where(l => l.Rel.ToUpper() == "GROUP").FirstOrDefault();

                    if (rootHardwareGroupLink != null)
                    {
                        this.rootHardwareGroupLink = rootHardwareGroupLink.Href;
                        return true;
                    }
                }

                return false;
            }
        }

        public async Task<Group> GetRootHardwareGroup()
        {
            if (!HasRootHardwareGroup)
            {
                throw new InvalidOperationException(string.Format(Constants.ExceptionMessages.DataCenterGroupDoesNotHaveRootHardwareGroup, Name));
            }

            var groupService = new GroupService(Authentication);
            var rootGroup = await groupService.GetGroupByLink(Configuration.BaseUri + rootHardwareGroupLink);
            return rootGroup;
        }
    }
}
{'fraction_non_alphanumeric': 0.0744920993227991, 'fraction_numerical': 0.0, 'mean_word_length': 1.8797725426482534, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4552956', 'n_tokens_mistral': 885, 'n_tokens_neox': 841, 'n_words': 206}