Skip to content

Commit

Permalink
feat(client-amplifyuibuilder): In this release, we have added the abi…
Browse files Browse the repository at this point in the history
…lity to bind events to component level actions.
  • Loading branch information
awstools committed Apr 11, 2022
1 parent 683beb4 commit b7a8349
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 45 deletions.
51 changes: 33 additions & 18 deletions clients/client-amplifyuibuilder/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,8 @@ export namespace UpdateThemeData {
}

/**
* <p>Represents the state configuration when an action modifies a property of another
* element within the same component.</p>
* <p>Represents the state configuration when an action modifies a property of another element
* within the same component.</p>
*/
export interface MutationActionSetStateParameter {
/**
Expand Down Expand Up @@ -1343,14 +1343,15 @@ export namespace ExportThemesResponse {
}

/**
* <p>Represents the event action configuration for an element of a <code>Component</code>
* or <code>ComponentChild</code>. Use for the workflow feature in Amplify Studio
* <p>Represents the event action configuration for an element of a <code>Component</code> or
* <code>ComponentChild</code>. Use for the workflow feature in Amplify Studio
* that allows you to bind events and actions to components. <code>ActionParameters</code>
* defines the action that is performed when an event occurs on the component.</p>
*/
export interface ActionParameters {
/**
* <p>The type of navigation action. Valid values are <code>url</code> and <code>anchor</code>. This value is required for a navigation action.</p>
* <p>The type of navigation action. Valid values are <code>url</code> and <code>anchor</code>.
* This value is required for a navigation action.</p>
*/
type?: ComponentProperty;

Expand All @@ -1360,7 +1361,8 @@ export interface ActionParameters {
url?: ComponentProperty;

/**
* <p>The HTML anchor link to the location to open. Specify this value for a navigation action.</p>
* <p>The HTML anchor link to the location to open. Specify this value for a navigation
* action.</p>
*/
anchor?: ComponentProperty;

Expand All @@ -1370,13 +1372,13 @@ export interface ActionParameters {
target?: ComponentProperty;

/**
* <p>Specifies whether the user should be signed out globally. Specify this value for an auth sign out action.</p>
* <p>Specifies whether the user should be signed out globally. Specify this value for an auth
* sign out action.</p>
*/
global?: ComponentProperty;

/**
* <p>The name of the data model. Use when the action performs an operation on an Amplify DataStore
* model.</p>
* <p>The name of the data model. Use when the action performs an operation on an Amplify DataStore model.</p>
*/
model?: string;

Expand All @@ -1386,8 +1388,9 @@ export interface ActionParameters {
id?: ComponentProperty;

/**
* <p>A dictionary of key-value pairs mapping Amplify Studio properties to fields in a data model. Use when the action
* performs an operation on an Amplify DataStore model.</p>
* <p>A dictionary of key-value pairs mapping Amplify Studio properties to fields
* in a data model. Use when the action performs an operation on an Amplify
* DataStore model.</p>
*/
fields?: { [key: string]: ComponentProperty };

Expand All @@ -1407,9 +1410,9 @@ export namespace ActionParameters {
}

/**
* <p>Describes the configuration of an event. You can bind an event and a corresponding
* action to a <code>Component</code> or a <code>ComponentChild</code>. A button click
* is an example of an event. </p>
* <p>Describes the configuration of an event. You can bind an event and a corresponding action
* to a <code>Component</code> or a <code>ComponentChild</code>. A button click is an example of
* an event. </p>
*/
export interface ComponentEvent {
/**
Expand All @@ -1421,6 +1424,11 @@ export interface ComponentEvent {
* <p>Describes information about the action.</p>
*/
parameters?: ActionParameters;

/**
* <p>Binds an event to an action on a component. When you specify a <code>bindingEvent</code>, the event is called when the action is performed.</p>
*/
bindingEvent?: string;
}

export namespace ComponentEvent {
Expand Down Expand Up @@ -1458,10 +1466,16 @@ export interface ComponentChild {
children?: ComponentChild[];

/**
* <p>Describes the events that can be raised on the child component. Use for the workflow feature in Amplify Studio that allows you to
* bind events and actions to components.</p>
* <p>Describes the events that can be raised on the child component. Use for the workflow
* feature in Amplify Studio that allows you to bind events and actions to
* components.</p>
*/
events?: { [key: string]: ComponentEvent };

/**
* <p>The unique ID of the child component in its original source system, such as Figma.</p>
*/
sourceId?: string;
}

export namespace ComponentChild {
Expand Down Expand Up @@ -1566,8 +1580,9 @@ export interface Component {
tags?: { [key: string]: string };

/**
* <p>Describes the events that can be raised on the component. Use for the workflow feature in Amplify Studio that allows you to
* bind events and actions to components.</p>
* <p>Describes the events that can be raised on the component. Use for the workflow feature in
* Amplify Studio that allows you to bind events and actions to
* components.</p>
*/
events?: { [key: string]: ComponentEvent };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,7 @@ const serializeAws_restJson1ComponentChild = (input: ComponentChild, context: __
input.properties !== null && {
properties: serializeAws_restJson1ComponentProperties(input.properties, context),
}),
...(input.sourceId !== undefined && input.sourceId !== null && { sourceId: input.sourceId }),
};
};

Expand Down Expand Up @@ -1651,6 +1652,7 @@ const serializeAws_restJson1ComponentDataConfiguration = (
const serializeAws_restJson1ComponentEvent = (input: ComponentEvent, context: __SerdeContext): any => {
return {
...(input.action !== undefined && input.action !== null && { action: input.action }),
...(input.bindingEvent !== undefined && input.bindingEvent !== null && { bindingEvent: input.bindingEvent }),
...(input.parameters !== undefined &&
input.parameters !== null && { parameters: serializeAws_restJson1ActionParameters(input.parameters, context) }),
};
Expand Down Expand Up @@ -2189,6 +2191,7 @@ const deserializeAws_restJson1ComponentChild = (output: any, context: __SerdeCon
output.properties !== undefined && output.properties !== null
? deserializeAws_restJson1ComponentProperties(output.properties, context)
: undefined,
sourceId: __expectString(output.sourceId),
} as any;
};

Expand Down Expand Up @@ -2267,6 +2270,7 @@ const deserializeAws_restJson1ComponentDataConfiguration = (
const deserializeAws_restJson1ComponentEvent = (output: any, context: __SerdeContext): ComponentEvent => {
return {
action: __expectString(output.action),
bindingEvent: __expectString(output.bindingEvent),
parameters:
output.parameters !== undefined && output.parameters !== null
? deserializeAws_restJson1ActionParameters(output.parameters, context)
Expand Down
Loading

0 comments on commit b7a8349

Please sign in to comment.