C# Класс Google.PowerShell.Common.ActiveUserConfig

Class that represents the current active gcloud config. The active gcloud config is the config that is listed when running "gcloud config list". This active config can be changed if the user run commands like "gcloud config set account" or if certain CLOUDSDK_* environment variables are changed.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetActiveUserConfig ( CancellationToken cancellationToken = default(CancellationToken), bool refreshConfig = false ) : Task

Gets the current active config. This value will be cached for the next call. If refreshConfig is true, however, we will refresh the cache. Everytime the cache is refreshed, a new access token will be generated for the current active config (even if there is no change in the current active config).

GetActiveUserToken ( CancellationToken cancellationToken, bool refresh = false ) : Task

Gets the token that belongs to the current active config. This value will be normally be cached as the current active user config is normally cached. If refresh is true or if the current token already expired, however, we will refresh the active user config to get a new token.

GetPropertyValue ( string key ) : Task

Returns a property of the configuration based on the given key.

Приватные методы

Метод Описание
ActiveUserConfig ( string activeConfigJson ) : Newtonsoft.Json.Linq

Creates an active user config by parsing a JSON.

GetCurrentConfigurationFingerPrint ( ) : string

Returns fingerprint of the current configuration. The result will only be changed if there is either a change in the sentinel file (which is touched by gcloud any time the configuration is changed) or if there is a change in any CLOUDSDK_* environment variables.

Описание методов

GetActiveUserConfig() публичный статический Метод

Gets the current active config. This value will be cached for the next call. If refreshConfig is true, however, we will refresh the cache. Everytime the cache is refreshed, a new access token will be generated for the current active config (even if there is no change in the current active config).
public static GetActiveUserConfig ( CancellationToken cancellationToken = default(CancellationToken), bool refreshConfig = false ) : Task
cancellationToken System.Threading.CancellationToken
refreshConfig bool
Результат Task

GetActiveUserToken() публичный статический Метод

Gets the token that belongs to the current active config. This value will be normally be cached as the current active user config is normally cached. If refresh is true or if the current token already expired, however, we will refresh the active user config to get a new token.
public static GetActiveUserToken ( CancellationToken cancellationToken, bool refresh = false ) : Task
cancellationToken System.Threading.CancellationToken
refresh bool
Результат Task

GetPropertyValue() публичный статический Метод

Returns a property of the configuration based on the given key.
public static GetPropertyValue ( string key ) : Task
key string
Результат Task