Skip to content

Commit

Permalink
Unify tips on strongly typed models
Browse files Browse the repository at this point in the history
  • Loading branch information
jancerman committed Jun 7, 2024
1 parent 8eae20d commit 5341439
Show file tree
Hide file tree
Showing 27 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion java/get-content/getting_content_filter_items.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Initializes a DeliveryClient
DeliveryClient client = new DeliveryClient("<YOUR_ENVIRONMENT_ID>");

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Registers the model class for articles
client.registerType(Article.class);

Expand Down
2 changes: 1 addition & 1 deletion java/get-content/getting_content_order_items.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Initializes a DeliveryClient
DeliveryClient client = new DeliveryClient("<YOUR_ENVIRONMENT_ID>");

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Registers the model class for articles
client.registerType(Article.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Initializes a DeliveryClient
DeliveryClient client = new DeliveryClient("<YOUR_ENVIRONMENT_ID>");

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Registers the model class for articles
client.registerType(Article.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Initializes a DeliveryClient
DeliveryClient client = new DeliveryClient("<YOUR_ENVIRONMENT_ID>");

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Registers the model class for articles
client.registerType(Article.class);

Expand Down
2 changes: 1 addition & 1 deletion java/preview-content/preview_content_get_article.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.build();
);

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Registers the model class for articles
client.registerType(Article.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models

import java.lang.String;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Initializes a DeliveryClient
DeliveryClient client = new DeliveryClient("<YOUR_ENVIRONMENT_ID>");

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Registers the model class for simple articles
client.registerType(SimpleArticle.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Initializes a DeliveryClient
DeliveryClient client = new DeliveryClient("<YOUR_ENVIRONMENT_ID>");

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Registers the model class for articles
client.registerType(Page.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models

import java.lang.String;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Initializes a DeliveryClient
DeliveryClient client = new DeliveryClient("8d20758c-d74c-4f59-ae04-ee928c0816b7");

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Registers the model class for navigation items
client.registerType(Homepage.class);

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 @@ -7,7 +7,7 @@
.Build();

// Gets specific elements of an article
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
IDeliveryItemResponse<Article> response = await client.GetItemAsync<Article>("my_article");

Article item = response.Item;
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 @@ -7,7 +7,7 @@
.Build();

// Gets all articles
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
IDeliveryItemListingResponse<Article> response = await client.GetItemsAsync<Article>(
new EqualsFilter("system.type", "article")
);
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 @@ -7,7 +7,7 @@
.Build();

// Gets the 3 latest articles ordered by their last modified time
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
IDeliveryItemListingResponse<Article> response = await client.GetItemsAsync<Article>(
new EqualsFilter("system.type", "article"),
new LimitParameter(3),
Expand Down
2 changes: 1 addition & 1 deletion net/preview-content/preview_content_get_article.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.Build();

// Gets the latest version of a content item
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
IDeliveryItemResponse<Article> response = await client.GetItemAsync<Article>("my_article");

Article item = response.Item;
2 changes: 1 addition & 1 deletion net/retrieve-linked-content/linked_content_author_model.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types

using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.Build();

// Gets a specific article and its linked items
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
IDeliveryItemResponse<SimpleArticle> response = await client.GetItemAsync<SimpleArticle>("the_origin_of_coffee",
new DepthParameter(1)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.Build();

// Gets a specific page, its subpages, and linked items
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
IDeliveryItemResponse<Page> response = await client.GetItemAsync<Page>("insurance_listing",
new DepthParameter(1)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types

using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.Build();

// Gets a specific content item
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
IDeliveryItemResponse<Article> response = await client.GetItemAsync<Article>("my_article");

Article item = response.Item;
2 changes: 1 addition & 1 deletion net/using-webhooks/using_webhooks_get_latest_content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
.Build();

// Gets a content item
// Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
IDeliveryItemResponse<Article> response = await client.GetItemAsync<Article>("my_article");

Article item = response.Item;
2 changes: 1 addition & 1 deletion ts/delivery-api/delivery_api_get_item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export type Article = IContentItem<{
related_articles: Article[];
}>;

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
const response = await deliveryClient.item<Article>('my_article')
.toPromise();
2 changes: 1 addition & 1 deletion ts/delivery-api/delivery_api_get_item_preview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { IContentItem, createDeliveryClient, Elements } from '@kontent-ai/delivery-sdk';

// Create strongly typed models according to https://kontent.ai/learn/tutorials/develop-apps/get-content/using-strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/tutorials/develop-apps/get-content/using-strongly-typed-models
export type Article = IContentItem<{
title: Elements.TextElement;
summary: Elements.RichTextElement;
Expand Down
2 changes: 1 addition & 1 deletion ts/retrieve-linked-content/linked_content_author_model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
import { IContentItem, Elements } from '@kontent-ai/delivery-sdk';

export type Author = IContentItem<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { IContentItem, Elements } from '@kontent-ai/delivery-sdk';
import { Author } from './models/author';

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
export type SimpleArticle = IContentItem<{
title: Elements.TextElement;
body: Elements.RichTextElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { IContentItem, createDeliveryClient, Elements } from '@kontent-ai/delivery-sdk';

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
export type Article = IContentItem<{
title: Elements.TextElement;
summary: Elements.TextElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const deliveryClient = createDeliveryClient({
environmentId: '<YOUR_ENVIRONMENT_ID>'
});

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
export type Article = IContentItem<{
title: Elements.TextElement;
body: Elements.RichTextElement;
Expand Down
2 changes: 1 addition & 1 deletion ts/structure-in-rte/structure_in_rte_resolve_tweet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const deliveryClient = createDeliveryClient({
environmentId: '<YOUR_ENVIRONMENT_ID>'
});

// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Tip: Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
export type Article = IContentItem<{
title: Elements.TextElement;
body: Elements.RichTextElement;
Expand Down

0 comments on commit 5341439

Please sign in to comment.