Skip to content

Commit

Permalink
CTC-2504 Add WebSpotlight samples
Browse files Browse the repository at this point in the history
  • Loading branch information
František Záhora authored and František Záhora committed Jul 13, 2024
1 parent 8f8290c commit dc695f3
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
12 changes: 12 additions & 0 deletions net/management-api-v2/GetWebSpotlightStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// DocSection: cm_api_v2_get_web_spotlight_status
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Management;

var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_PROJECT_ID>"
});

var response = await client.GetWebSpotlightStatusAsync();
// EndDocSection
20 changes: 20 additions & 0 deletions net/management-api-v2/PutWebSpotlightActivate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// DocSection: cm_api_v2_put_web_spotlight_activate
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Management;

var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_PROJECT_ID>"
});

var reference = Reference.ById(Guid.Parse("6291c693-f6e4-4a6b-ac67-5c31c32f9388"));
// var reference = Reference.ById("my_web_root_type");

var model = new WebSpotlightActivateModel()
{
RootType = reference
}

var response = await client.ActivateWebSpotlightAsync(model);
// EndDocSection
12 changes: 12 additions & 0 deletions net/management-api-v2/PutWebSpotlightDeactivate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// DocSection: cm_api_v2_put_web_spotlight_deactivate
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Management;

var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_PROJECT_ID>"
});

var response = await client.DeactivateWebSpotlightAsync();
// EndDocSection

0 comments on commit dc695f3

Please sign in to comment.