C# Class Octopus.Client.UrlTemplate

Modified implementation of the URI Template Spec RFC6570 for use in the Octopus Deploy RESTful API client.
This implementation is from: https://github.com/darrelmiller/UriTemplates. The class was renamed so as not to conflict with the UriTemplate class built into .NET, and the static methods were added.
Afficher le fichier Open project: OctopusDeploy/Octo.exe Class Usage Examples

Méthodes publiques

Méthode Description
GetParameterNames ( ) : IEnumerable

Gets the parameter names.

Resolve ( ) : string

Resolves this instance.

Resolve ( string templateSpec, object>.IDictionary parameters ) : string

Resolves the specified template spec.

Resolve ( string templateSpec, object parameters ) : string

Resolves the specified template spec.

SetParameter ( string name, string>.IDictionary value ) : void

Sets the parameter.

SetParameter ( string name, IEnumerable value ) : void

Sets the parameter.

SetParameter ( string name, object value ) : void

Sets the parameter.

SetParameter ( string name, string value ) : void

Sets the parameter.

UrlTemplate ( string template ) : System

Initializes a new instance of the UrlTemplate class.

Private Methods

Méthode Description
AppendDictionary ( OperatorInfo op, bool explode, string>.IDictionary dictionary ) : void
AppendList ( OperatorInfo op, bool explode, string variable, IEnumerable list ) : void
AppendName ( string variable, OperatorInfo op, bool valueIsEmpty ) : void
AppendValue ( string value, int prefixLength, bool allowReserved ) : void
Encode ( string p, bool allowReserved ) : string
GetOperator ( char operatorIndicator ) : OperatorInfo
ProcessExpression ( StringBuilder currentExpression ) : void
ProcessVariable ( VarSpec varSpec ) : bool

Method Details

GetParameterNames() public méthode

Gets the parameter names.
public GetParameterNames ( ) : IEnumerable
Résultat IEnumerable

Resolve() public méthode

Resolves this instance.
/// Malformed template : + result /// or /// Malformed template : + result ///
public Resolve ( ) : string
Résultat string

Resolve() public static méthode

Resolves the specified template spec.
public static Resolve ( string templateSpec, object>.IDictionary parameters ) : string
templateSpec string The template spec.
parameters object>.IDictionary The parameters.
Résultat string

Resolve() public static méthode

Resolves the specified template spec.
public static Resolve ( string templateSpec, object parameters ) : string
templateSpec string The template spec.
parameters object The parameters.
Résultat string

SetParameter() public méthode

Sets the parameter.
public SetParameter ( string name, string>.IDictionary value ) : void
name string The name.
value string>.IDictionary The value.
Résultat void

SetParameter() public méthode

Sets the parameter.
public SetParameter ( string name, IEnumerable value ) : void
name string The name.
value IEnumerable The value.
Résultat void

SetParameter() public méthode

Sets the parameter.
public SetParameter ( string name, object value ) : void
name string The name.
value object The value.
Résultat void

SetParameter() public méthode

Sets the parameter.
public SetParameter ( string name, string value ) : void
name string The name.
value string The value.
Résultat void

UrlTemplate() public méthode

Initializes a new instance of the UrlTemplate class.
public UrlTemplate ( string template ) : System
template string The template.
Résultat System