public async Task <IList <Image> > ListImages(ListImagesQuery query) { if (query == null) { throw new ArgumentNullException(nameof(query)); } var response = await client .MakeRequestAsync(client.NoErrorHandlers, HttpMethod.Get, "images/json", query.ToQueryString()).ConfigureAwait(false); return(client.JsonSerializer.DeserializeObject <Image[]>(response.Body)); }
public static ListImagesQuery WithLabel(this ListImagesQuery query, string label, string op = LabelOperators.Applied, string value = "") { if (string.IsNullOrWhiteSpace(label)) { throw new ArgumentNullException(nameof(label)); } var exp = label; if (op != LabelOperators.Applied) { exp = $"{exp}{op}{value}"; } if (!query.Labels.Contains(exp)) { query.Labels.Add(exp); } return(query); }
public static ListImagesQuery WithName(this ListImagesQuery query, string name) { query.Name = name; return(query); }
public static ListImagesQuery WithDangling(this ListImagesQuery query, bool dangling = true) { query.Dangling = dangling; return(query); }
public static ListImagesQuery GetAll(this ListImagesQuery query, bool all = true) { query.All = all; return(query); }
public static ListImagesQuery Before(this ListImagesQuery query, string before) { query.Before = before; return(query); }
public static ListImagesQuery Since(this ListImagesQuery query, string since) { query.Since = since; return(query); }