Skip to content

How to Configure Client

Client is the C# client used to obtain upgrade strategies and other resources. To make requests using the C# SDK, you need to initialize a Client instance and modify the default configuration options as needed.

Prerequisites

  • You have registered for an UpgradeLink account.
  • You have obtained the AccessKey and AccessSecret.

Obtaining Credentials

img.jpg

Default Configuration Example

using System;
using System.Reflection;
using NUnit.Framework;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using ToolsetLink.UpgradeLinkApi;
using ToolsetLink.UpgradeLinkApi.Models;

namespace UpgradeLinkApi.Tests
{
    [TestFixture]
    public class ClientTests
    {
        private Client _client;
        private Config _config;

        [SetUp]
        public void Setup()
        {
            // Configure the client for testing
            _config = new Config
            {
                AccessKey = "mui2W50H1j-OC4xD6PgQag",
                AccessSecret = "PEbdHFGC0uO_Pch7XWBQTMsFRxKPQAM2565eP8LJ3gc",
                // Protocol = "HTTP",
                // Endpoint = "127.0.0.1:8888"
            };
            
            _client = new Client(_config);
        }
    }
}

Configuration Parameters Summary

ParameterRequiredTypeExample ValueDescription
accessKeyYesstring89c8b3d5f2a74e1b
secretKeyYesstring89c8b3d5f2a74e1b
protocolNostringHTTPSProtocol, defaults to HTTPS
endpointNostringapi.api.comService domain, defaults to api.upgrade.toolsetlink.com, can be switched to your own service domain

toolsetlink@163.com