示例#1
0
        public async Task <ListImageTagsResponse> ListImageTagsAsync(
            string name,
            ListImageTagsParameters parameters  = null,
            CancellationToken cancellationToken = default)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException(
                          $"'{nameof(name)}' cannot be null or empty",
                          nameof(name));
            }

            parameters = parameters ?? new ListImageTagsParameters();

            var queryString = new QueryString();

            queryString.AddFromObjectWithQueryParameters(parameters);

            var response = await this._client.MakeRequestAsync(
                cancellationToken,
                HttpMethod.Get,
                $"v2/{name}/tags/list",
                queryString).ConfigureAwait(false);

            return(this._client.JsonSerializer.DeserializeObject <ListImageTagsResponse>(
                       response.Body));
        }
        public async Task <Catalog> GetCatalogAsync(
            CatalogParameters parameters        = null,
            CancellationToken cancellationToken = default)
        {
            parameters = parameters ?? new CatalogParameters();

            var queryParameters = new QueryString();

            queryParameters.AddFromObjectWithQueryParameters(parameters);

            var response = await this._client.MakeRequestAsync(
                cancellationToken,
                HttpMethod.Get,
                "v2/_catalog",
                queryParameters).ConfigureAwait(false);

            return(this._client.JsonSerializer.DeserializeObject <Catalog>(response.Body));
        }