Skip to content

Commit

Permalink
Replace ProjectId with EnvironmentId
Browse files Browse the repository at this point in the history
  • Loading branch information
jancerman committed Dec 3, 2024
1 parent c2a1d6b commit 952d97d
Show file tree
Hide file tree
Showing 151 changed files with 161 additions and 173 deletions.
2 changes: 1 addition & 1 deletion net/apply-asset-renditions/apply_asset_renditions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Initializes a Delivery client
_client = DeliveryClientBuilder
.WithOptions(builder => builder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.UseProductionApi()
.Build())
.Build();
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_element.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.Build();

// Gets the model of specific element within a specific content type
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.Build();

// Gets specific elements of an article
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_item_preview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Initializes a delivery client for previewing content
IDeliveryClient client = DeliveryClientBuilder
.WithOptions(builder => builder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.UsePreviewApi("<YOUR_PREVIEW_API_KEY>")
.Build())
.Build();
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_items.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.Build();

// Gets specific elements of 3 articles ordered by the "Post date" element
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_items_feed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Creates an instance of the delivery client; see https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.Build();

// Gets feed of all articles in the project
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_languages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.Build();

// Gets 3 languages
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_taxonomy_group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.Build();

// Gets a specific taxonomy group
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_taxonomy_groups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.Build();

// Gets 3 taxonomy groups
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.Build();

// Gets a specific content type
Expand Down
2 changes: 1 addition & 1 deletion net/delivery-api/delivery_api_get_types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("<YOUR_ENVIRONMENT_ID>")
.WithEnvironmentId("KONTENT_AI_ENVIRONMENT_ID")
.Build();

// Gets 3 content types
Expand Down
2 changes: 1 addition & 1 deletion net/get-content/getting_content_filter_items.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.WithEnvironmentId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.Build();

// Gets all articles
Expand Down
2 changes: 1 addition & 1 deletion net/get-content/getting_content_get_items.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.WithEnvironmentId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.Build();

// Gets all content items
Expand Down
2 changes: 1 addition & 1 deletion net/get-content/getting_content_order_items.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.WithEnvironmentId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.Build();

// Gets the 3 latest articles ordered by their last modified time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.WithEnvironmentId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.Build();

// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.WithEnvironmentId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.Build();

// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
Expand Down
2 changes: 1 addition & 1 deletion net/get-localized-content/language_fallbacks_ignore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("975bf280-fd91-488c-994c-2f04416e5ee3")
.WithEnvironmentId("975bf280-fd91-488c-994c-2f04416e5ee3")
.Build();

// Gets content items in Spanish without following language fallbacks
Expand Down
2 changes: 1 addition & 1 deletion net/import-assets/importing_assets_create_asset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

// Uses the file reference object obtained in step 1
Expand Down
2 changes: 1 addition & 1 deletion net/import-assets/importing_assets_upload_file.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var filePath = Path.Combine(Environment.CurrentDirectory, "Data", "brno-cafe-1080px.jpg");
Expand Down
2 changes: 1 addition & 1 deletion net/import-assets/importing_assets_use_asset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});
var identifier = new LanguageVariantIdentifier(Reference.ByExternalId("ext-cafe-brno"), Reference.ByCodename("en-US"));

Expand Down
2 changes: 1 addition & 1 deletion net/import-assets/importing_assets_use_asset_rich_text.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var identifier = new LanguageVariantIdentifier(Reference.ByExternalId("new-cafes"), Reference.ByCodename("en-US"));
Expand Down
2 changes: 1 addition & 1 deletion net/import-content-items/importing_create_item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

