-
Notifications
You must be signed in to change notification settings - Fork 43
[MOB-11550] creates iterableEmbeddedMessageButton class #655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { IterableEmbeddedMessageElementsButtonAction } from './IterableEmbeddedMessageElementsButtonAction'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| /** | ||
| * IterableEmbeddedMessageElementsButton represents a button in an embedded message. | ||
| */ | ||
| export class IterableEmbeddedMessageElementsButton { | ||
|
evantk91 marked this conversation as resolved.
|
||
| /** The ID for the embedded message button */ | ||
| readonly id: string; | ||
| /** The title for the embedded message button */ | ||
| readonly title?: string; | ||
| /** The action for the embedded message button */ | ||
| readonly action?: IterableEmbeddedMessageElementsButtonAction; | ||
|
|
||
| /** | ||
| * Creates an instance of IterableEmbeddedMessageButton. | ||
| * | ||
| * @param id - The ID for the embedded message button. | ||
| * @param title - The title for the embedded message button. | ||
| * @param action - The action for the embedded message button. | ||
| */ | ||
| constructor( | ||
| id: string, | ||
| title?: string, | ||
| action?: IterableEmbeddedMessageElementsButtonAction | ||
| ) { | ||
| this.id = id; | ||
| this.title = title; | ||
| this.action = action; | ||
| } | ||
|
|
||
| /** | ||
| * Creates an instance of `IterableEmbeddedMessageButton` from a dictionary object. | ||
| * | ||
| * @param dict - The dictionary object containing the properties to initialize the `IterableEmbeddedMessageButton` instance. | ||
| * @returns A new instance of `IterableEmbeddedMessageButton` initialized with the provided dictionary properties. | ||
| */ | ||
| static fromDict( | ||
| dict: Partial<EmbeddedMessageElementsButtonDict> | ||
| ): IterableEmbeddedMessageElementsButton { | ||
| if (!dict.id) { | ||
| throw new Error('id is required'); | ||
| } | ||
| const action = dict.action | ||
| ? IterableEmbeddedMessageElementsButtonAction.fromDict(dict.action) | ||
| : undefined; | ||
| return new IterableEmbeddedMessageElementsButton( | ||
| dict.id, | ||
| dict.title, | ||
| action | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * An interface defining the dictionary object containing the properties for the embedded message button. | ||
| */ | ||
| export interface EmbeddedMessageElementsButtonDict { | ||
| id: string; | ||
|
evantk91 marked this conversation as resolved.
|
||
| title?: string; | ||
| action?: IterableEmbeddedMessageElementsButtonAction; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /** | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| * IterableEmbeddedMessageElementsButtonAction represents an action defined as a response to user events | ||
| * for an embedded message button. | ||
| */ | ||
| export class IterableEmbeddedMessageElementsButtonAction { | ||
|
evantk91 marked this conversation as resolved.
|
||
| /** | ||
| * The type of iterable action | ||
| * For custom actions, the type is `action://` prefix followed by a custom action name | ||
| */ | ||
| readonly type: string; | ||
|
|
||
| /** | ||
| * The url for the action when the type is `openUrl` | ||
| * For custom actions, data is empty | ||
| */ | ||
| readonly data?: string; | ||
|
|
||
| /** | ||
| * Creates an instance of IterableEmbeddedMessageElementsButtonAction. | ||
| * | ||
| * @param type - The type of the action. | ||
| * @param data - Optional data associated with the action. | ||
| */ | ||
| constructor(type: string, data?: string) { | ||
| this.type = type; | ||
| this.data = data; | ||
| } | ||
|
|
||
| /** | ||
| * Creates an instance of `IterableEmbeddedMessageElementsButtonAction` from a dictionary object. | ||
| * | ||
| * @param dict - The dictionary object containing the properties to initialize the `IterableEmbeddedMessageElementsButtonAction` instance. | ||
| * @returns A new instance of `IterableEmbeddedMessageElementsButtonAction` initialized with the provided dictionary properties. | ||
| */ | ||
| static fromDict( | ||
| dict: Partial<EmbeddedMessageButtonActionDict> | ||
| ): IterableEmbeddedMessageElementsButtonAction { | ||
| if (!dict.type) { | ||
| throw new Error('type is required'); | ||
| } | ||
| return new IterableEmbeddedMessageElementsButtonAction( | ||
| dict.type, | ||
| dict.data | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * An interface defining the dictionary object containing the properties for the embedded message button action. | ||
| */ | ||
| export interface EmbeddedMessageButtonActionDict { | ||
| type: string; | ||
|
evantk91 marked this conversation as resolved.
|
||
| data?: string; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]