Skip to content

Commit

Permalink
EN-199 Add options for selecting entities to copy when cloning enviro…
Browse files Browse the repository at this point in the history
…nment
  • Loading branch information
matus12 committed May 28, 2024
1 parent ec7db0f commit 03e053b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Kontent.Ai.Management.Tests/CodeSamples/CmApiV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,10 @@ public async void PostCloneEnvironment()
RolesToActivate = new[]
{
Guid.Parse("2f925111-1457-49d4-a595-0958feae8ae4")
},
CopyDataOptions = new CopyDataOptions {
ContentItemsAssets = true,
ContentItemVersionHistory = false
}
});

Expand Down
21 changes: 21 additions & 0 deletions Kontent.Ai.Management/Models/Environments/CopyDataOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Newtonsoft.Json;

namespace Kontent.Ai.Management.Models.Environments;

/// <summary>
/// Represents options for copying entities
/// </summary>
public class CopyDataOptions
{
/// <summary>
/// Gets or sets an option to copy content items and assets.
/// </summary>
[JsonProperty("content_items_assets")]
public bool ContentItemsAssets { get; set; }

/// <summary>
/// Gets or sets an option to copy version history of content items.
/// </summary>
[JsonProperty("content_item_version_history")]
public bool ContentItemVersionHistory { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ public class EnvironmentCloneModel
/// </summary>
[JsonProperty("roles_to_activate")]
public ICollection<Guid> RolesToActivate { get; set; }

/// <sumary>
/// Gets or sets <see cref="Kontent.Ai.Management.Models.Environments.CopyDataOptions"/> for copying entities.
/// </sumary>
[JsonProperty("copy_data_options")]
public CopyDataOptions CopyDataOptions { get; set; }
}

0 comments on commit 03e053b

Please sign in to comment.