Skip to content

Commit

Permalink
-more feedback from pr and adding ContentType enum
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenedicadb committed Jun 25, 2024
1 parent 111fa55 commit 1e51d97
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 2 deletions.
4 changes: 4 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ module.exports = {
title: "ContentCardSchemaData",
path: "/edge/adobe-journey-optimizer/public-classes/content-card-schema-data"
},
{
title: "ContentType",
path: "/edge/adobe-journey-optimizer/public-classes/content-type"
},
{
title: "HtmlContentSchemaData",
path: "/edge/adobe-journey-optimizer/public-classes/html-content-schema-data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ public void track(final String interaction, final MessagingEdgeEventType eventTy
ContentCard contentCard;

// tracking a display
contentCardSchemaData.track(null, MessagingEdgeEventType.display);
contentCard.track(null, MessagingEdgeEventType.display);

// tracking a user interaction
contentCardSchemaData.track("itemSelected", MessagingEdgeEventType.interact);
contentCard.track("itemSelected", MessagingEdgeEventType.interact);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: ContentType
description: Enum representing the ContentTypes used in schema-based objects.
keywords:
- Adobe Journey Optimizer
- Messaging
- iOS
- Android
- Proposition
- Schema
- ContentType
- Content type
---

import Tabs from './tabs/content-type.md'

# Enum - ContentType

Enum representing content types found within a schema object.

## Definition

<TabsBlock orientation="horizontal" slots="heading, content" repeat="2"/>

Android

<Tabs query="platform=android&function=enum"/>

iOS

<Tabs query="platform=ios&function=enum"/>

## String values

Below is the table of values returned by calling the `toString` method for each case:

<TabsBlock orientation="horizontal" slots="heading, content" repeat="2"/>

Android

<Tabs query="platform=android&function=string-values"/>

iOS

<Tabs query="platform=ios&function=string-values"/>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This documents lists details about the public classes and enums available in Mes
* [Class - Proposition](./proposition.md)
* [Class - PropositionItem](./proposition-item.md)
* [Class - Surface](./surface.md)
* [Enum - ContentType](./content-type.md)
* [Enum - MessagingEdgeEventType](./messaging-edge-event-type.md)
* [Schema Class - ContentCardSchemaData](./content-card-schema-data.md)
* [Schema Class - HtmlContentSchemaData](./html-content-schema-data.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
noIndex: true
---

<Variant platform="android" function="enum" repeat="2"/>

#### Java

```java
public enum ContentType {
APPLICATION_JSON(0),
TEXT_HTML(1),
TEXT_XML(2),
TEXT_PLAIN(3),
UNKNOWN(4);

@Override
public String toString();
}
```

<Variant platform="ios" function="enum" repeat="2"/>

#### Swift

```swift
@objc(AEPContentType)
public enum ContentType: Int, Codable {
case applicationJson = 0
case textHtml = 1
case textXml = 2
case textPlain = 3
case unknown = 4

public func toString() -> String
}
```

<Variant platform="android" function="string-values" repeat="1"/>

| Case | String value |
| ---- | ------------ |
| `APPLICATION_JSON` | `application/json` |
| `TEXT_HTML` | `text/html` |
| `TEXT_XML` | `text/xml` |
| `TEXT_PLAIN` | `text/plain` |
| `UNKNOWN` | (empty string) |

<Variant platform="ios" function="string-values" repeat="1"/>

| Case | String value |
| ---- | ------------ |
| `.applicationJson` | `application/json` |
| `.testHtml` | `text/html` |
| `.textXml` | `text/xml` |
| `.textPlain` | `text/plain` |
| `.unknown` | (empty string) |

0 comments on commit 1e51d97

Please sign in to comment.