LUSID C# SDK
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
Lusid.Sdk.Client.Configuration Class Reference

Represents a set of configuration settings More...

Inheritance diagram for Lusid.Sdk.Client.Configuration:
Inheritance graph
[legend]

Public Member Functions

 Configuration ()
 Initializes a new instance of the Configuration class More...
 
 Configuration (IDictionary< string, string > defaultHeaders, IDictionary< string, string > apiKey, IDictionary< string, string > apiKeyPrefix, string basePath="https://www.lusid.com/api")
 Initializes a new instance of the Configuration class More...
 
string GetApiKeyWithPrefix (string apiKeyIdentifier)
 Gets the API key with prefix. More...
 
string GetServerUrl (int index)
 Returns URL based on server settings without providing values for the variables More...
 
string GetServerUrl (int index, Dictionary< string, string > inputVariables)
 Returns URL based on server settings. More...
 
string GetOperationServerUrl (string operation, int index)
 Returns URL based on operation server settings. More...
 
string GetOperationServerUrl (string operation, int index, Dictionary< string, string > inputVariables)
 Returns URL based on operation server settings. More...
 
void AddApiKey (string key, string value)
 Add Api Key Header. More...
 
void AddApiKeyPrefix (string key, string value)
 Sets the API key prefix. More...
 

Static Public Member Functions

static string ToDebugReport ()
 Returns a string with essential information for debugging. More...
 
static IReadableConfiguration MergeConfigurations (IReadableConfiguration first, IReadableConfiguration second)
 Merge configurations. More...
 

Static Public Attributes

const string Version = "2.0.0"
 Version of the package. More...
 
const string ISO8601_DATETIME_FORMAT = "o"
 Identifier for ISO 8601 DateTime Format More...
 
static readonly ExceptionFactory DefaultExceptionFactory
 Default creation of exceptions for a given method name and response object More...
 

Properties

virtual string BasePath [get, set]
 Gets or sets the base path for API access. More...
 
virtual IDictionary< string, string > DefaultHeader [get, set]
 Gets or sets the default header. More...
 
virtual IDictionary< string, string > DefaultHeaders [get, set]
 Gets or sets the default headers. More...
 
virtual int Timeout [get, set]
 Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. More...
 
virtual WebProxy Proxy [get, set]
 Gets or sets the proxy More...
 
virtual string UserAgent [get, set]
 Gets or sets the HTTP user agent. More...
 
virtual string Username [get, set]
 Gets or sets the username (HTTP basic authentication). More...
 
virtual string Password [get, set]
 Gets or sets the password (HTTP basic authentication). More...
 
X509CertificateCollection ClientCertificates [get, set]
 Gets or sets certificate collection to be sent with requests. More...
 
virtual string AccessToken [get, set]
 Gets or sets the access token for OAuth2 authentication. More...
 
virtual string OAuthTokenUrl [get, set]
 Gets or sets the token URL for OAuth2 authentication. More...
 
virtual string OAuthClientId [get, set]
 Gets or sets the client ID for OAuth2 authentication. More...
 
virtual string OAuthClientSecret [get, set]
 Gets or sets the client secret for OAuth2 authentication. More...
 
virtual ? OAuthFlow OAuthFlow [get, set]
 Gets or sets the flow for OAuth2 authentication. More...
 
virtual string TempFolderPath [get, set]
 Gets or sets the temporary folder path to store the files downloaded from the server. More...
 
virtual string DateTimeFormat [get, set]
 Gets or sets the date time format used when serializing in the ApiClient By default, it's set to ISO 8601 - "o", for others see: https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx No validation is done to ensure that the string you're providing is valid More...
 
virtual IDictionary< string, string > ApiKeyPrefix [get, set]
 Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. More...
 
virtual IDictionary< string, string > ApiKey [get, set]
 Gets or sets the API key based on the authentication name. More...
 
virtual IList< IReadOnlyDictionary< string, object > > Servers [get, set]
 Gets or sets the servers. More...
 
virtual IReadOnlyDictionary< string, List< IReadOnlyDictionary< string, object > > > OperationServers [get, set]
 Gets or sets the operation servers. More...
 
- Properties inherited from Lusid.Sdk.Client.IReadableConfiguration
string AccessToken [get]
 Gets the access token. More...
 
string OAuthTokenUrl [get]
 Gets the OAuth token URL. More...
 
string OAuthClientId [get]
 Gets the OAuth client ID. More...
 
string OAuthClientSecret [get]
 Gets the OAuth client secret. More...
 
OAuthFlowOAuthFlow [get]
 Gets the OAuth flow. More...
 
IDictionary< string, string > ApiKey [get]
 Gets the API key. More...
 
