@azure-tools/communication-short-codes 1.0.0-beta.1 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +596 -267
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/generated/src/index.js +1 -1
  5. package/dist-esm/src/generated/src/index.js.map +1 -1
  6. package/dist-esm/src/generated/src/models/index.js.map +1 -1
  7. package/dist-esm/src/generated/src/models/mappers.js +153 -91
  8. package/dist-esm/src/generated/src/models/mappers.js.map +1 -1
  9. package/dist-esm/src/generated/src/models/parameters.js +48 -2
  10. package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
  11. package/dist-esm/src/generated/src/operations/index.js +1 -1
  12. package/dist-esm/src/generated/src/operations/index.js.map +1 -1
  13. package/dist-esm/src/generated/src/operations/shortCodesOperations.js +561 -0
  14. package/dist-esm/src/generated/src/operations/shortCodesOperations.js.map +1 -0
  15. package/dist-esm/src/generated/src/operationsInterfaces/index.js +9 -0
  16. package/dist-esm/src/generated/src/operationsInterfaces/index.js.map +1 -0
  17. package/dist-esm/src/generated/src/operationsInterfaces/shortCodesOperations.js +9 -0
  18. package/dist-esm/src/generated/src/operationsInterfaces/shortCodesOperations.js.map +1 -0
  19. package/dist-esm/src/generated/src/shortCodesClient.js +70 -5
  20. package/dist-esm/src/generated/src/shortCodesClient.js.map +1 -1
  21. package/dist-esm/src/generated/src/tracing.js +14 -0
  22. package/dist-esm/src/generated/src/tracing.js.map +1 -0
  23. package/dist-esm/src/models.js.map +1 -1
  24. package/dist-esm/src/shortCodesClient.js +53 -76
  25. package/dist-esm/src/shortCodesClient.js.map +1 -1
  26. package/dist-esm/src/utils/constants.js +1 -1
  27. package/dist-esm/src/utils/constants.js.map +1 -1
  28. package/dist-esm/src/utils/index.js +0 -1
  29. package/dist-esm/src/utils/index.js.map +1 -1
  30. package/package.json +42 -40
  31. package/types/communication-short-codes.d.ts +105 -26
  32. package/CHANGELOG.md +0 -10
  33. package/dist-esm/src/generated/src/operations/shortCodes.js +0 -341
  34. package/dist-esm/src/generated/src/operations/shortCodes.js.map +0 -1
  35. package/dist-esm/src/generated/src/shortCodesClientContext.js +0 -38
  36. package/dist-esm/src/generated/src/shortCodesClientContext.js.map +0 -1
  37. package/dist-esm/src/utils/tracing.js +0 -14
  38. package/dist-esm/src/utils/tracing.js.map +0 -1
@@ -1,15 +1,21 @@
1
1
  /// <reference lib="esnext.asynciterable" />
2
- import * as coreHttp from '@azure/core-http';
2
+
3
+ import { CommonClientOptions } from '@azure/core-client';
4
+ import * as coreClient from '@azure/core-client';
3
5
  import { KeyCredential } from '@azure/core-auth';
4
- import { OperationOptions } from '@azure/core-http';
6
+ import { OperationOptions } from '@azure/core-client';
5
7
  import { PagedAsyncIterableIterator } from '@azure/core-paging';
6
- import { PipelineOptions } from '@azure/core-http';
7
- import { RestResponse } from '@azure/core-http';
8
8
  import { TokenCredential } from '@azure/core-auth';
9
9
 
10
+ /** Defines values for AttachmentType. */
11
+ export declare type AttachmentType = "callToAction" | "termsOfService" | "privacyPolicy" | "other";
12
+
10
13
  /** Defines values for BillingFrequency. */
11
14
  export declare type BillingFrequency = "monthly" | "once";
12
15
 
