<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MYOB.AccountRight.SDK.Contracts.Version2;

#if !PORTABLE
using System.Net.Cache;
#endif

namespace MYOB.AccountRight.SDK
{

    /// <summary>
    /// A simple container to hold basic API configuration
    /// </summary>
    /// <remarks>
    /// Enter your application client id and secret here
    /// 
    /// https://my.myob.com.au/Bd/pages/DevAppList.aspx
    /// </remarks>>
    public class ApiConfiguration : IApiConfiguration
    {
        /// <summary>
        /// Initializes an instance of the ApiConfiguration class (usually used for cloud mode)
        /// </summary>
        /// <param name="clientId">The client id (OAuth related)</param>
        /// <param name="clientSecret">The client id (OAuth related)</param>
        /// <param name="redirectUrl">The redirect uri for the application (OAuth related)</param>
        /// <param name="apiBaseUrl">The AccountRight API endpoint, defaults to 'https://api.myob.com/accountright'</param>
        /// <param name="generateUris">Should the returned entities have the <see cref="BaseEntity.URI"/> and <see cref="BaseLink.URI"/> fields populated</param>
        public ApiConfiguration(string clientId, string clientSecret, string redirectUrl, string apiBaseUrl = "https://api.myob.com/accountright", bool generateUris = true)
        {
            ApiBaseUrl = apiBaseUrl;
            ClientId = clientId;
            ClientSecret = clientSecret;
            RedirectUrl = redirectUrl;
            GenerateUris = generateUris;
        }

        /// <summary>
        /// Initializes an instance of the ApiConfiguration class (usually used for network mode)
        /// </summary>
        /// <param name="apiBaseUrl"></param>
        public ApiConfiguration(string apiBaseUrl) : this(null, null, null, apiBaseUrl)
        {}

        /// <summary>
        /// The client id (OAuth related)
        /// </summary>
        public string ClientId { get; private set; }

        /// <summary>
        /// The client secret (OAuth related)
        /// </summary>
        public string ClientSecret { get; private set; }

        /// <summary>
        /// The redirect uri for the application (OAuth related)
        /// </summary>
        public string RedirectUrl { get; private set; }

        /// <summary>
        /// The AccountRight API endpoint, defaults to 'https://api.myob.com/accountright'
        /// </summary>
        public string ApiBaseUrl { get; private set; }

        /// <summary>
        /// Should the returned entities have the <see cref="BaseEntity.URI"/> and <see cref="BaseLink.URI"/> fields populated
        /// </summary><commit_msg>Changed ApiConfiguration constructor<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MYOB.AccountRight.SDK.Contracts.Version2;

#if !PORTABLE
using System.Net.Cache;
#endif

namespace MYOB.AccountRight.SDK
{

    /// <summary>
    /// A simple container to hold basic API configuration
    /// </summary>
    /// <remarks>
    /// Enter your application client id and secret here
    /// 
    /// https://my.myob.com.au/Bd/pages/DevAppList.aspx
    /// </remarks>>
    public class ApiConfiguration : IApiConfiguration
    {
        /// <summary>
        /// Initializes an instance of the ApiConfiguration class (usually used for cloud mode)
        /// </summary>
        /// <param name="clientId">The client id (OAuth related)</param>
        /// <param name="clientSecret">The client id (OAuth related)</param>
        /// <param name="redirectUrl">The redirect uri for the application (OAuth related)</param>
        /// <param name="apiBaseUrl">The AccountRight API endpoint, defaults to 'https://api.myob.com/accountright'</param>
        /// <param name="generateUris">Should the returned entities have the <see cref="BaseEntity.URI"/> and <see cref="BaseLink.URI"/> fields populated</param>
        public ApiConfiguration(string clientId, string clientSecret, string redirectUrl, string apiBaseUrl = "https://api.myob.com/accountright", bool generateUris = true)
        {
            ApiBaseUrl = apiBaseUrl;
            ClientId = clientId;
            ClientSecret = clientSecret;
            RedirectUrl = redirectUrl;
            GenerateUris = generateUris;
        }

        /// <summary>
        /// Initializes an instance of the ApiConfiguration class (usually used for network mode)
        /// </summary>
        /// <param name="apiBaseUrl"></param>
        public ApiConfiguration(string apiBaseUrl, bool generateUris = true) : this(null, null, null, apiBaseUrl, generateUris)
        {}

        /// <summary>
        /// The client id (OAuth related)
        /// </summary>
        public string ClientId { get; private set; }

        /// <summary>
        /// The client secret (OAuth related)
        /// </summary>
        public string ClientSecret { get; private set; }

        /// <summary>
        /// The redirect uri for the application (OAuth related)
        /// </summary>
        public string RedirectUrl { get; private set; }

        /// <summary>
        /// The AccountRight API endpoint, defaults to 'https://api.myob.com/accountright'
        /// </summary>
        public string ApiBaseUrl { get; private set; }

        /// <summary>
        /// Should the returned entities have the <see cref="BaseEntity.URI"/> and <see cref="BaseLink.URI"/> fields populated
        /// </summary>
{'fraction_non_alphanumeric': 0.12837226145210937, 'fraction_numerical': 0.0003621220351258374, 'mean_word_length': 2.2920143027413586, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 73, 'https://': 8, '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': '4134584', 'n_tokens_mistral': 1462, 'n_tokens_neox': 1436, 'n_words': 439}