Skip to content

Commit 5fd1f01

Browse files
committed
Update package version and dependency
1 parent 1778565 commit 5fd1f01

File tree

5 files changed

+30
-9
lines changed

5 files changed

+30
-9
lines changed

Contentful.AspNetCore/Contentful.AspNetCore.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<PackageProjectUrl>https://github.com/contentful/contentful.net</PackageProjectUrl>
1414
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1515
<RepositoryType>git</RepositoryType>
16-
<Version>4.2.0</Version>
17-
<AssemblyVersion>4.2.0.0</AssemblyVersion>
16+
<Version>4.3.0</Version>
17+
<AssemblyVersion>4.3.0.0</AssemblyVersion>
1818
<RepositoryUrl>https://github.com/contentful/contentful.net</RepositoryUrl>
1919
</PropertyGroup>
2020
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -24,7 +24,7 @@
2424
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
2525
</PropertyGroup>
2626
<ItemGroup>
27-
<PackageReference Include="contentful.csharp" Version="4.1.1" />
27+
<PackageReference Include="contentful.csharp" Version="4.3.0" />
2828
<PackageReference Include="gitlink" Version="3.1.0">
2929
<PrivateAssets>all</PrivateAssets>
3030
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>

Contentful.Core.Tests/ContentfulManagementClientTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ public async Task GetActivatedContentTypesShouldSerializeCorrectly()
425425

426426
//Assert
427427
Assert.Equal(5, res.Count());
428-
Assert.Equal($"https://api.contentful.com/spaces/666/public/content_types", requestUrl);
428+
Assert.Equal($"https://api.contentful.com/spaces/666/public/content_types/", requestUrl);
429429
Assert.Equal("someName", res.First().Name);
430430
Assert.Equal(8, (res.First().Fields.First().Validations.First() as SizeValidator).Max);
431431
Assert.Equal(8, ((res.First().Fields.Last().Validations.First() as NodesValidator).EmbeddedEntryInline.First() as SizeValidator).Max);
@@ -3220,7 +3220,7 @@ public async Task SettingEnvironmentForGetActivatedContentTypesShouldYieldCorrec
32203220
await client.GetActivatedContentTypes();
32213221

32223222
//Assert
3223-
Assert.Equal("https://api.contentful.com/spaces/564/environments/special/public/content_types", path);
3223+
Assert.Equal("https://api.contentful.com/spaces/564/environments/special/public/content_types/", path);
32243224
}
32253225

32263226
[Fact]

Contentful.Core/Contentful.Core.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1919
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
2020
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
21-
<AssemblyVersion>4.2.0.0</AssemblyVersion>
22-
<FileVersion>4.2.0.0</FileVersion>
23-
<Version>4.2.0</Version>
21+
<AssemblyVersion>4.3.0.0</AssemblyVersion>
22+
<FileVersion>4.3.0.0</FileVersion>
23+
<Version>4.3.0</Version>
2424
</PropertyGroup>
2525
<ItemGroup>
2626
<PackageReference Include="gitlink" Version="3.1.0">

Contentful.Core/ContentfulManagementClient.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,19 @@ public async Task DeactivateContentType(string contentTypeId, string spaceId = n
319319
/// <returns>An <see cref="IEnumerable{T}"/> of <see cref="ContentType"/>.</returns>
320320
public async Task<IEnumerable<ContentType>> GetActivatedContentTypes(string spaceId = null, CancellationToken cancellationToken = default)
321321
{
322-
var res = await GetAsync($"{_baseUrl}{spaceId ?? _options.SpaceId}/{EnvironmentsBase}public/content_types", cancellationToken).ConfigureAwait(false);
322+
return await GetActivatedContentTypes(null, spaceId, cancellationToken);
323+
}
324+
325+
/// <summary>
326+
/// Get all activated content types of a space.
327+
/// </summary>
328+
/// <param name="queryString">The optional querystring to add additional filtering to the query.</param>
329+
/// <param name="spaceId">The id of the space to get the activated content types of. Will default to the one set when creating the client.</param>
330+
/// <param name="cancellationToken">The optional cancellation token to cancel the operation.</param>
331+
/// <returns>An <see cref="IEnumerable{T}"/> of <see cref="ContentType"/>.</returns>
332+
public async Task<IEnumerable<ContentType>> GetActivatedContentTypes(string queryString, string spaceId = null, CancellationToken cancellationToken = default)
333+
{
334+
var res = await GetAsync($"{_baseUrl}{spaceId ?? _options.SpaceId}/{EnvironmentsBase}public/content_types/{queryString}", cancellationToken).ConfigureAwait(false);
323335

324336
await EnsureSuccessfulResult(res).ConfigureAwait(false);
325337

Contentful.Core/IContentfulManagementClient.cs

+9
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,15 @@ public interface IContentfulManagementClient
301301
/// <returns>An <see cref="IEnumerable{T}"/> of <see cref="ContentType"/>.</returns>
302302
Task<IEnumerable<ContentType>> GetActivatedContentTypes(string spaceId = null, CancellationToken cancellationToken = default);
303303

304+
/// <summary>
305+
/// Get all activated content types of a space.
306+
/// </summary>
307+
/// <param name="queryString">The optional querystring to add additional filtering to the query.</param>
308+
/// <param name="spaceId">The id of the space to get the activated content types of. Will default to the one set when creating the client.</param>
309+
/// <param name="cancellationToken">The optional cancellation token to cancel the operation.</param>
310+
/// <returns>An <see cref="IEnumerable{T}"/> of <see cref="ContentType"/>.</returns>
311+
Task<IEnumerable<ContentType>> GetActivatedContentTypes(string queryString, string spaceId = null, CancellationToken cancellationToken = default);
312+
304313
/// <summary>
305314
/// Gets a collection of all <see cref="Contentful.Core.Models.Management.ApiKey"/> in a space.
306315
/// </summary>

0 commit comments

Comments
 (0)