<commit_before>﻿/**
 * Copyright 2016 d-fens GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System.Net;
using biz.dfch.CS.Appclusive.Api;
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using biz.dfch.CS.Utilities.Logging;

namespace biz.dfch.CS.Appclusive.Scheduler.Core
{
    public class AppclusiveEndpoints
    {
        public AppclusiveEndpoints(Uri baseUri, ICredentials credential)
        {
            Contract.Requires(null != baseUri);
            Contract.Requires(baseUri.IsAbsoluteUri);
            Contract.Ensures(null != Diagnostics);
            Contract.Ensures(null != Core);
            Contract.Ensures(null != Infrastructure);
            Contract.Ensures(null != Csm);
            Contract.Ensures(null != Cmp);

            credential = credential ?? CredentialCache.DefaultNetworkCredentials;

            Trace.WriteLine(string.Format("Initialising Appclusive endpoints from '{0}' ...", baseUri.AbsoluteUri));

            Uri uri;
            
            uri = new Uri(string.Format("{0}Diagnostics", baseUri.AbsoluteUri));
            Diagnostics = new biz.dfch.CS.Appclusive.Api.Diagnostics.Diagnostics(uri);
            Diagnostics.Credentials = credential;
            Diagnostics.Format.UseJson();

            uri = new Uri(string.Format("{0}Core", baseUri.AbsoluteUri));
            Core = new biz.dfch.CS.Appclusive.Api.Core.Core(uri);
            Core.Credentials = credential;
            Core.Format.UseJson();

            uri = new Uri(string.Format("{0}Infrastructure", baseUri.AbsoluteUri));
            Infrastructure = new biz.dfch.CS.Appclusive.Api.Infrastructure.Infrastructure(uri);
            Infrastructure.Credentials = credential;
            Infrastructure.Format.UseJson();

            uri = new Uri(string.Format("{0}Csm", baseUri.AbsoluteUri));
            Csm = new biz.dfch.CS.Appclusive.Api.Csm.Csm(uri);
            Csm.Credentials = credential;
            Csm.Format.UseJson();

            uri = new Uri(string.Format("{0}Cmp", baseUri.AbsoluteUri));
            Cmp = new biz.dfch.CS.Appclusive.Api.Cmp.Cmp(uri);
            Cmp.Credentials = credential;
            Cmp.Format.UseJson();

            Trace.WriteLine(string.Format("Initialising Appclusive endpoints from '{0}' COMPLETED.", baseUri.AbsoluteUri));
        }

        public biz.dfch.CS.Appclusive.Api.Diagnostics.Diagnostics Diagnostics { get; set; }
        public biz.dfch.CS.Appclusive.Api.Core.Core Core { get; set; }
        public biz.dfch.CS.Appclusive.Api.Infrastructure.Infrastructure Infrastructure { get; set; }
        public biz.dfch.CS.Appclusive.Api.Csm.Csm Csm { get; set; }
        public biz.dfch.CS.Appclusive.Api.Cmp.Cmp Cmp { get; set; }
    }
}<commit_msg>AppclusiveEndpoints<commit_after>﻿/**
 * Copyright 2016 d-fens GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System.Net;
using biz.dfch.CS.Appclusive.Api;
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using biz.dfch.CS.Utilities.Logging;

namespace biz.dfch.CS.Appclusive.Scheduler.Core
{
    public class AppclusiveEndpoints
    {
        public AppclusiveEndpoints(Uri baseUri, ICredentials credential)
        {
            Contract.Requires(null != baseUri);
            Contract.Requires(baseUri.IsAbsoluteUri);
            Contract.Ensures(null != Diagnostics);
            Contract.Ensures(null != Core);
            Contract.Ensures(null != Infrastructure);
            Contract.Ensures(null != Csm);
            Contract.Ensures(null != Cmp);

            credential = credential ?? CredentialCache.DefaultNetworkCredentials;

            Trace.WriteLine(string.Format("Initialising Appclusive endpoints from '{0}' ...", baseUri.AbsoluteUri));

            Uri uri;
            
            uri = new Uri(string.Format("{0}/Diagnostics", baseUri.AbsoluteUri.TrimEnd('/')));
            Diagnostics = new biz.dfch.CS.Appclusive.Api.Diagnostics.Diagnostics(uri);
            Diagnostics.Credentials = credential;
            Diagnostics.Format.UseJson();

            uri = new Uri(string.Format("{0}/Core", baseUri.AbsoluteUri.TrimEnd('/')));
            Core = new biz.dfch.CS.Appclusive.Api.Core.Core(uri);
            Core.Credentials = credential;
            Core.Format.UseJson();

            uri = new Uri(string.Format("{0}/Infrastructure", baseUri.AbsoluteUri.TrimEnd('/')));
            Infrastructure = new biz.dfch.CS.Appclusive.Api.Infrastructure.Infrastructure(uri);
            Infrastructure.Credentials = credential;
            Infrastructure.Format.UseJson();

            uri = new Uri(string.Format("{0}/Csm", baseUri.AbsoluteUri.TrimEnd('/')));
            Csm = new biz.dfch.CS.Appclusive.Api.Csm.Csm(uri);
            Csm.Credentials = credential;
            Csm.Format.UseJson();

            uri = new Uri(string.Format("{0}/Cmp", baseUri.AbsoluteUri.TrimEnd('/')));
            Cmp = new biz.dfch.CS.Appclusive.Api.Cmp.Cmp(uri);
            Cmp.Credentials = credential;
            Cmp.Format.UseJson();

            Trace.WriteLine(string.Format("Initialising Appclusive endpoints from '{0}' COMPLETED.", baseUri.AbsoluteUri));
        }

        public biz.dfch.CS.Appclusive.Api.Diagnostics.Diagnostics Diagnostics { get; set; }
        public biz.dfch.CS.Appclusive.Api.Core.Core Core { get; set; }
        public biz.dfch.CS.Appclusive.Api.Infrastructure.Infrastructure Infrastructure { get; set; }
        public biz.dfch.CS.Appclusive.Api.Csm.Csm Csm { get; set; }
        public biz.dfch.CS.Appclusive.Api.Cmp.Cmp Cmp { get; set; }
    }
}
{'fraction_non_alphanumeric': 0.11566943127962086, 'fraction_numerical': 0.004443127962085308, 'mean_word_length': 2.735066371681416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2560571', 'n_tokens_mistral': 1958, 'n_tokens_neox': 1931, 'n_words': 434}