/**
         * Constructor to take in API credentials and create the backend API client
         * Also initializes the specific API clients for each object that will be used
         *
         * user: The Zuora API username
         * pass: The Zuora API password
         */
        public ApplicationManager(String user, String pass)
        {
            //Creating the API client with the new REST endpoint
            zApi = new ApiClient("https://rest.apisandbox.zuora.com/v1");

            //Adding the username and password to the header for subsequent API calls
            zApi.AddDefaultHeader("apiAccessKeyId", user);
            zApi.AddDefaultHeader("apiSecretAccessKey", pass);

            //Initializing API clients for Product Catalog, Accounts, and Subscriptions
            catalogApi       = new CatalogApi(zApi);
            accountsApi      = new AccountsApi(zApi);
            subscriptionsApi = new SubscriptionsApi(zApi);
        }
예제 #2
0
        /// <summary>
        /// Creates api client if not exists.
        /// </summary>
        /// <returns></returns>
        private static void CreateClientIfNotExists()
        {
            if (_client != null)
            {
                return;
            }
            if (!IsKubernetes)
            {
                return;
            }

            ApiClient client = new ApiClient($"https://{Host}:{Port}/");

            Configuration.DefaultApiClient = client;
            try
            {
                KubernetesConfiguration.ConfigureWithPodEnvironment();
            }
            catch (NotKubernetesPodException)
            {
                return;
            }
            _client = client;
            client.AddDefaultHeader("Authorization", "Bearer " + Configuration.Password);

            // Initialize APIs
            APIApi        = new ApiApi(client);
            APIsApi       = new ApisApi(client);
            ExtensionsApi = new ExtensionsApi(client);
            V1Api         = new VApi(client);
            VBetaApi      = new VbetaApi(client);
            VersionApi    = new VersionApi(client);
        }
예제 #3
0
 public VocadbApiWrapper(string userAgent)
 {
     configuration = new Configuration();
     apiClient     = new ApiClient();
     apiClient.AddDefaultHeader("User-Agent", userAgent);
     albumApi  = new AlbumApiApi(apiClient);
     artistApi = new ArtistApiApi(apiClient);
     webClient = new WebClient();
     logger    = LogManager.GetLogger(GetType());
     logger.Info("Client ready.");
 }
예제 #4
0
 private void InitGameObjects()
 {
     _client = new ApiClient(ApiUrl);
     _client.AddDefaultHeader("api-key", _apiKey);
     _deviceApi = new DeviceApi(_client);
     _obj       = new GameObject("MatchMoreObject");
     if (_config.LoggingEnabled)
     {
         MatchmoreLogger.Context = _obj;
     }
     _coroutine = _obj.AddComponent <CoroutineWrapper>();
 }