Skip to content

Commit b701066

Browse files
author
awstools
committed
feat(client-connectparticipant): Amazon Connect Participant Service adds the ability to get a view resource using a view token, which is provided in a participant message, with the release of the DescribeView API.
1 parent 7e05d81 commit b701066

File tree

10 files changed

+991
-253
lines changed

10 files changed

+991
-253
lines changed

clients/client-connectparticipant/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,14 @@ CreateParticipantConnection
226226

227227
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connectparticipant/classes/createparticipantconnectioncommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connectparticipant/interfaces/createparticipantconnectioncommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connectparticipant/interfaces/createparticipantconnectioncommandoutput.html)
228228

229+
</details>
230+
<details>
231+
<summary>
232+
DescribeView
233+
</summary>
234+
235+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connectparticipant/classes/describeviewcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connectparticipant/interfaces/describeviewcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connectparticipant/interfaces/describeviewcommandoutput.html)
236+
229237
</details>
230238
<details>
231239
<summary>

clients/client-connectparticipant/src/ConnectParticipant.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import {
1212
CreateParticipantConnectionCommandInput,
1313
CreateParticipantConnectionCommandOutput,
1414
} from "./commands/CreateParticipantConnectionCommand";
15+
import {
16+
DescribeViewCommand,
17+
DescribeViewCommandInput,
18+
DescribeViewCommandOutput,
19+
} from "./commands/DescribeViewCommand";
1520
import {
1621
DisconnectParticipantCommand,
1722
DisconnectParticipantCommandInput,
@@ -39,6 +44,7 @@ import { ConnectParticipantClient, ConnectParticipantClientConfig } from "./Conn
3944
const commands = {
4045
CompleteAttachmentUploadCommand,
4146
CreateParticipantConnectionCommand,
47+
DescribeViewCommand,
4248
DisconnectParticipantCommand,
4349
GetAttachmentCommand,
4450
GetTranscriptCommand,
@@ -82,6 +88,17 @@ export interface ConnectParticipant {
8288
cb: (err: any, data?: CreateParticipantConnectionCommandOutput) => void
8389
): void;
8490

91+
/**
92+
* @see {@link DescribeViewCommand}
93+
*/
94+
describeView(args: DescribeViewCommandInput, options?: __HttpHandlerOptions): Promise<DescribeViewCommandOutput>;
95+
describeView(args: DescribeViewCommandInput, cb: (err: any, data?: DescribeViewCommandOutput) => void): void;
96+
describeView(
97+
args: DescribeViewCommandInput,
98+
options: __HttpHandlerOptions,
99+
cb: (err: any, data?: DescribeViewCommandOutput) => void
100+
): void;
101+
85102
/**
86103
* @see {@link DisconnectParticipantCommand}
87104
*/

clients/client-connectparticipant/src/ConnectParticipantClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import {
6464
CreateParticipantConnectionCommandInput,
6565
CreateParticipantConnectionCommandOutput,
6666
} from "./commands/CreateParticipantConnectionCommand";
67+
import { DescribeViewCommandInput, DescribeViewCommandOutput } from "./commands/DescribeViewCommand";
6768
import {
6869
DisconnectParticipantCommandInput,
6970
DisconnectParticipantCommandOutput,
@@ -93,6 +94,7 @@ export { __Client };
9394
export type ServiceInputTypes =
9495
| CompleteAttachmentUploadCommandInput
9596
| CreateParticipantConnectionCommandInput
97+
| DescribeViewCommandInput
9698
| DisconnectParticipantCommandInput
9799
| GetAttachmentCommandInput
98100
| GetTranscriptCommandInput
@@ -106,6 +108,7 @@ export type ServiceInputTypes =
106108
export type ServiceOutputTypes =
107109
| CompleteAttachmentUploadCommandOutput
108110
| CreateParticipantConnectionCommandOutput
111+
| DescribeViewCommandOutput
109112
| DisconnectParticipantCommandOutput
110113
| GetAttachmentCommandOutput
111114
| GetTranscriptCommandOutput
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
5+
import { Command as $Command } from "@smithy/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@smithy/types";
15+
16+
import {
17+
ConnectParticipantClientResolvedConfig,
18+
ServiceInputTypes,
19+
ServiceOutputTypes,
20+
} from "../ConnectParticipantClient";
21+
import { DescribeViewRequest, DescribeViewResponse, DescribeViewResponseFilterSensitiveLog } from "../models/models_0";
22+
import { de_DescribeViewCommand, se_DescribeViewCommand } from "../protocols/Aws_restJson1";
23+
24+
/**
25+
* @public
26+
*/
27+
export { __MetadataBearer, $Command };
28+
/**
29+
* @public
30+
*
31+
* The input for {@link DescribeViewCommand}.
32+
*/
33+
export interface DescribeViewCommandInput extends DescribeViewRequest {}
34+
/**
35+
* @public
36+
*
37+
* The output of {@link DescribeViewCommand}.
38+
*/
39+
export interface DescribeViewCommandOutput extends DescribeViewResponse, __MetadataBearer {}
40+
41+
/**
42+
* @public
43+
* <p>Retrieves the view for the specified view token.</p>
44+
* @example
45+
* Use a bare-bones client and the command you need to make an API call.
46+
* ```javascript
47+
* import { ConnectParticipantClient, DescribeViewCommand } from "@aws-sdk/client-connectparticipant"; // ES Modules import
48+
* // const { ConnectParticipantClient, DescribeViewCommand } = require("@aws-sdk/client-connectparticipant"); // CommonJS import
49+
* const client = new ConnectParticipantClient(config);
50+
* const input = { // DescribeViewRequest
51+
* ViewToken: "STRING_VALUE", // required
52+
* ConnectionToken: "STRING_VALUE", // required
53+
* };
54+
* const command = new DescribeViewCommand(input);
55+
* const response = await client.send(command);
56+
* // { // DescribeViewResponse
57+
* // View: { // View
58+
* // Id: "STRING_VALUE",
59+
* // Arn: "STRING_VALUE",
60+
* // Name: "STRING_VALUE",
61+
* // Version: Number("int"),
62+
* // Content: { // ViewContent
63+
* // InputSchema: "STRING_VALUE",
64+
* // Template: "STRING_VALUE",
65+
* // Actions: [ // ViewActions
66+
* // "STRING_VALUE",
67+
* // ],
68+
* // },
69+
* // },
70+
* // };
71+
*
72+
* ```
73+
*
74+
* @param DescribeViewCommandInput - {@link DescribeViewCommandInput}
75+
* @returns {@link DescribeViewCommandOutput}
76+
* @see {@link DescribeViewCommandInput} for command's `input` shape.
77+
* @see {@link DescribeViewCommandOutput} for command's `response` shape.
78+
* @see {@link ConnectParticipantClientResolvedConfig | config} for ConnectParticipantClient's `config` shape.
79+
*
80+
* @throws {@link AccessDeniedException} (client fault)
81+
* <p>You do not have sufficient access to perform this action.</p>
82+
*
83+
* @throws {@link InternalServerException} (server fault)
84+
* <p>This exception occurs when there is an internal failure in the Amazon Connect service.</p>
85+
*
86+
* @throws {@link ResourceNotFoundException} (client fault)
87+
* <p>The resource was not found.</p>
88+
*
89+
* @throws {@link ThrottlingException} (client fault)
90+
* <p>The request was denied due to request throttling.</p>
91+
*
92+
* @throws {@link ValidationException} (client fault)
93+
* <p>The input fails to satisfy the constraints specified by Amazon Connect.</p>
94+
*
95+
* @throws {@link ConnectParticipantServiceException}
96+
* <p>Base exception class for all service exceptions from ConnectParticipant service.</p>
97+
*
98+
*/
99+
export class DescribeViewCommand extends $Command<
100+
DescribeViewCommandInput,
101+
DescribeViewCommandOutput,
102+
ConnectParticipantClientResolvedConfig
103+
> {
104+
// Start section: command_properties
105+
// End section: command_properties
106+
107+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
108+
return {
109+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
110+
Endpoint: { type: "builtInParams", name: "endpoint" },
111+
Region: { type: "builtInParams", name: "region" },
112+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
113+
};
114+
}
115+
116+
/**
117+
* @public
118+
*/
119+
constructor(readonly input: DescribeViewCommandInput) {
120+
// Start section: command_constructor
121+
super();
122+
// End section: command_constructor
123+
}
124+
125+
/**
126+
* @internal
127+
*/
128+
resolveMiddleware(
129+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
130+
configuration: ConnectParticipantClientResolvedConfig,
131+
options?: __HttpHandlerOptions
132+
): Handler<DescribeViewCommandInput, DescribeViewCommandOutput> {
133+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
134+
this.middlewareStack.use(getEndpointPlugin(configuration, DescribeViewCommand.getEndpointParameterInstructions()));
135+
136+
const stack = clientStack.concat(this.middlewareStack);
137+
138+
const { logger } = configuration;
139+
const clientName = "ConnectParticipantClient";
140+
const commandName = "DescribeViewCommand";
141+
const handlerExecutionContext: HandlerExecutionContext = {
142+
logger,
143+
clientName,
144+
commandName,
145+
inputFilterSensitiveLog: (_: any) => _,
146+
outputFilterSensitiveLog: DescribeViewResponseFilterSensitiveLog,
147+
};
148+
const { requestHandler } = configuration;
149+
return stack.resolve(
150+
(request: FinalizeHandlerArguments<any>) =>
151+
requestHandler.handle(request.request as __HttpRequest, options || {}),
152+
handlerExecutionContext
153+
);
154+
}
155+
156+
/**
157+
* @internal
158+
*/
159+
private serialize(input: DescribeViewCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
160+
return se_DescribeViewCommand(input, context);
161+
}
162+
163+
/**
164+
* @internal
165+
*/
166+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DescribeViewCommandOutput> {
167+
return de_DescribeViewCommand(output, context);
168+
}
169+
170+
// Start section: command_body_extra
171+
// End section: command_body_extra
172+
}

clients/client-connectparticipant/src/commands/GetTranscriptCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export interface GetTranscriptCommandOutput extends GetTranscriptResponse, __Met
8282
* // Type: "TYPING" || "PARTICIPANT_JOINED" || "PARTICIPANT_LEFT" || "CHAT_ENDED" || "TRANSFER_SUCCEEDED" || "TRANSFER_FAILED" || "MESSAGE" || "EVENT" || "ATTACHMENT" || "CONNECTION_ACK" || "MESSAGE_DELIVERED" || "MESSAGE_READ",
8383
* // ParticipantId: "STRING_VALUE",
8484
* // DisplayName: "STRING_VALUE",
85-
* // ParticipantRole: "AGENT" || "CUSTOMER" || "SYSTEM",
85+
* // ParticipantRole: "AGENT" || "CUSTOMER" || "SYSTEM" || "CUSTOM_BOT",
8686
* // Attachments: [ // Attachments
8787
* // { // AttachmentItem
8888
* // ContentType: "STRING_VALUE",

clients/client-connectparticipant/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
export * from "./CompleteAttachmentUploadCommand";
33
export * from "./CreateParticipantConnectionCommand";
4+
export * from "./DescribeViewCommand";
45
export * from "./DisconnectParticipantCommand";
56
export * from "./GetAttachmentCommand";
67
export * from "./GetTranscriptCommand";

clients/client-connectparticipant/src/endpoint/ruleset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ o={[t]:"booleanEquals",[u]:[true,{[t]:f,[u]:[n,"supportsDualStack"]}]},
2828
p=[j],
2929
q=[k],
3030
r=[{[v]:"Region"}];
31-
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[t]:a,[u]:[i]}],type:b,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]}]},{type:b,rules:[{conditions:[{[t]:a,[u]:r}],type:b,rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[m,o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://participant.connect-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:p,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{conditions:[{[t]:"stringEquals",[u]:["aws-us-gov",{[t]:f,[u]:[n,"name"]}]}],endpoint:{url:"https://participant.connect.{Region}.amazonaws.com",properties:l,headers:l},type:d},{endpoint:{url:"https://participant.connect-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:q,type:b,rules:[{conditions:[o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://participant.connect.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://participant.connect.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
31+
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[t]:a,[u]:[i]}],type:b,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]},{conditions:[{[t]:a,[u]:r}],type:b,rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[m,o],type:b,rules:[{endpoint:{url:"https://participant.connect-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:p,type:b,rules:[{conditions:[m],type:b,rules:[{conditions:[{[t]:"stringEquals",[u]:["aws-us-gov",{[t]:f,[u]:[n,"name"]}]}],endpoint:{url:"https://participant.connect.{Region}.amazonaws.com",properties:l,headers:l},type:d},{endpoint:{url:"https://participant.connect-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:q,type:b,rules:[{conditions:[o],type:b,rules:[{endpoint:{url:"https://participant.connect.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://participant.connect.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"Invalid Configuration: Missing Region",type:c}]};
3232
export const ruleSet: RuleSetObject = _data;

0 commit comments

Comments
 (0)