IDictionary< string, string > ApiKeyPrefix [get]
 Gets the API key prefix. More...
 
string BasePath [get]
 Gets the base path. More...
 
string DateTimeFormat [get]
 Gets the date time format. More...
 
IDictionary< string, string > DefaultHeader [get]
 Gets the default header. More...
 
IDictionary< string, string > DefaultHeaders [get]
 Gets the default headers. More...
 
string TempFolderPath [get]
 Gets the temp folder path. More...
 
int Timeout [get]
 Gets the HTTP connection timeout (in milliseconds) More...
 
WebProxy Proxy [get]
 Gets the proxy. More...
 
string UserAgent [get]
 Gets the user agent. More...
 
string Username [get]
 Gets the username. More...
 
string Password [get]
 Gets the password. More...
 
IReadOnlyDictionary< string, List< IReadOnlyDictionary< string, object > > > OperationServers [get]
 Get the servers associated with the operation. More...
 
X509CertificateCollection ClientCertificates [get]
 Gets certificate collection to be sent with requests. More...
 

Detailed Description

Represents a set of configuration settings

Constructor & Destructor Documentation

◆ Configuration() [1/2]

Lusid.Sdk.Client.Configuration.Configuration ( )
inline

Initializes a new instance of the Configuration class

◆ Configuration() [2/2]

Lusid.Sdk.Client.Configuration.Configuration ( IDictionary< string, string >  defaultHeaders,
IDictionary< string, string >  apiKey,
IDictionary< string, string >  apiKeyPrefix,
string  basePath = "https://www.lusid.com/api" 
)
inline

Initializes a new instance of the Configuration class

Member Function Documentation

◆ AddApiKey()

void Lusid.Sdk.Client.Configuration.AddApiKey ( string  key,
string  value 
)
inline

Add Api Key Header.

Parameters
keyApi Key name.
valueApi Key value.
Returns

◆ AddApiKeyPrefix()

void Lusid.Sdk.Client.Configuration.AddApiKeyPrefix ( string  key,
string  value 
)
inline

Sets the API key prefix.

Parameters
keyApi Key name.
valueApi Key value.

◆ GetApiKeyWithPrefix()

string Lusid.Sdk.Client.Configuration.GetApiKeyWithPrefix ( string  apiKeyIdentifier)
inline

Gets the API key with prefix.

Parameters
apiKeyIdentifierAPI key identifier (authentication scheme).
Returns
API key with prefix.

Implements Lusid.Sdk.Client.IReadableConfiguration.

◆ GetOperationServerUrl() [1/2]

string Lusid.Sdk.Client.Configuration.GetOperationServerUrl ( string  operation,
int  index 
)
inline

Returns URL based on operation server settings.

Parameters
operationOperation associated with the request path.
indexArray index of the server settings.

<return>The operation server URL.</return>

Implements Lusid.Sdk.Client.IReadableConfiguration.

◆ GetOperationServerUrl() [2/2]

string Lusid.Sdk.Client.Configuration.GetOperationServerUrl ( string  operation,
int  index,
Dictionary< string, string >  inputVariables 
)
inline

Returns URL based on operation server settings.

Parameters
operationOperation associated with the request path.
indexArray index of the server settings.
inputVariablesDictionary of the variables and the corresponding values.

<return>The operation server URL.</return>

◆ GetServerUrl() [1/2]

string Lusid.Sdk.Client.Configuration.GetServerUrl ( int  index)
inline

Returns URL based on server settings without providing values for the variables

Parameters
indexArray index of the server settings.

<return>The server URL.</return>

◆ GetServerUrl() [2/2]

string Lusid.Sdk.Client.Configuration.GetServerUrl ( int  index,
Dictionary< string, string >  inputVariables 
)
inline

Returns URL based on server settings.

Parameters
indexArray index of the server settings.
inputVariablesDictionary of the variables and the corresponding values.

<return>The server URL.</return>

◆ MergeConfigurations()

static IReadableConfiguration Lusid.Sdk.Client.Configuration.MergeConfigurations ( IReadableConfiguration  first,
IReadableConfiguration  second 
)
inlinestatic

Merge configurations.

Parameters
firstFirst configuration.
secondSecond configuration.

<return>Merged configuration.</return>

◆ ToDebugReport()

static string Lusid.Sdk.Client.Configuration.ToDebugReport ( )
inlinestatic

Returns a string with essential information for debugging.

Member Data Documentation

◆ DefaultExceptionFactory

