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.
ファイルを表示 Open project: OctopusDeploy/Octo.exe Class Usage Examples

Public Methods

Method 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

Method 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 method

Gets the parameter names.
public GetParameterNames ( ) : IEnumerable
return IEnumerable

Resolve() public method

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

Resolve() public static method

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

Resolve() public static method

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

SetParameter() public method

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

SetParameter() public method

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

SetParameter() public method

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

SetParameter() public method

Sets the parameter.
public SetParameter ( string name, string value ) : void
name string The name.
value string The value.
return void

UrlTemplate() public method

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