using System;
using System.Collections.Generic;
using System.Text;
using TencentCloud.Ccc.V20200210;
using TencentCloud.Common;
using TencentCloud.Common.Profile;

namespace Edu.ThirdCore.TenCloud
{
    public class TenCloudCredential
    {
        private static CccClient instance = null;
        private static object SingletonLock = new object();
        private static object SingletonLock2 = new object();


        public static CccClient _instance
        {
            get
            {
                if (instance == null)
                {
                    lock (SingletonLock)
                    {
                        if (instance == null) 
                        {
                            lock (SingletonLock2)
                            {
                                Credential cred = new Credential
                                {
                                    SecretId = "AKIDufDWZw4wYy98rKXUAajcEbiZAYfW7Sgh",
                                    SecretKey = "xe6IEtIRKxKRItDG3btvsb5JI1eBZkgL"
                                };

                                ClientProfile clientProfile = new ClientProfile();
                                HttpProfile httpProfile = new HttpProfile();
                                httpProfile.Endpoint = ("ccc.tencentcloudapi.com");
                                clientProfile.HttpProfile = httpProfile;

                                instance = new CccClient(cred, "", clientProfile);
                            }
                        }
                    }
                }
                return instance;
            }
        }

        private TenCloudCredential() { }

    }
}