16
+ /** Defines values for CallToActionType. */
17
+ export declare type CallToActionType = "website" | "pointOfSale" | "sms" | "interactiveVoiceResponse";
18
+
13
19
  export declare interface CompanyInformation {
14
20
  /** Legal entity name for customer submitting Program Brief. */
15
21
  name?: string;
@@ -47,6 +53,9 @@ export declare interface CustomerCareInformation {
47
53
  export declare interface DeleteUSProgramBriefOptions extends OperationOptions {
48
54
  }
49
55
 
56
+ /** Defines values for FileType. */
57
+ export declare type FileType = "png" | "jpg" | "jpeg" | "pdf";
58
+
50
59
  /**
51
60
  * Additional options for the Get US Program Brief request.
52
61
  */
@@ -65,28 +74,28 @@ export declare interface ListShortCodesOptions extends ShortCodesGetShortCodesOp
65
74
  export declare interface ListUSProgramBriefsOptions extends OperationOptions {
66
75
  }
67
76
 
68
- /** Defines values for MessageContentCategory. */
69
- export declare type MessageContentCategory = "ringTones" | "smsChat" | "video" | "loyaltyProgramPointsPrizes" | "gifting" | "inApplicationBilling" | "textToScreen" | "games" | "audioChat" | "mmsPictures" | "sweepstakesContestAuction" | "financialBanking" | "premiumWap" | "queryService" | "wallpaperScreensaver" | "voting" | "application" | "mobileGivingDonations" | "coupons" | "loyaltyProgram" | "noPointsPrizes" | "informationalAlerts" | "microBilling" | "trivia" | "entertainmentAlerts" | "accountNotification" | "ageGatedContent" | "conversationalMessaging" | "deliveryNotification" | "education" | "emergencyAlerts" | "fraudAlerts" | "loanArrangement" | "onBehalfOfCarrier" | "political" | "promotionalMarketing" | "publicServiceAnnouncements" | "securityAlerts" | "socialMedia" | "twoFactorAuthentication" | "other";
77
+ /** Defines values for MessageContentType. */
78
+ export declare type MessageContentType = "accountNotificationInformationalAlerts" | "ageGatedContent" | "chatConversationalMessaging" | "deliveryNotification" | "donationsPledge" | "education" | "fraudAlerts" | "loanArrangement" | "loyaltyProgram" | "marketingAndPromotion" | "mmsPicture" | "mmsVideo" | "oneTimePasswordOrMultiFactorAuthentication" | "political" | "publicServiceAnnouncements" | "securityAlerts" | "socialMedia" | "sweepstakesOrContest" | "votingOrPolling" | "other";
70
79
 
71
80
  export declare interface MessageDetails {
72
- /** Applicable message protocols used in the program e.g. SMS, MMS. */
73
- supportedProtocols?: MessageProtocol[];
81
+ /** Applicable message protocol used in the program e.g. SMS or MMS. */
82
+ supportedProtocol?: MessageProtocol;
74
83
  /** Indicates the nature of the messaging associated with the program e.g. 'subscription', 'transaction'. */
75
84
  recurrence?: Recurrence;
76
85
  /**
77
86
  * Message text for mobile terminated message associated with HELP keyword
78
87
  * e.g 'This is the HELP message test.'.
79
88
  */
80
- helpMessage?: string;
89
+ helpAnswerToUser?: string;
81
90
  /**
82
91
  * "Message text for mobile terminated message associated with STOP keyword
83
92
  * e.g. 'This is the STOP message test.'.
84
93
  */
85
- optOutMessage?: string;
86
- optInMessage?: string;
94
+ optOutAnswerToUser?: string;
95
+ optInMessageToUser?: string;
87
96
  /** Keyword used to confirm double Opt-In method e.g. 'JOIN'. */
88
- optInReply?: string;
89
- confirmationMessage?: string;
97
+ optInAnswerFromUser?: string;
98
+ optInConfirmationMessageToUser?: string;
90
99
  /** Describes directionality e.g. oneWay or twoWay */
91
100
  directionality?: MessageDirectionality;
92
101
  /** Provides message exchange examples from and to end user for each supported message content type. */
@@ -119,6 +128,47 @@ export declare type MessageProtocol = "sms" | "mms";
119
128
  /** Defines values for NumberType. */
120
129
  export declare type NumberType = "shortCode" | "alphaId";
121
130
 
131
+ /** A File Attachment for a Program Brief */
132
+ export declare interface ProgramBriefAttachment {
133
+ /** Program Brief Attachment Id. */
134
+ id: string;
135
+ /**
136
+ * Attachment type describing the purpose of the attachment
137
+ * e.g. 'callToAction', 'termsOfService'
138
+ */
139
+ type: AttachmentType;
140
+ /**
141
+ * The name of the file being attached
142
+ * e.g. 'myFile01'
143
+ */
144
+ fileName: string;
145
+ /** File size in bytes. */
146
+ fileSizeInBytes?: number;
147
+ /**
148
+ * The type of file being attached
149
+ * e.g. 'pdf', 'jpg', 'png'
150
+ */
151
+ fileType: FileType;
152
+ /** File content as base 64 encoded string */
153
+ fileContentBase64: string;
154
+ }
155
+
156
+ /** A summary of Program Brief File Attachment data */
157
+ export declare interface ProgramBriefAttachmentSummary {
158
+ /** Program Brief Attachment Id. */
159
+ id?: string;
160
+ /**
161
+ * Attachment type describing the purpose of the attachment
162
+ * e.g. 'callToAction', 'termsOfService'
163
+ */
164
+ type?: AttachmentType;
165
+ /**
166
+ * The name of the attached file
167
+ * e.g. 'myFile01'
168
+ */
169
+ fileName?: string;
170
+ }
171
+
122
172
  /** Defines values for ProgramBriefStatus. */
123
173
  export declare type ProgramBriefStatus = "submitted" | "approved" | "submitNewVanityNumbers" | "updateProgramBrief" | "draft" | "denied";
124
174
 
@@ -145,9 +195,11 @@ export declare interface ProgramDetails {
145
195
  /** URL for the program or company. */
146
196
  url?: string;
147
197
  /** Indicates how the consumer can sign up to the program e.g. 'website', 'pointOfSale' and/or 'sms'. */
148
- signUpTypes?: ProgramSignUpType[];
198
+ callToActionTypes?: CallToActionType[];
149
199
  /** URL for "call to action" image for the program. */
150
- signUpUrl?: string;
200
+ callToActionUrl?: string;
201
+ /** Call to action text. To be provided when InteractiveVoiceResponse is specified as call to action type */
202
+ callToAction?: string;
151
203
  /** URL for program terms of service. */
152
204
  termsOfServiceUrl?: string;
153
205
  /** URL for privacy policy. */
@@ -160,9 +212,6 @@ export declare interface ProgramDetails {
160
212
  expectedDateOfService?: Date;
161
213
  }
162
214
 
163
- /** Defines values for ProgramSignUpType. */
164
- export declare type ProgramSignUpType = "website" | "pointOfSale" | "sms" | "interactiveVoiceResponse";
165
-
166
215
  /** Defines values for Recurrence. */
167
216
  export declare type Recurrence = "subscription" | "transaction";
168
217
 
@@ -207,21 +256,47 @@ export declare class ShortCodesClient {
207
256
  constructor(endpoint: string, credential: KeyCredential, options?: ShortCodesClientOptions);
208
257
  constructor(endpoint: string, credential: TokenCredential, options?: ShortCodesClientOptions);
209
258
  listShortCodes(options?: ListShortCodesOptions): PagedAsyncIterableIterator<ShortCode>;
210
- upsertUSProgramBrief(programBriefId: string, options?: ShortCodesUpsertUSProgramBriefOptionalParams): Promise<RestResponse>;
211
- deleteUSProgramBrief(programBriefId: string, options?: DeleteUSProgramBriefOptions): Promise<RestResponse>;
259
+ upsertUSProgramBrief(programBriefId: string, options?: ShortCodesUpsertUSProgramBriefOptionalParams): Promise<USProgramBrief>;
260
+ deleteUSProgramBrief(programBriefId: string, options?: DeleteUSProgramBriefOptions): Promise<void>;
212
261
  getUSProgramBrief(programBriefId: string, options?: GetUSProgramBriefOptions): Promise<USProgramBrief>;
213
262
  listUSProgramBriefs(options?: ListUSProgramBriefsOptions): PagedAsyncIterableIterator<USProgramBrief>;
214
- submitUSProgramBrief(programBriefId: string, options?: SubmitUSProgramBriefOptions): Promise<RestResponse>;
263
+ submitUSProgramBrief(programBriefId: string, options?: SubmitUSProgramBriefOptions): Promise<USProgramBrief>;
264
+ getUSProgramBriefAttachment(programBriefId: string, attachmentId: string, options?: ShortCodesGetUSProgramBriefAttachmentOptionalParams): Promise<ProgramBriefAttachment>;
265
+ listUSProgramBriefAttachments(programBriefId: string, options?: ShortCodesGetUSProgramBriefAttachmentsOptionalParams): PagedAsyncIterableIterator<ProgramBriefAttachment>;
266
+ deleteUSProgramBriefAttachment(programBriefId: string, attachmentId: string, options?: ShortCodesDeleteUSProgramBriefAttachmentOptionalParams): Promise<void>;
267
+ createOrReplaceUSProgramBriefAttachment(programBriefId: string, attachmentId: string, fileName: string, fileType: FileType, fileContent: string, attachmentType: AttachmentType, options?: ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams): Promise<ProgramBriefAttachment>;
215
268
  }
216
269
 
217
270
  /**
218
271
  * Client options used to configure the ShortCodesClient API requests.
219
272
  */
220
- export declare interface ShortCodesClientOptions extends PipelineOptions {
273
+ export declare interface ShortCodesClientOptions extends CommonClientOptions {
274
+ }
275
+
276
+ /** Optional parameters. */
277
+ export declare interface ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams extends coreClient.OperationOptions {
278
+ /** File size in bytes. */
279
+ fileSizeInBytes?: number;
280
+ }
281
+
282
+ /** Optional parameters. */
283
+ export declare interface ShortCodesDeleteUSProgramBriefAttachmentOptionalParams extends coreClient.OperationOptions {
284
+ }
285
+
286
+ /** Optional parameters. */
287
+ export declare interface ShortCodesGetShortCodesOptionalParams extends coreClient.OperationOptions {
288
+ /** An optional parameter for how many entries to skip, for pagination purposes. */
289
+ skip?: number;
290
+ /** An optional parameter for how many entries to return, for pagination purposes. */
291
+ top?: number;
292
+ }
293
+
294
+ /** Optional parameters. */
295
+ export declare interface ShortCodesGetUSProgramBriefAttachmentOptionalParams extends coreClient.OperationOptions {
221
296
  }
222
297
 
223
298
  /** Optional parameters. */
224
- export declare interface ShortCodesGetShortCodesOptionalParams extends coreHttp.OperationOptions {
299
+ export declare interface ShortCodesGetUSProgramBriefAttachmentsOptionalParams extends coreClient.OperationOptions {
225
300
  /** An optional parameter for how many entries to skip, for pagination purposes. */
226
301
  skip?: number;
227
302
  /** An optional parameter for how many entries to return, for pagination purposes. */
@@ -229,7 +304,7 @@ export declare interface ShortCodesGetShortCodesOptionalParams extends coreHttp.
229
304
  }
230
305
 
231
306
  /** Optional parameters. */
232
- export declare interface ShortCodesUpsertUSProgramBriefOptionalParams extends coreHttp.OperationOptions {
307
+ export declare interface ShortCodesUpsertUSProgramBriefOptionalParams extends coreClient.OperationOptions {
233
308
  /** Data to create new a Program Brief or fields to update an existing Program Brief */
234
309
  body?: USProgramBrief;
235
310
  }
@@ -260,8 +335,10 @@ export declare interface TrafficDetails {
260
335
 
261
336
  /** Describes a messaging use case for a given content type by providing example messages. */
262
337
  export declare interface UseCase {
263
- /** Indicates the messaging content category used in the program e.g. 'ringTones', 'smsChat', 'video', 'loyaltyProgramPointsPrizes', 'gifting', 'inApplicationBilling', 'textToScreen'. */
264
- contentCategory?: MessageContentCategory;
338
+ /** Indicates the messaging content type used in the program e.g. 'accountNotificationInformationalAlerts', 'chatConversationalMessaging', 'mmsVideo', 'socialMedia'. */
339
+ contentType?: MessageContentType;
340
+ /** Indicates the messaging content type used in the program whenever it is not any of the pre-defined content types */
341
+ customContentType?: string;
265
342
  /** Example messages to be sent to and from the end user for the indicated content type. */
266
343
  examples?: MessageExampleSequence[];
267
344
  }
@@ -293,6 +370,8 @@ export declare interface USProgramBrief {
293
370
  companyInformation?: CompanyInformation;
294
371
  messageDetails?: MessageDetails;
295
372
  trafficDetails?: TrafficDetails;
373
+ /** A list of summarized data of attachments currently added to the Program Brief */
374
+ attachments?: ProgramBriefAttachmentSummary[];
296
375
  }
297
376
 
298
377
  export { }
package/CHANGELOG.md DELETED
@@ -1,10 +0,0 @@
1
- # Release History
2
-
3
- ## 1.0.0-beta.1 (2021-11-05)
4
-
5
- The first preview of the Azure Communication Short Codes Client has the following features:
6
-
7
- - Management of US Program Briefs
8
- - Create, Update, Get, List & Delete
9
- - US Program Brief submission for review to opt for a Short Code
10
- - List owned Short Codes
@@ -1,341 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
- import * as coreHttp from "@azure/core-http";
10
- import * as Mappers from "../models/mappers";
11
- import * as Parameters from "../models/parameters";
12
- /** Class representing a ShortCodes. */
13
- export class ShortCodes {
14
- /**
15
- * Initialize a new instance of the class ShortCodes class.
16
- * @param client Reference to the service client
17
- */
18
- constructor(client) {
19
- this.client = client;
20
- }
21
- /**
22
- * Gets the list of short codes for the current resource.
23
- * @param options The options parameters.
24
- */
25
- listShortCodes(options) {
26
- const iter = this.getShortCodesPagingAll(options);
27
- return {
28
- next() {
29
- return iter.next();
30
- },
31
- [Symbol.asyncIterator]() {
32
- return this;
33
- },
34
- byPage: () => {
35
- return this.getShortCodesPagingPage(options);
36
- }
37
- };
38
- }
39
- getShortCodesPagingPage(options) {
40
- return __asyncGenerator(this, arguments, function* getShortCodesPagingPage_1() {
41
- let result = yield __await(this._getShortCodes(options));
42
- yield yield __await(result.shortCodes || []);
43
- let continuationToken = result.nextLink;
44
- while (continuationToken) {
45
- result = yield __await(this._getShortCodesNext(continuationToken, options));
46
- continuationToken = result.nextLink;
47
- yield yield __await(result.shortCodes || []);
48
- }
49
- });
50
- }
51
- getShortCodesPagingAll(options) {
52
- return __asyncGenerator(this, arguments, function* getShortCodesPagingAll_1() {
53
- var e_1, _a;
54
- try {
55
- for (var _b = __asyncValues(this.getShortCodesPagingPage(options)), _c; _c = yield __await(_b.next()), !_c.done;) {
56
- const page = _c.value;
57
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
58
- }
59
- }
60
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
61
- finally {
62
- try {
63
- if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
64
- }
65
- finally { if (e_1) throw e_1.error; }
66
- }
67
- });
68
- }
69
- /**
70
- * Gets the list of US Program Briefs for the current resource.
71
- * @param options The options parameters.
72
- */
73
- listUSProgramBriefs(options) {
74
- const iter = this.getUSProgramBriefsPagingAll(options);
75
- return {
76
- next() {
77
- return iter.next();
78
- },
79
- [Symbol.asyncIterator]() {
80
- return this;
81
- },
82
- byPage: () => {
83
- return this.getUSProgramBriefsPagingPage(options);
84
- }
85
- };
86
- }
87
- getUSProgramBriefsPagingPage(options) {
88
- return __asyncGenerator(this, arguments, function* getUSProgramBriefsPagingPage_1() {
89
- let result = yield __await(this._getUSProgramBriefs(options));
90
- yield yield __await(result.programBriefs || []);
91
- let continuationToken = result.nextLink;
92
- while (continuationToken) {
93
- result = yield __await(this._getUSProgramBriefsNext(continuationToken, options));
94
- continuationToken = result.nextLink;
95
- yield yield __await(result.programBriefs || []);
96
- }
97
- });
98
- }
99
- getUSProgramBriefsPagingAll(options) {
100
- return __asyncGenerator(this, arguments, function* getUSProgramBriefsPagingAll_1() {
101
- var e_2, _a;
102
- try {
103
- for (var _b = __asyncValues(this.getUSProgramBriefsPagingPage(options)), _c; _c = yield __await(_b.next()), !_c.done;) {
104
- const page = _c.value;
105
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
106
- }
107
- }
108
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
109
- finally {
110
- try {
111
- if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
112
- }
113
- finally { if (e_2) throw e_2.error; }
114
- }
115
- });
116
- }
117
- /**
118
- * Gets the list of short codes for the current resource.
119
- * @param options The options parameters.
120
- */
121
- _getShortCodes(options) {
122
- const operationArguments = {
123
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
124
- };
125
- return this.client.sendOperationRequest(operationArguments, getShortCodesOperationSpec);
126
- }
127
- /**
128
- * Creates or updates a US Program Brief.
129
- * @param programBriefId Program Brief Id. Must be a valid GUID
130
- * @param options The options parameters.
131
- */
132
- upsertUSProgramBrief(programBriefId, options) {
133
- const operationArguments = {
134
- programBriefId,
135
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
136
- };
137
- return this.client.sendOperationRequest(operationArguments, upsertUSProgramBriefOperationSpec);
138
- }
139
- /**
140
- * Deletes a US Program Brief.
141
- * @param programBriefId Program Brief Id. Must be a valid GUID
142
- * @param options The options parameters.
143
- */
144
- deleteUSProgramBrief(programBriefId, options) {
145
- const operationArguments = {
146
- programBriefId,
147
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
148
- };
149
- return this.client.sendOperationRequest(operationArguments, deleteUSProgramBriefOperationSpec);
150
- }
151
- /**
152
- * @param programBriefId
153
- * @param options The options parameters.
154
- */
155
- getUSProgramBrief(programBriefId, options) {
156
- const operationArguments = {
157
- programBriefId,
158
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
159
- };
160
- return this.client.sendOperationRequest(operationArguments, getUSProgramBriefOperationSpec);
161
- }
162
- /**
163
- * @param programBriefId
164
- * @param options The options parameters.
165
- */
166
- submitUSProgramBrief(programBriefId, options) {
167
- const operationArguments = {
168
- programBriefId,
169
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
170
- };
171
- return this.client.sendOperationRequest(operationArguments, submitUSProgramBriefOperationSpec);
172
- }
173
- /**
174
- * Gets the list of US Program Briefs for the current resource.
175
- * @param options The options parameters.
176
- */
177
- _getUSProgramBriefs(options) {
178
- const operationArguments = {
179
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
180
- };
181
- return this.client.sendOperationRequest(operationArguments, getUSProgramBriefsOperationSpec);
182
- }
183
- /**
184
- * GetShortCodesNext
185
- * @param nextLink The nextLink from the previous successful call to the GetShortCodes method.
186
- * @param options The options parameters.
187
- */
188
- _getShortCodesNext(nextLink, options) {
189
- const operationArguments = {
190
- nextLink,
191
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
192
- };
193
- return this.client.sendOperationRequest(operationArguments, getShortCodesNextOperationSpec);
194
- }
195
- /**
196
- * GetUSProgramBriefsNext
197
- * @param nextLink The nextLink from the previous successful call to the GetUSProgramBriefs method.
198
- * @param options The options parameters.
199
- */
200
- _getUSProgramBriefsNext(nextLink, options) {
201
- const operationArguments = {
202
- nextLink,
203
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
204
- };
205
- return this.client.sendOperationRequest(operationArguments, getUSProgramBriefsNextOperationSpec);
206
- }
207
- }
208
- // Operation Specifications
209
- const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);
210
- const getShortCodesOperationSpec = {
211
- path: "/shortCodes",
212
- httpMethod: "GET",
213
- responses: {
214
- 200: {
215
- bodyMapper: Mappers.ShortCodes
216
- },
217
- default: {
218
- bodyMapper: Mappers.CommunicationErrorResponse
219
- }
220
- },
221
- queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],
222
- urlParameters: [Parameters.endpoint],
223
- headerParameters: [Parameters.accept],
224
- serializer
225
- };
226
- const upsertUSProgramBriefOperationSpec = {
227
- path: "/shortCodes/countries/US/programBriefs/{programBriefId}",
228
- httpMethod: "PATCH",
229
- responses: {
230
- 200: {
231
- bodyMapper: Mappers.USProgramBrief
232
- },
233
- 201: {
234
- bodyMapper: Mappers.USProgramBrief
235
- },
236
- default: {
237
- bodyMapper: Mappers.CommunicationErrorResponse
238
- }
239
- },
240
- requestBody: Parameters.body,
241
- queryParameters: [Parameters.apiVersion],
242
- urlParameters: [Parameters.endpoint, Parameters.programBriefId],
243
- headerParameters: [Parameters.accept, Parameters.contentType],
244
- mediaType: "json",
245
- serializer
246
- };
247
- const deleteUSProgramBriefOperationSpec = {
248
- path: "/shortCodes/countries/US/programBriefs/{programBriefId}",
249
- httpMethod: "DELETE",
250
- responses: {
251
- 204: {},
252
- default: {
253
- bodyMapper: Mappers.CommunicationErrorResponse
254
- }
255
- },
256
- queryParameters: [Parameters.apiVersion],
257
- urlParameters: [Parameters.endpoint, Parameters.programBriefId],
258
- headerParameters: [Parameters.accept],
259
- serializer
260
- };
261
- const getUSProgramBriefOperationSpec = {
262
- path: "/shortCodes/countries/US/programBriefs/{programBriefId}",
263
- httpMethod: "GET",
264
- responses: {
265
- 200: {
266
- bodyMapper: Mappers.USProgramBrief
267
- },
268
- default: {
269
- bodyMapper: Mappers.CommunicationErrorResponse
270
- }
271
- },
272
- queryParameters: [Parameters.apiVersion],
273
- urlParameters: [Parameters.endpoint, Parameters.programBriefId],
274
- headerParameters: [Parameters.accept],
275
- serializer
276
- };
277
- const submitUSProgramBriefOperationSpec = {
278
- path: "/shortCodes/countries/US/programBriefs/{programBriefId}/:submit",
279
- httpMethod: "POST",
280
- responses: {
281
- 200: {
282
- bodyMapper: Mappers.USProgramBrief
283
- },
284
- default: {
285
- bodyMapper: Mappers.CommunicationErrorResponse
286
- }
287
- },
288
- queryParameters: [Parameters.apiVersion],
289
- urlParameters: [Parameters.endpoint, Parameters.programBriefId],
290
- headerParameters: [Parameters.accept],
291
- serializer
292
- };
293
- const getUSProgramBriefsOperationSpec = {
294
- path: "/shortCodes/countries/US/programBriefs",
295
- httpMethod: "GET",
296
- responses: {
297
- 200: {
298
- bodyMapper: Mappers.USProgramBriefs
299
- },
300
- default: {
301
- bodyMapper: Mappers.CommunicationErrorResponse
302
- }
303
- },
304
- queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],
305
- urlParameters: [Parameters.endpoint],
306
- headerParameters: [Parameters.accept],
307
- serializer
308
- };
309
- const getShortCodesNextOperationSpec = {
310
- path: "{nextLink}",
311
- httpMethod: "GET",
312
- responses: {
313
- 200: {
314
- bodyMapper: Mappers.ShortCodes
315
- },
316
- default: {
317
- bodyMapper: Mappers.CommunicationErrorResponse
318
- }
319
- },
320
- queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],
321
- urlParameters: [Parameters.endpoint, Parameters.nextLink],
322
- headerParameters: [Parameters.accept],
323
- serializer
324
- };
325
- const getUSProgramBriefsNextOperationSpec = {
326
- path: "{nextLink}",
327
- httpMethod: "GET",
328
- responses: {
329
- 200: {
330
- bodyMapper: Mappers.USProgramBriefs
331
- },
332
- default: {
333
- bodyMapper: Mappers.CommunicationErrorResponse
334
- }
335
- },
336
- queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],
337
- urlParameters: [Parameters.endpoint, Parameters.nextLink],
338
- headerParameters: [Parameters.accept],
339
- serializer
340
- };
341
- //# sourceMappingURL=shortCodes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shortCodes.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/shortCodes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AAmBnD,uCAAuC;AACvC,MAAM,OAAO,UAAU;IAGrB;;;OAGG;IACH,YAAY,MAA+B;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,cAAc,CACnB,OAA+C;QAE/C,MAAM,IAAI,GAAG,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAClD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;YAC/C,CAAC;SACF,CAAC;IACJ,CAAC;IAEc,uBAAuB,CACpC,OAA+C;;YAE/C,IAAI,MAAM,GAAG,cAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,C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C,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport * as coreHttp from \"@azure/core-http\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { ShortCodesClientContext } from \"../shortCodesClientContext\";\nimport {\n ShortCode,\n ShortCodesGetShortCodesNextOptionalParams,\n ShortCodesGetShortCodesOptionalParams,\n USProgramBrief,\n ShortCodesGetUSProgramBriefsNextOptionalParams,\n ShortCodesGetUSProgramBriefsOptionalParams,\n ShortCodesGetShortCodesResponse,\n ShortCodesUpsertUSProgramBriefOptionalParams,\n ShortCodesUpsertUSProgramBriefResponse,\n ShortCodesGetUSProgramBriefResponse,\n ShortCodesSubmitUSProgramBriefResponse,\n ShortCodesGetUSProgramBriefsResponse,\n ShortCodesGetShortCodesNextResponse,\n ShortCodesGetUSProgramBriefsNextResponse\n} from \"../models\";\n\n/** Class representing a ShortCodes. */\nexport class ShortCodes {\n private readonly client: ShortCodesClientContext;\n\n /**\n * Initialize a new instance of the class ShortCodes class.\n * @param client Reference to the service client\n */\n constructor(client: ShortCodesClientContext) {\n this.client = client;\n }\n\n /**\n * Gets the list of short codes for the current resource.\n * @param options The options parameters.\n */\n public listShortCodes(\n options?: ShortCodesGetShortCodesOptionalParams\n ): PagedAsyncIterableIterator<ShortCode> {\n const iter = this.getShortCodesPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.getShortCodesPagingPage(options);\n }\n };\n }\n\n private async *getShortCodesPagingPage(\n options?: ShortCodesGetShortCodesOptionalParams\n ): AsyncIterableIterator<ShortCode[]> {\n let result = await this._getShortCodes(options);\n yield result.shortCodes || [];\n let continuationToken = result.nextLink;\n while (continuationToken) {\n result = await this._getShortCodesNext(continuationToken, options);\n continuationToken = result.nextLink;\n yield result.shortCodes || [];\n }\n }\n\n private async *getShortCodesPagingAll(\n options?: ShortCodesGetShortCodesOptionalParams\n ): AsyncIterableIterator<ShortCode> {\n for await (const page of this.getShortCodesPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Gets the list of US Program Briefs for the current resource.\n * @param options The options parameters.\n */\n public listUSProgramBriefs(\n options?: ShortCodesGetUSProgramBriefsOptionalParams\n ): PagedAsyncIterableIterator<USProgramBrief> {\n const iter = this.getUSProgramBriefsPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.getUSProgramBriefsPagingPage(options);\n }\n };\n }\n\n private async *getUSProgramBriefsPagingPage(\n options?: ShortCodesGetUSProgramBriefsOptionalParams\n ): AsyncIterableIterator<USProgramBrief[]> {\n let result = await this._getUSProgramBriefs(options);\n yield result.programBriefs || [];\n let continuationToken = result.nextLink;\n while (continuationToken) {\n result = await this._getUSProgramBriefsNext(continuationToken, options);\n continuationToken = result.nextLink;\n yield result.programBriefs || [];\n }\n }\n\n private async *getUSProgramBriefsPagingAll(\n options?: ShortCodesGetUSProgramBriefsOptionalParams\n ): AsyncIterableIterator<USProgramBrief> {\n for await (const page of this.getUSProgramBriefsPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Gets the list of short codes for the current resource.\n * @param options The options parameters.\n */\n private _getShortCodes(\n options?: ShortCodesGetShortCodesOptionalParams\n ): Promise<ShortCodesGetShortCodesResponse> {\n const operationArguments: coreHttp.OperationArguments = {\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(\n operationArguments,\n getShortCodesOperationSpec\n ) as Promise<ShortCodesGetShortCodesResponse>;\n }\n\n /**\n * Creates or updates a US Program Brief.\n * @param programBriefId Program Brief Id. Must be a valid GUID\n * @param options The options parameters.\n */\n upsertUSProgramBrief(\n programBriefId: string,\n options?: ShortCodesUpsertUSProgramBriefOptionalParams\n ): Promise<ShortCodesUpsertUSProgramBriefResponse> {\n const operationArguments: coreHttp.OperationArguments = {\n programBriefId,\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(\n operationArguments,\n upsertUSProgramBriefOperationSpec\n ) as Promise<ShortCodesUpsertUSProgramBriefResponse>;\n }\n\n /**\n * Deletes a US Program Brief.\n * @param programBriefId Program Brief Id. Must be a valid GUID\n * @param options The options parameters.\n */\n deleteUSProgramBrief(\n programBriefId: string,\n options?: coreHttp.OperationOptions\n ): Promise<coreHttp.RestResponse> {\n const operationArguments: coreHttp.OperationArguments = {\n programBriefId,\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(\n operationArguments,\n deleteUSProgramBriefOperationSpec\n ) as Promise<coreHttp.RestResponse>;\n }\n\n /**\n * @param programBriefId\n * @param options The options parameters.\n */\n getUSProgramBrief(\n programBriefId: string,\n options?: coreHttp.OperationOptions\n ): Promise<ShortCodesGetUSProgramBriefResponse> {\n const operationArguments: coreHttp.OperationArguments = {\n programBriefId,\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(\n operationArguments,\n getUSProgramBriefOperationSpec\n ) as Promise<ShortCodesGetUSProgramBriefResponse>;\n }\n\n /**\n * @param programBriefId\n * @param options The options parameters.\n */\n submitUSProgramBrief(\n programBriefId: string,\n options?: coreHttp.OperationOptions\n ): Promise<ShortCodesSubmitUSProgramBriefResponse> {\n const operationArguments: coreHttp.OperationArguments = {\n programBriefId,\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(\n operationArguments,\n submitUSProgramBriefOperationSpec\n ) as Promise<ShortCodesSubmitUSProgramBriefResponse>;\n }\n\n /**\n * Gets the list of US Program Briefs for the current resource.\n * @param options The options parameters.\n */\n private _getUSProgramBriefs(\n options?: ShortCodesGetUSProgramBriefsOptionalParams\n ): Promise<ShortCodesGetUSProgramBriefsResponse> {\n const operationArguments: coreHttp.OperationArguments = {\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(\n operationArguments,\n getUSProgramBriefsOperationSpec\n ) as Promise<ShortCodesGetUSProgramBriefsResponse>;\n }\n\n /**\n * GetShortCodesNext\n * @param nextLink The nextLink from the previous successful call to the GetShortCodes method.\n * @param options The options parameters.\n */\n private _getShortCodesNext(\n nextLink: string,\n options?: ShortCodesGetShortCodesNextOptionalParams\n ): Promise<ShortCodesGetShortCodesNextResponse> {\n const operationArguments: coreHttp.OperationArguments = {\n nextLink,\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(\n operationArguments,\n getShortCodesNextOperationSpec\n ) as Promise<ShortCodesGetShortCodesNextResponse>;\n }\n\n /**\n * GetUSProgramBriefsNext\n * @param nextLink The nextLink from the previous successful call to the GetUSProgramBriefs method.\n * @param options The options parameters.\n */\n private _getUSProgramBriefsNext(\n nextLink: string,\n options?: ShortCodesGetUSProgramBriefsNextOptionalParams\n ): Promise<ShortCodesGetUSProgramBriefsNextResponse> {\n const operationArguments: coreHttp.OperationArguments = {\n nextLink,\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(\n operationArguments,\n getUSProgramBriefsNextOperationSpec\n ) as Promise<ShortCodesGetUSProgramBriefsNextResponse>;\n }\n}\n// Operation Specifications\nconst serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);\n\nconst getShortCodesOperationSpec: coreHttp.OperationSpec = {\n path: \"/shortCodes\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ShortCodes\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst upsertUSProgramBriefOperationSpec: coreHttp.OperationSpec = {\n path: \"/shortCodes/countries/US/programBriefs/{programBriefId}\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.USProgramBrief\n },\n 201: {\n bodyMapper: Mappers.USProgramBrief\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n requestBody: Parameters.body,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.programBriefId],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst deleteUSProgramBriefOperationSpec: coreHttp.OperationSpec = {\n path: \"/shortCodes/countries/US/programBriefs/{programBriefId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.programBriefId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getUSProgramBriefOperationSpec: coreHttp.OperationSpec = {\n path: \"/shortCodes/countries/US/programBriefs/{programBriefId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.USProgramBrief\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.programBriefId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst submitUSProgramBriefOperationSpec: coreHttp.OperationSpec = {\n path: \"/shortCodes/countries/US/programBriefs/{programBriefId}/:submit\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.USProgramBrief\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.programBriefId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getUSProgramBriefsOperationSpec: coreHttp.OperationSpec = {\n path: \"/shortCodes/countries/US/programBriefs\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.USProgramBriefs\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getShortCodesNextOperationSpec: coreHttp.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ShortCodes\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getUSProgramBriefsNextOperationSpec: coreHttp.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.USProgramBriefs\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -1,38 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import * as coreHttp from "@azure/core-http";
9
- const packageName = "azure-communication-short-codes";
10
- const packageVersion = "1.0.0-beta.1";
11
- export class ShortCodesClientContext extends coreHttp.ServiceClient {
12
- /**
13
- * Initializes a new instance of the ShortCodesClientContext class.
14
- * @param endpoint The communication resource, for example https://resourcename.communication.azure.com
15
- * @param options The parameter options
16
- */
17
- constructor(endpoint, options) {
18
- if (endpoint === undefined) {
19
- throw new Error("'endpoint' cannot be null");
20
- }
21
- // Initializing default values for options
22
- if (!options) {
23
- options = {};
24
- }
25
- if (!options.userAgent) {
26
- const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
27
- options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
28
- }
29
- super(undefined, options);
30
- this.requestContentType = "application/json; charset=utf-8";
31
- this.baseUri = options.endpoint || "{endpoint}";
32
- // Parameter assignments
33
- this.endpoint = endpoint;
34
- // Assigning values to Constant parameters
35
- this.apiVersion = options.apiVersion || "2021-10-25-preview";
36
- }
37
- }
38
- //# sourceMappingURL=shortCodesClientContext.js.map