await client.UpsertContentItemAsync(
Expand Down
2 changes: 1 addition & 1 deletion net/import-content-items/importing_create_type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var response = await client.CreateContentTypeAsync(new ContentTypeCreateModel
Expand Down
2 changes: 1 addition & 1 deletion net/import-content-items/importing_upsert_variant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var response = await client.UpsertLanguageVariantAsync(identifier, new LanguageVariantUpsertModel
Expand Down
2 changes: 1 addition & 1 deletion net/import-content-model/import_model_create_snippet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var response = await client.CreateContentTypeSnippetAsync(new ContentTypeSnippetCreateModel
Expand Down
2 changes: 1 addition & 1 deletion net/import-content-model/import_model_create_taxonomy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var response = await client.CreateTaxonomyGroupAsync(new TaxonomyGroupCreateModel
Expand Down
2 changes: 1 addition & 1 deletion net/import-content-model/import_model_create_type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var response = await client.CreateContentTypeAsync(new ContentTypeCreateModel
Expand Down
2 changes: 1 addition & 1 deletion net/import-linked-content/import_linked_create_item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

await client.UpsertContentItemAsync(
Expand Down
2 changes: 1 addition & 1 deletion net/import-linked-content/import_linked_create_sec_item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

await client.UpsertContentItemAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var identifier = new LanguageVariantIdentifier(Reference.ByExternalId("456"), Reference.ByCodename("en-US"));
Expand Down
2 changes: 1 addition & 1 deletion net/import-linked-content/import_linked_upsert_variant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var identifier = new LanguageVariantIdentifier(Reference.ByExternalId("123"), Reference.ByCodename("en-US"));
Expand Down
2 changes: 1 addition & 1 deletion net/import-rich-text/import_rich_create_button_type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var response = await client.CreateContentTypeAsync(new ContentTypeCreateModel
Expand Down
2 changes: 1 addition & 1 deletion net/import-rich-text/import_rich_create_item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

await client.UpsertContentItemAsync(Reference.ByExternalId("simple-example"), new ContentItemUpsertModel
Expand Down
2 changes: 1 addition & 1 deletion net/import-rich-text/import_rich_create_simple_type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var response = await client.CreateContentTypeAsync(new ContentTypeCreateModel
Expand Down
2 changes: 1 addition & 1 deletion net/import-rich-text/import_rich_upsert_variant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var identifier = new LanguageVariantIdentifier(Reference.ByExternalId("simple-example"), Reference.ById(Guid.Parse("00000000-0000-0000-0000-000000000000")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Tip: Use DI for this in your apps https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.WithEnvironmentId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.Build();

// Gets navigation items and their linked items
Expand Down
2 changes: 1 addition & 1 deletion net/management-api-v2/cm_api_v2_clone_environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var response = await client.CloneEnvironmentAsync(new EnvironmentCloneModel
Expand Down
2 changes: 1 addition & 1 deletion net/management-api-v2/cm_api_v2_delete_asset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var identifier = Reference.ById(Guid.Parse("fcbb12e6-66a3-4672-85d9-d502d16b8d9c"));
Expand Down
4 changes: 1 addition & 3 deletions net/management-api-v2/cm_api_v2_delete_custom_app.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// DocSection: cm_api_v2_delete_custom_app
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Management;

Expand All @@ -11,5 +10,4 @@
var identifier = Reference.ById(Guid.Parse("f4b3fc05-e988-4dae-9ac1-a94aba566474"));
//var identifier = Reference.ByCodename("my_custom_app");

var response = await client.DeleteCustomAppAsync(identifier);
// EndDocSection
var response = await client.DeleteCustomAppAsync(identifier);
2 changes: 1 addition & 1 deletion net/management-api-v2/cm_api_v2_delete_environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

await client.DeleteEnvironmentAsync();
2 changes: 1 addition & 1 deletion net/management-api-v2/cm_api_v2_delete_item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var identifier = Reference.ById(Guid.Parse("f4b3fc05-e988-4dae-9ac1-a94aba566474"));
Expand Down
2 changes: 1 addition & 1 deletion net/management-api-v2/cm_api_v2_delete_legacy_webhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var identifier = Reference.ById(Guid.Parse("d53360f7-79e1-42f4-a524-1b53a417d03e"));
Expand Down
2 changes: 1 addition & 1 deletion net/management-api-v2/cm_api_v2_delete_snippet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});

var identifier = Reference.ById(Guid.Parse("baf884be-531f-441f-ae88-64205efdd0f6"));
Expand Down
Loading

0 comments on commit 952d97d

Please sign in to comment.