public void AddField <T>(string name, T value, MimeType mediaType) { name.AssertNotNull(nameof(name)); mediaType.AssertNotNull(nameof(mediaType)); _fields.Insert(0, new RequestFormField(name, RestValue.Create(value), mediaType)); }
public RequestQuery(string name, RestValue content) { name.AssertNotNullOrEmpty(nameof(name)); Name = name; Content = content; }
public RequestRouteSegment(string name, RestValue content) { name.AssertNotNullOrEmpty(nameof(name)); content.AssertNotNull(nameof(content)); Name = name; Content = content; }
public RestClientBuilder WithDefaultRequestSegment <T>(string name, T value) { name.AssertNotNullOrEmpty(nameof(name)); var segment = new RequestRouteSegment(name, RestValue.Create(value)); _container.Register(new RequestEnricher(x => x.AddRouteSegment(segment))); return(this); }
public RestClientBuilder WithDefaultRequestQuery <T>(string name, T value) { name.AssertNotNullOrEmpty(nameof(name)); var query = new RequestQuery(name, RestValue.Create(value)); _container.Register(new RequestEnricher(x => x.AddQuery(query))); return(this); }
public void AddQuery <T>(string name, T value) { name.AssertNotNullOrEmpty(nameof(name)); AddQuery(new RequestQuery(name, RestValue.Create(value))); }
public void AddRouteSegment <T>(string name, T value) { name.AssertNotNullOrEmpty(nameof(name)); AddRouteSegment(new RequestRouteSegment(name, RestValue.Create(value))); }
public override bool CanSerialize(RestValue value) => value.Type == typeof(TValue);
public override string Serialize(RestValue value, CultureInfo cultureInfo) => _formatter((TValue)value.Value);