readonly ExceptionFactory Lusid.Sdk.Client.Configuration.DefaultExceptionFactory
static
Initial value:
= (methodName, response) =>
{
var status = (int)response.StatusCode;
if (status >= 400)
{
return new ApiException(status,
string.Format("Error calling {0}: {1}", methodName, response.RawContent),
response.RawContent, response.Headers);
}
if (status == 0)
{
return new ApiException(status,
string.Format("Error calling {0}: {1}\n{2}", methodName, response.ErrorText, response.RawContent), response.ErrorText);
}
return null;
}

Default creation of exceptions for a given method name and response object

◆ ISO8601_DATETIME_FORMAT

const string Lusid.Sdk.Client.Configuration.ISO8601_DATETIME_FORMAT = "o"
static

Identifier for ISO 8601 DateTime Format

See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information.

◆ Version

const string Lusid.Sdk.Client.Configuration.Version = "2.0.0"
static

Version of the package.

Version of the package.

Property Documentation

◆ AccessToken

virtual string Lusid.Sdk.Client.Configuration.AccessToken
getset

Gets or sets the access token for OAuth2 authentication.

This helper property simplifies code generation.

The access token.

◆ ApiKey

virtual IDictionary<string, string> Lusid.Sdk.Client.Configuration.ApiKey
getset

Gets or sets the API key based on the authentication name.

The API key.

◆ ApiKeyPrefix

virtual IDictionary<string, string> Lusid.Sdk.Client.Configuration.ApiKeyPrefix
getset

Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.

Whatever you set here will be prepended to the value defined in AddApiKey.

An example invocation here might be:

ApiKeyPrefix["Authorization"] = "Bearer";

… where ApiKey["Authorization"] would then be used to set the value of your bearer token.

OAuth2 workflows should set tokens via AccessToken.

The prefix of the API key.

◆ BasePath

virtual string Lusid.Sdk.Client.Configuration.BasePath
getset

Gets or sets the base path for API access.

◆ ClientCertificates

X509CertificateCollection Lusid.Sdk.Client.Configuration.ClientCertificates
getset

Gets or sets certificate collection to be sent with requests.

X509 Certificate collection.

◆ DateTimeFormat

virtual string Lusid.Sdk.Client.Configuration.DateTimeFormat
getset

Gets or sets the date time format used when serializing in the ApiClient By default, it's set to ISO 8601 - "o", for others see: https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx No validation is done to ensure that the string you're providing is valid

The DateTimeFormat string

◆ DefaultHeader

virtual IDictionary<string, string> Lusid.Sdk.Client.Configuration.DefaultHeader
getset

Gets or sets the default header.

◆ DefaultHeaders

virtual IDictionary<string, string> Lusid.Sdk.Client.Configuration.DefaultHeaders
getset

Gets or sets the default headers.

◆ OAuthClientId

virtual string Lusid.Sdk.Client.Configuration.OAuthClientId
getset

Gets or sets the client ID for OAuth2 authentication.

The OAuth Client ID.

◆ OAuthClientSecret

virtual string Lusid.Sdk.Client.Configuration.OAuthClientSecret
getset

Gets or sets the client secret for OAuth2 authentication.

The OAuth Client Secret.

◆ OAuthFlow

virtual ? OAuthFlow Lusid.Sdk.Client.Configuration.OAuthFlow
getset

Gets or sets the flow for OAuth2 authentication.

The OAuth Flow.

◆ OAuthTokenUrl

virtual string Lusid.Sdk.Client.Configuration.OAuthTokenUrl
getset

Gets or sets the token URL for OAuth2 authentication.

The OAuth Token URL.

◆ OperationServers

virtual IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object> > > Lusid.Sdk.Client.Configuration.OperationServers
getset

Gets or sets the operation servers.

The operation servers.

◆ Password

virtual string Lusid.Sdk.Client.Configuration.Password
getset

Gets or sets the password (HTTP basic authentication).

The password.

◆ Proxy

virtual WebProxy Lusid.Sdk.Client.Configuration.Proxy
getset

Gets or sets the proxy

Proxy.

◆ Servers

virtual IList<IReadOnlyDictionary<string, object> > Lusid.Sdk.Client.Configuration.Servers
getset

Gets or sets the servers.

The servers.

◆ TempFolderPath

virtual string Lusid.Sdk.Client.Configuration.TempFolderPath
getset

Gets or sets the temporary folder path to store the files downloaded from the server.

Folder path.

◆ Timeout

virtual int Lusid.Sdk.Client.Configuration.Timeout
getset

Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds.

◆ UserAgent

virtual string Lusid.Sdk.Client.Configuration.UserAgent
getset

Gets or sets the HTTP user agent.

Http user agent.

◆ Username

virtual string Lusid.Sdk.Client.Configuration.Username
getset

Gets or sets the username (HTTP basic authentication).

The username.


The documentation for this class was generated from the following file: