AzureFunctionConnectionParams class
Contains connection parameters to authenticate against Azure Functions and connect to specific Azure Function.
The class is able to compose and parse Azure Function connection parameters.
Configuration parameters
connections
:uri
: full connection uri with specific app and function nameprotocol
: connection protocolapp_name
: alternative app namefunction_name
: application function name
credentials
:auth_code
: authorization code or null if using custom auth
In addition to standard parameters CredentialParams may contain any number of custom parameters
See AzureFunctionConnectionResolver
Example
var connection = AzureConnectionParams.fromTuples([
'connection.uri', 'http://myapp.azurewebsites.net/api/myfunction',
'connection.protocol', 'http',
'connection.app_name', 'myapp',
'connection.function_name', 'myfunction',
'connection.auth_code', 'code',
]);
final uri = connection.getFunctionUri(); // Result: 'http://myapp.azurewebsites.net/api/myfunction'
final protocol = connection.getAppName(); // Result: 'http'
final appName = connection.getAppName(); // Result: 'myapp'
final functionName = connection.getFunctionName(); // Result: 'myfunction'
final authCode = connection.getAuthCode(); // Result: 'code'
- Inheritance
-
- Object
- MapBase<
String, String?> - StringValueMap
- ConfigParams
- AzureFunctionConnectionParams
Constructors
- AzureFunctionConnectionParams([dynamic values])
- Creates an new instance of the connection parameters.
Properties
-
entries
→ Iterable<
MapEntry< String, String?> > -
The map entries of this.
read-onlyinherited
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- isEmpty → bool
-
Whether there is no key/value pair in the map.
read-onlyinherited
- isNotEmpty → bool
-
Whether there is at least one key/value pair in the map.
read-onlyinherited
-
keys
→ Iterable<
String> -
The keys of this.
read-onlyinherited
- length → int
-
The number of key/value pairs in the map.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
-
values
→ Iterable<
String?> -
The values of this.
read-onlyinherited
Methods
-
addAll(
Map< String, String?> other) → void -
Adds all key/value pairs of
other
to this map.inherited -
addEntries(
Iterable< MapEntry< newEntries) → voidString, String?> > -
Adds all key/value pairs of
newEntries
to this map.inherited -
addSection(
String? section, ConfigParams? sectionParams) → void -
Adds parameters into this ConfigParams under specified section.
Keys for the new parameters are appended with section dot prefix.
inherited
-
append(
dynamic map) → void -
Appends new elements to this map.
inherited
-
cast<
RK, RV> () → Map< RK, RV> -
Provides a view of this map as having
RK
keys andRV
instances, if necessary.inherited -
clear(
) → void -
Clears this map by removing all its elements.
inherited
-
clone(
) → dynamic -
Creates a binary clone of this object.
inherited
-
containsKey(
Object? key) → bool -
Whether this map contains the given
key
.inherited -
containsValue(
Object? value) → bool -
Whether this map contains the given
value
.inherited -
forEach(
void action(String key, String? value)) → void -
Applies
action
to each key/value pair of the map.inherited -
fromJson(
Map< String, dynamic> json) → void -
Returned JSON Map object from values of this object
inherited
-
get(
String key) → String? -
Gets a map element specified by its key.
inherited
-
getAppName(
) → String? - Gets the Azure app name.
-
getAsArray(
String key) → AnyValueArray -
Converts map element into an AnyValueArray or returns empty AnyValueArray if conversion is not possible.
inherited
-
getAsArrayWithDefault(
String key, AnyValueArray defaultValue) → AnyValueArray -
Converts map element into an AnyValueArray or returns default value if conversion is not possible.
inherited
-
getAsBoolean(
String key) → bool -
Converts map element into a boolean or returns false if conversion is not possible.
inherited
-
getAsBooleanWithDefault(
String key, bool defaultValue) → bool -
Converts map element into a boolean or returns default value if conversion is not possible.
inherited
-
getAsDateTime(
String key) → DateTime -
Converts map element into a DateTime or returns the current date if conversion is not possible.
inherited
-
getAsDateTimeWithDefault(
String key, DateTime defaultValue) → DateTime -
Converts map element into a DateTime or returns default value if conversion is not possible.
inherited
-
getAsDouble(
String key) → double -
Converts map element into a double or returns 0 if conversion is not possible.
inherited
-
getAsDoubleWithDefault(
String key, double defaultValue) → double -
Converts map element into a double or returns default value if conversion is not possible.
inherited
-
getAsDuration(
String key) → Duration -
Converts map element into a Duration or returns the current date if conversion is not possible.
inherited
-
getAsDurationWithDefault(
String key, Duration defaultValue) → Duration -
Converts map element into a Duration or returns default value if conversion is not possible.
inherited
-
getAsFloat(
String key) → double -
Converts map element into a float or returns 0 if conversion is not possible.
inherited
-
getAsFloatWithDefault(
String key, double defaultValue) → double -
Converts map element into a flot or returns default value if conversion is not possible.
inherited
-
getAsInteger(
String key) → int -
Converts map element into an integer or returns 0 if conversion is not possible.
inherited
-
getAsIntegerWithDefault(
String key, int defaultValue) → int -
Converts map element into an integer or returns default value if conversion is not possible.
inherited
-
getAsLong(
String key) → int -
Converts map element into a long or returns 0 if conversion is not possible.
inherited
-
getAsLongWithDefault(
String key, int defaultValue) → int -
Converts map element into a long or returns default value if conversion is not possible.
inherited
-
getAsMap(
String key) → AnyValueMap -
Converts map element into an AnyValueMap or returns empty AnyValueMap if conversion is not possible.
inherited
-
getAsMapWithDefault(
String key, AnyValueMap defaultValue) → AnyValueMap -
Converts map element into an AnyValueMap or returns default value if conversion is not possible.
inherited
-
getAsNullableArray(
String key) → AnyValueArray? -
Converts map element into an AnyValueArray or returns null if conversion is not possible.
inherited
-
getAsNullableBoolean(
String key) → bool? -
Converts map element into a boolean or returns null if conversion is not possible.
inherited
-
getAsNullableDateTime(
String key) → DateTime? -
Converts map element into a DateTime or returns null if conversion is not possible.
inherited
-
getAsNullableDouble(
String key) → double? -
Converts map element into a double or returns null if conversion is not possible.
inherited
-
getAsNullableDuration(
String key) → Duration? -
Converts map element into a Duration or returns null if conversion is not possible.
inherited
-
getAsNullableFloat(
String key) → double? -
Converts map element into a float or returns null if conversion is not possible.
inherited
-
getAsNullableInteger(
String key) → int? -
Converts map element into an integer or returns null if conversion is not possible.
inherited
-
getAsNullableLong(
String key) → int? -
Converts map element into a long or returns null if conversion is not possible.
inherited
-
getAsNullableMap(
String key) → AnyValueMap? -
Converts map element into an AnyValueMap or returns null if conversion is not possible.
inherited
-
getAsNullableString(
String key) → String? -
Converts map element into a string or returns null if conversion is not possible.
inherited
-
getAsNullableType<
T> (TypeCode type, String key) → T? -
Converts map element into a value defined by specied typecode.
If conversion is not possible it returns null.
inherited
-
getAsObject(
[String? key]) → dynamic -
Gets the value stored in map element without any conversions.
When element key is not defined it returns the entire map value.
inherited
-
getAsString(
dynamic key) → String -
Converts map element into a string or returns '' if conversion is not possible.
inherited
-
getAsStringWithDefault(
String key, String defaultValue) → String -
Converts map element into a string or returns default value if conversion is not possible.
inherited
-
getAsType<
T> (TypeCode type, String key) → T? -
Converts map element into a value defined by specied typecode.
If conversion is not possible it returns default value for the specified type.
inherited
-
getAsTypeWithDefault<
T> (TypeCode type, String key, T defaultValue) → T -
Converts map element into a value defined by specied typecode.
If conversion is not possible it returns default value.
inherited
-
getAsValue(
String key) → AnyValue -
Converts map element into an AnyValue or returns an empty AnyValue if conversion is not possible.
inherited
-
getAuthCode(
) → String? - Gets the Azure auth code.
-
getFunctionName(
) → String? - Gets the Azure function name.
-
getFunctionUri(
) → String? - Gets the Azure function uri.
-
getKeys(
) → List< String> -
Gets keys of all elements stored in this map.
inherited
-
getProtocol(
) → String? - Gets the Azure function connection protocol.
-
getSection(
String section) → ConfigParams -
Gets parameters from specific section stored in this ConfigMap.
The section name is removed from parameter keys.
inherited
-
getSectionNames(
) → List< String> -
Gets a list with all 1st level section names.
inherited
-
getValue(
) → Map< String, String?> -
Gets an map with values.
inherited
-
innerValue(
) → dynamic -
Returned inner values in Map object
inherited
-
map<
K2, V2> (MapEntry< K2, V2> transform(String key, String? value)) → Map<K2, V2> -
Returns a new map where all entries of this map are transformed by
the given
convert
function.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
override(
ConfigParams configParams) → ConfigParams -
Overrides parameters with new values from specified ConfigParams
and returns a new ConfigParams object.
inherited
-
put(
String key, dynamic value) → void -
Puts a new value into map element specified by its key.
inherited
-
putIfAbsent(
String key, String? ifAbsent()) → String? -
Look up the value of
key
, or add a new entry if it isn't there.inherited -
remove(
Object? key) → String? -
Removes
key
and its associated value, if present, from the map.inherited -
removeWhere(
bool test(String key, String? value)) → void -
Removes all entries of this map that satisfy the given
test
.inherited -
setAppName(
String value) → void - Sets the Azure app name.
-
setAsObject(
dynamic key, [dynamic value]) → void -
Sets a new value to map element specified by its index.
When the index is not defined, it resets the entire map value.
This method has double purpose because method overrides are not supported in JavaScript.
inherited
-
setAuthCode(
String value) → void - Sets the Azure auth code.
-
setDefaults(
ConfigParams defaultConfigParams) → ConfigParams -
Set default values from specified ConfigParams and returns a new ConfigParams object.
inherited
-
setFunctionName(
String value) → void - Sets the Azure function name.
-
setFunctionUri(
String value) → void - Sets the Azure function uri.
-
setProtocol(
String value) → void - Sets the Azure function connection protocol.
-
toJson(
) → Map< String, dynamic> -
Initialize this object from JSON Map object
inherited
-
toString(
) → String -
Gets a string representation of the object.
The result is a semicolon-separated list of key-value pairs as
'key1=value1;key2=value2;key=value3'
inherited
-
update(
String key, String? update(String? value), {String? ifAbsent()?}) → String? -
Updates the value for the provided
key
.inherited -
updateAll(
String? update(String key, String? value)) → void -
Updates all values.
inherited
-
validate(
IContext? context) → Future - Validates this connection parameters
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
Object? key) → String? -
The value for the given
key
, ornull
ifkey
is not in the map.inherited -
operator []=(
String key, String? value) → void -
Associates the
key
with the givenvalue
.inherited
Static Methods
-
fromConfig(
ConfigParams config) → AzureFunctionConnectionParams - Retrieves AzureFunctionConnectionParams from configuration parameters. The values are retrieves from 'connection' and 'credential' sections.
-
fromString(
String line) → AzureFunctionConnectionParams -
Creates a new AzureFunctionConnectionParams object filled with key-value pairs serialized as a string.
override
-
fromTuples(
List tuples) → AzureFunctionConnectionParams -
Creates a new ConfigParams object filled with provided key-value pairs called tuples.
Tuples parameters contain a sequence of key1, value1, key2, value2, ... pairs.
override
-
mergeConfigs(
List< ConfigParams> configs) → AzureFunctionConnectionParams -
Retrieves AzureFunctionConnectionParams from multiple configuration parameters.
The values are retrieves from 'connection' and 'credential' sections.
override