Class Configuration
Represents a set of configuration settings
Implements
Inherited Members
Namespace: mailslurp.Client
Assembly: mailslurp.dll
Syntax
public class Configuration : IReadableConfiguration
Constructors
View SourceConfiguration()
Initializes a new instance of the Configuration class
Declaration
public Configuration()
Configuration(IDictionary<string, string>, IDictionary<string, string>, IDictionary<string, string>, string)
Initializes a new instance of the Configuration class
Declaration
public Configuration(IDictionary<string, string> defaultHeaders, IDictionary<string, string> apiKey, IDictionary<string, string> apiKeyPrefix, string basePath = "https://csharp.api.mailslurp.com")
Parameters
Type | Name | Description |
---|---|---|
IDictionary<string, string> | defaultHeaders | |
IDictionary<string, string> | apiKey | |
IDictionary<string, string> | apiKeyPrefix | |
string | basePath |
Fields
View SourceDefaultExceptionFactory
Default creation of exceptions for a given method name and response object
Declaration
public static readonly ExceptionFactory DefaultExceptionFactory
Field Value
Type | Description |
---|---|
ExceptionFactory |
ISO8601_DATETIME_FORMAT
Identifier for ISO 8601 DateTime Format
Declaration
public const string ISO8601_DATETIME_FORMAT = "o"
Field Value
Type | Description |
---|---|
string |
Remarks
See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information.
Version
Version of the package.
Declaration
public const string Version = "15.19.22"
Field Value
Type | Description |
---|---|
string | Version of the package. |
Properties
View SourceAccessToken
Gets or sets the access token for OAuth2 authentication.
This helper property simplifies code generation.
Declaration
public virtual string AccessToken { get; set; }
Property Value
Type | Description |
---|---|
string | The access token. |
ApiKey
Gets or sets the API key based on the authentication name.
Declaration
public virtual IDictionary<string, string> ApiKey { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<string, string> | The API key. |
ApiKeyPrefix
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:
Declaration
public virtual IDictionary<string, string> ApiKeyPrefix { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<string, string> | The prefix of the API key. |
BasePath
Gets or sets the base path for API access.
Declaration
public virtual string BasePath { get; set; }
Property Value
Type | Description |
---|---|
string |
ClientCertificates
Gets or sets certificate collection to be sent with requests.
Declaration
public X509CertificateCollection ClientCertificates { get; set; }
Property Value
Type | Description |
---|---|
X509CertificateCollection | X509 Certificate collection. |
DateTimeFormat
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
Declaration
public virtual string DateTimeFormat { get; set; }
Property Value
Type | Description |
---|---|
string | The DateTimeFormat string |
DefaultHeader
Gets or sets the default header.
Declaration
[Obsolete("Use DefaultHeaders instead.")]
public virtual IDictionary<string, string> DefaultHeader { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<string, string> |
DefaultHeaders
Gets or sets the default headers.
Declaration
public virtual IDictionary<string, string> DefaultHeaders { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<string, string> |
OperationServers
Gets or sets the operation servers.
Declaration
public virtual IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> OperationServers { get; set; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<string, System.Collections.Generic.List<T><IReadOnlyDictionary<string, object>>> | The operation servers. |
Password
Gets or sets the password (HTTP basic authentication).
Declaration
public virtual string Password { get; set; }
Property Value
Type | Description |
---|---|
string | The password. |
Proxy
Gets or sets the proxy
Declaration
public virtual WebProxy Proxy { get; set; }
Property Value
Type | Description |
---|---|
System.Net.WebProxy | Proxy. |
Servers
Gets or sets the servers.
Declaration
public virtual IList<IReadOnlyDictionary<string, object>> Servers { get; set; }
Property Value
Type | Description |
---|---|
IList<IReadOnlyDictionary<string, object>> | The servers. |
TempFolderPath
Gets or sets the temporary folder path to store the files downloaded from the server.
Declaration
public virtual string TempFolderPath { get; set; }
Property Value
Type | Description |
---|---|
string | Folder path. |
Timeout
Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds.
Declaration
public virtual int Timeout { get; set; }
Property Value
Type | Description |
---|---|
int |
UserAgent
Gets or sets the HTTP user agent.
Declaration
public virtual string UserAgent { get; set; }
Property Value
Type | Description |
---|---|
string | Http user agent. |
Username
Gets or sets the username (HTTP basic authentication).
Declaration
public virtual string Username { get; set; }
Property Value
Type | Description |
---|---|
string | The username. |
Methods
View SourceAddApiKey(string, string)
Add Api Key Header.
Declaration
public void AddApiKey(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
string | key | Api Key name. |
string | value | Api Key value. |
AddApiKeyPrefix(string, string)
Sets the API key prefix.
Declaration
public void AddApiKeyPrefix(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
string | key | Api Key name. |
string | value | Api Key value. |
GetApiKeyWithPrefix(string)
Gets the API key with prefix.
Declaration
public string GetApiKeyWithPrefix(string apiKeyIdentifier)
Parameters
Type | Name | Description |
---|---|---|
string | apiKeyIdentifier | API key identifier (authentication scheme). |
Returns
Type | Description |
---|---|
string | API key with prefix. |
GetOperationServerUrl(string, int, Dictionary<string, string>)
Returns URL based on operation server settings.
Declaration
public string GetOperationServerUrl(string operation, int index, Dictionary<string, string> inputVariables)
Parameters
Type | Name | Description |
---|---|---|
string | operation | Operation associated with the request path. |
int | index | Array index of the server settings. |
Dictionary<string, string> | inputVariables | Dictionary of the variables and the corresponding values. |
Returns
Type | Description |
---|---|
string |
GetOperationServerUrl(string, int)
Returns URL based on operation server settings.
Declaration
public string GetOperationServerUrl(string operation, int index)
Parameters
Type | Name | Description |
---|---|---|
string | operation | Operation associated with the request path. |
int | index | Array index of the server settings. |
Returns
Type | Description |
---|---|
string |
GetServerUrl(int, Dictionary<string, string>)
Returns URL based on server settings.
Declaration
public string GetServerUrl(int index, Dictionary<string, string> inputVariables)
Parameters
Type | Name | Description |
---|---|---|
int | index | Array index of the server settings. |
Dictionary<string, string> | inputVariables | Dictionary of the variables and the corresponding values. |
Returns
Type | Description |
---|---|
string |
GetServerUrl(int)
Returns URL based on server settings without providing values for the variables
Declaration
public string GetServerUrl(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | Array index of the server settings. |
Returns
Type | Description |
---|---|
string |
MergeConfigurations(IReadableConfiguration, IReadableConfiguration)
Merge configurations.
Declaration
public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second)
Parameters
Type | Name | Description |
---|---|---|
IReadableConfiguration | first | First configuration. |
IReadableConfiguration | second | Second configuration. |
Returns
Type | Description |
---|---|
IReadableConfiguration |
ToDebugReport()
Returns a string with essential information for debugging.
Declaration
public static string ToDebugReport()
Returns
Type | Description |
---|---|
string |