@azure/communication-identity 1.4.0-alpha.20250620.1 → 1.4.0-alpha.20250730.1

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 (74) hide show
  1. package/dist/browser/communicationIdentityClient.js +31 -10
  2. package/dist/browser/communicationIdentityClient.js.map +1 -1
  3. package/dist/browser/generated/src/identityRestClient.js +15 -3
  4. package/dist/browser/generated/src/identityRestClient.js.map +1 -1
  5. package/dist/browser/generated/src/operations/communicationIdentityOperations.js +12 -8
  6. package/dist/browser/generated/src/operations/communicationIdentityOperations.js.map +1 -1
  7. package/dist/browser/generated/src/operations/entraIdAssignment.js +5 -4
  8. package/dist/browser/generated/src/operations/entraIdAssignment.js.map +1 -1
  9. package/dist/browser/generated/src/operations/entraIdAssignments.js +26 -43
  10. package/dist/browser/generated/src/operations/entraIdAssignments.js.map +1 -1
  11. package/dist/browser/generated/src/operations/entraIdToken.js +2 -1
  12. package/dist/browser/generated/src/operations/entraIdToken.js.map +1 -1
  13. package/dist/browser/generated/src/operations/teamsExtensionAssignment.js +8 -4
  14. package/dist/browser/generated/src/operations/teamsExtensionAssignment.js.map +1 -1
  15. package/dist/browser/generated/src/operations/teamsExtensionToken.js +2 -1
  16. package/dist/browser/generated/src/operations/teamsExtensionToken.js.map +1 -1
  17. package/dist/browser/generated/src/pagingHelper.js +2 -4
  18. package/dist/browser/generated/src/pagingHelper.js.map +1 -1
  19. package/dist/commonjs/communicationIdentityClient.js +31 -10
  20. package/dist/commonjs/communicationIdentityClient.js.map +1 -1
  21. package/dist/commonjs/generated/src/identityRestClient.js +15 -3
  22. package/dist/commonjs/generated/src/identityRestClient.js.map +1 -1
  23. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.js +12 -8
  24. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.js.map +1 -1
  25. package/dist/commonjs/generated/src/operations/entraIdAssignment.js +5 -4
  26. package/dist/commonjs/generated/src/operations/entraIdAssignment.js.map +1 -1
  27. package/dist/commonjs/generated/src/operations/entraIdAssignments.js +26 -42
  28. package/dist/commonjs/generated/src/operations/entraIdAssignments.js.map +1 -1
  29. package/dist/commonjs/generated/src/operations/entraIdToken.js +2 -1
  30. package/dist/commonjs/generated/src/operations/entraIdToken.js.map +1 -1
  31. package/dist/commonjs/generated/src/operations/teamsExtensionAssignment.js +8 -4
  32. package/dist/commonjs/generated/src/operations/teamsExtensionAssignment.js.map +1 -1
  33. package/dist/commonjs/generated/src/operations/teamsExtensionToken.js +2 -1
  34. package/dist/commonjs/generated/src/operations/teamsExtensionToken.js.map +1 -1
  35. package/dist/commonjs/generated/src/pagingHelper.js +2 -4
  36. package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
  37. package/dist/commonjs/tsdoc-metadata.json +11 -11
  38. package/dist/esm/communicationIdentityClient.js +31 -10
  39. package/dist/esm/communicationIdentityClient.js.map +1 -1
  40. package/dist/esm/generated/src/identityRestClient.js +15 -3
  41. package/dist/esm/generated/src/identityRestClient.js.map +1 -1
  42. package/dist/esm/generated/src/operations/communicationIdentityOperations.js +12 -8
  43. package/dist/esm/generated/src/operations/communicationIdentityOperations.js.map +1 -1
  44. package/dist/esm/generated/src/operations/entraIdAssignment.js +5 -4
  45. package/dist/esm/generated/src/operations/entraIdAssignment.js.map +1 -1
  46. package/dist/esm/generated/src/operations/entraIdAssignments.js +26 -43
  47. package/dist/esm/generated/src/operations/entraIdAssignments.js.map +1 -1
  48. package/dist/esm/generated/src/operations/entraIdToken.js +2 -1
  49. package/dist/esm/generated/src/operations/entraIdToken.js.map +1 -1
  50. package/dist/esm/generated/src/operations/teamsExtensionAssignment.js +8 -4
  51. package/dist/esm/generated/src/operations/teamsExtensionAssignment.js.map +1 -1
  52. package/dist/esm/generated/src/operations/teamsExtensionToken.js +2 -1
  53. package/dist/esm/generated/src/operations/teamsExtensionToken.js.map +1 -1
  54. package/dist/esm/generated/src/pagingHelper.js +2 -4
  55. package/dist/esm/generated/src/pagingHelper.js.map +1 -1
  56. package/dist/react-native/communicationIdentityClient.js +31 -10
  57. package/dist/react-native/communicationIdentityClient.js.map +1 -1
  58. package/dist/react-native/generated/src/identityRestClient.js +15 -3
  59. package/dist/react-native/generated/src/identityRestClient.js.map +1 -1
  60. package/dist/react-native/generated/src/operations/communicationIdentityOperations.js +12 -8
  61. package/dist/react-native/generated/src/operations/communicationIdentityOperations.js.map +1 -1
  62. package/dist/react-native/generated/src/operations/entraIdAssignment.js +5 -4
  63. package/dist/react-native/generated/src/operations/entraIdAssignment.js.map +1 -1
  64. package/dist/react-native/generated/src/operations/entraIdAssignments.js +26 -43
  65. package/dist/react-native/generated/src/operations/entraIdAssignments.js.map +1 -1
  66. package/dist/react-native/generated/src/operations/entraIdToken.js +2 -1
  67. package/dist/react-native/generated/src/operations/entraIdToken.js.map +1 -1
  68. package/dist/react-native/generated/src/operations/teamsExtensionAssignment.js +8 -4
  69. package/dist/react-native/generated/src/operations/teamsExtensionAssignment.js.map +1 -1
  70. package/dist/react-native/generated/src/operations/teamsExtensionToken.js +2 -1
  71. package/dist/react-native/generated/src/operations/teamsExtensionToken.js.map +1 -1
  72. package/dist/react-native/generated/src/pagingHelper.js +2 -4
  73. package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
  74. package/package.json +2 -2
@@ -10,17 +10,24 @@ const isCommunicationIdentityClientOptions = (options) => options && !isTokenCre
10
10
  * Client class for interacting with Azure Communication Services User Token Management.
11
11
  */
12
12
  export class CommunicationIdentityClient {
13
+ /**
14
+ * A reference to the auto-generated UserToken HTTP client.
15
+ */
16
+ client;
13
17
  constructor(connectionStringOrEndpoint, credentialOrOptions, maybeOptions = {}) {
14
18
  const { url, credential } = parseClientArguments(connectionStringOrEndpoint, credentialOrOptions);
15
19
  const options = isCommunicationIdentityClientOptions(credentialOrOptions)
16
20
  ? credentialOrOptions
17
21
  : maybeOptions;
18
- const internalPipelineOptions = Object.assign(Object.assign({}, options), {
19
- loggingOptions: {
20
- logger: logger.info,
22
+ const internalPipelineOptions = {
23
+ ...options,
24
+ ...{
25
+ loggingOptions: {
26
+ logger: logger.info,
27
+ },
21
28
  },
22
- });
23
- this.client = new IdentityRestClient(url, Object.assign({ endpoint: url }, internalPipelineOptions));
29
+ };
30
+ this.client = new IdentityRestClient(url, { endpoint: url, ...internalPipelineOptions });
24
31
  const authPolicy = createCommunicationAuthPolicy(credential);
25
32
  this.client.pipeline.addPolicy(authPolicy);
26
33
  }
@@ -33,7 +40,7 @@ export class CommunicationIdentityClient {
33
40
  */
34
41
  getToken(user, scopes, options = {}) {
35
42
  return tracingClient.withSpan("CommunicationIdentity-issueToken", options, (updatedOptions) => {
36
- return this.client.communicationIdentityOperations.issueAccessToken(user.communicationUserId, scopes, Object.assign({ expiresInMinutes: options.tokenExpiresInMinutes }, updatedOptions));
43
+ return this.client.communicationIdentityOperations.issueAccessToken(user.communicationUserId, scopes, { expiresInMinutes: options.tokenExpiresInMinutes, ...updatedOptions });
37
44
  });
38
45
  }
39
46
  /**
@@ -55,7 +62,9 @@ export class CommunicationIdentityClient {
55
62
  */
56
63
  getUserDetail(user, options = {}) {
57
64
  return tracingClient.withSpan("CommunicationIdentity-getUser", options, async (updatedOptions) => {
58
- const result = await this.client.communicationIdentityOperations.get(user.communicationUserId, Object.assign({}, updatedOptions));
65
+ const result = await this.client.communicationIdentityOperations.get(user.communicationUserId, {
66
+ ...updatedOptions,
67
+ });
59
68
  return {
60
69
  user: { communicationUserId: result.id },
61
70
  customId: result.customId,
@@ -70,7 +79,11 @@ export class CommunicationIdentityClient {
70
79
  */
71
80
  createUser(options = {}) {
72
81
  return tracingClient.withSpan("CommunicationIdentity-createUser", options, async (updatedOptions) => {
73
- const result = await this.client.communicationIdentityOperations.create(Object.assign({ expiresInMinutes: undefined, customId: options.customId }, updatedOptions));
82
+ const result = await this.client.communicationIdentityOperations.create({
83
+ expiresInMinutes: undefined,
84
+ customId: options.customId,
85
+ ...updatedOptions,
86
+ });
74
87
  return {
75
88
  communicationUserId: result.identity.id,
76
89
  };
@@ -84,8 +97,16 @@ export class CommunicationIdentityClient {
84
97
  */
85
98
  createUserAndToken(scopes, options = {}) {
86
99
  return tracingClient.withSpan("CommunicationIdentity-createUserAndToken", options, async (updatedOptions) => {
87
- const { identity, accessToken } = await this.client.communicationIdentityOperations.create(Object.assign({ createTokenWithScopes: scopes, expiresInMinutes: options.tokenExpiresInMinutes, customId: options.customId }, updatedOptions));
88
- return Object.assign(Object.assign({}, accessToken), { user: { communicationUserId: identity.id } });
100
+ const { identity, accessToken } = await this.client.communicationIdentityOperations.create({
101
+ createTokenWithScopes: scopes,
102
+ expiresInMinutes: options.tokenExpiresInMinutes,
103
+ customId: options.customId,
104
+ ...updatedOptions,
105
+ });
106
+ return {
107
+ ...accessToken,
108
+ user: { communicationUserId: identity.id },
109
+ };
89
110
  });
90
111
  }
91
112
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"communicationIdentityClient.js","sourceRoot":"","sources":["../../src/communicationIdentityClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAclC,OAAO,EACL,6BAA6B,EAC7B,eAAe,EACf,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,oCAAoC,GAAG,CAC3C,OAAY,EACmC,EAAE,CACjD,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAO,2BAA2B;IAqCtC,YACE,0BAAkC,EAClC,mBAA0F,EAC1F,eAAmD,EAAE;QAErD,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,oB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AAc,EACjB,CAAC;YACH,uCACK,WAAY,KACf,IAAI,EAAE,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,EAAE,IAC1C;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,UAAU,CACf,IAAiC,EACjC,UAA4B,EAAE;QAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,MAAM,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,MAAM,CACtD,IAAI,CAAC,mBAAmB,EACxB,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,oBAAoB,CACzB,OAAoC;QAEpC,OAAO,aAAa,CAAC,QAAQ,CAC3B,4CAA4C,EAC5C,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,cAAc,CAAC;YACrE,OAAO,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,4BAA4B,CAC7E,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n CommunicationAccessToken,\n CommunicationIdentityClientOptions,\n CommunicationUserToken,\n GetTokenForTeamsUserOptions,\n CreateUserAndTokenOptions,\n GetTokenOptions,\n TokenScope,\n CreateUserOptions,\n CommunicationUserDetail,\n} from \"./models.js\";\nimport type { CommunicationUserIdentifier } from \"@azure/communication-common\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport type { InternalClientPipelineOptions, OperationOptions } from \"@azure/core-client\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { IdentityRestClient } from \"./generated/src/identityRestClient.js\";\nimport { logger } from \"./common/logger.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\n\nconst isCommunicationIdentityClientOptions = (\n options: any,\n): options is CommunicationIdentityClientOptions =>\n options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services User Token Management.\n */\nexport class CommunicationIdentityClient {\n /**\n * A reference to the auto-generated UserToken HTTP client.\n */\n private readonly client: IdentityRestClient;\n\n /**\n * Initializes a new instance of the CommunicationIdentity class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: CommunicationIdentityClientOptions);\n\n /**\n * Initializes a new instance of the CommunicationIdentity class using an Azure KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - An object that is used to authenticate requests to the service. Use the AzureKeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: CommunicationIdentityClientOptions,\n );\n /**\n * Initializes a new instance of the CommunicationIdentity class using a TokenCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net)\n * @param credential - TokenCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: CommunicationIdentityClientOptions,\n );\n\n public constructor(\n connectionStringOrEndpoint: string,\n credentialOrOptions?: KeyCredential | CommunicationIdentityClientOptions | TokenCredential,\n maybeOptions: CommunicationIdentityClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(\n connectionStringOrEndpoint,\n credentialOrOptions,\n );\n const options = isCommunicationIdentityClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n this.client = new IdentityRestClient(url, { endpoint: url, ...internalPipelineOptions });\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Creates a scoped user token.\n *\n * @param user - The user whose tokens are being issued.\n * @param scopes - Scopes to include in the token.\n * @param options - Additional options for the request.\n */\n public getToken(\n user: CommunicationUserIdentifier,\n scopes: TokenScope[],\n options: GetTokenOptions = {},\n ): Promise<CommunicationAccessToken> {\n return tracingClient.withSpan(\"CommunicationIdentity-issueToken\", options, (updatedOptions) => {\n return this.client.communicationIdentityOperations.issueAccessToken(\n user.communicationUserId,\n scopes,\n { expiresInMinutes: options.tokenExpiresInMinutes, ...updatedOptions },\n );\n });\n }\n\n /**\n * Revokes all data and tokens created for a user.\n *\n * @param user - The user whose tokens are being revoked.\n * @param options - Additional options for the request.\n */\n public revokeTokens(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-revokeTokens\",\n options,\n async (updatedOptions) => {\n await this.client.communicationIdentityOperations.revokeAccessTokens(\n user.communicationUserId,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Get an identity by its id.\n *\n * @param user - The user to get.\n * @param options - Additional options for the request.\n */\n public getUserDetail(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<CommunicationUserDetail> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-getUser\",\n options,\n async (updatedOptions) => {\n const result = await this.client.communicationIdentityOperations.get(\n user.communicationUserId,\n {\n ...updatedOptions,\n },\n );\n\n return {\n user: { communicationUserId: result.id },\n customId: result.customId,\n lastTokenIssuedAt: result.lastTokenIssuedAt,\n };\n },\n );\n }\n\n /**\n * Creates a single user.\n *\n * @param options - Additional options for the request.\n */\n public createUser(options: CreateUserOptions = {}): Promise<CommunicationUserIdentifier> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-createUser\",\n options,\n async (updatedOptions) => {\n const result = await this.client.communicationIdentityOperations.create({\n expiresInMinutes: undefined,\n customId: options.customId,\n ...updatedOptions,\n });\n return {\n communicationUserId: result.identity.id,\n };\n },\n );\n }\n\n /**\n * Creates a single user and a token simultaneously.\n *\n * @param scopes - Scopes to include in the token.\n * @param options - Additional options for the request.\n */\n public createUserAndToken(\n scopes: TokenScope[],\n options: CreateUserAndTokenOptions = {},\n ): Promise<CommunicationUserToken> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-createUserAndToken\",\n options,\n async (updatedOptions) => {\n const { identity, accessToken } = await this.client.communicationIdentityOperations.create({\n createTokenWithScopes: scopes,\n expiresInMinutes: options.tokenExpiresInMinutes,\n customId: options.customId,\n ...updatedOptions,\n });\n return {\n ...accessToken!,\n user: { communicationUserId: identity.id },\n };\n },\n );\n }\n\n /**\n * Triggers revocation event for user and deletes all its data.\n *\n * @param user - The user being deleted.\n * @param options - Additional options for the request.\n */\n public deleteUser(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-deleteUser\",\n options,\n async (updatedOptions) => {\n await this.client.communicationIdentityOperations.delete(\n user.communicationUserId,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Exchanges an Azure AD access token of a Teams user for a new Communication Identity access token with a matching expiration time.\n *\n * @param options - Options used to exchange an Azure AD access token of a Teams user for a new Communication Identity access token.\n */\n public getTokenForTeamsUser(\n options: GetTokenForTeamsUserOptions,\n ): Promise<CommunicationAccessToken> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-getTokenForTeamsUser\",\n options,\n (updatedOptions) => {\n const { teamsUserAadToken, clientId, userObjectId } = updatedOptions;\n return this.client.communicationIdentityOperations.exchangeTeamsUserAccessToken(\n teamsUserAadToken,\n clientId,\n userObjectId,\n updatedOptions,\n );\n },\n );\n }\n}\n"]}
1
+ {"version":3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f,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,oBAAoB,CACzB,OAAoC;QAEpC,OAAO,aAAa,CAAC,QAAQ,CAC3B,4CAA4C,EAC5C,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,cAAc,CAAC;YACrE,OAAO,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,4BAA4B,CAC7E,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n CommunicationAccessToken,\n CommunicationIdentityClientOptions,\n CommunicationUserToken,\n GetTokenForTeamsUserOptions,\n CreateUserAndTokenOptions,\n GetTokenOptions,\n TokenScope,\n CreateUserOptions,\n CommunicationUserDetail,\n} from \"./models.js\";\nimport type { CommunicationUserIdentifier } from \"@azure/communication-common\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport type { InternalClientPipelineOptions, OperationOptions } from \"@azure/core-client\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { IdentityRestClient } from \"./generated/src/identityRestClient.js\";\nimport { logger } from \"./common/logger.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\n\nconst isCommunicationIdentityClientOptions = (\n options: any,\n): options is CommunicationIdentityClientOptions =>\n options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services User Token Management.\n */\nexport class CommunicationIdentityClient {\n /**\n * A reference to the auto-generated UserToken HTTP client.\n */\n private readonly client: IdentityRestClient;\n\n /**\n * Initializes a new instance of the CommunicationIdentity class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: CommunicationIdentityClientOptions);\n\n /**\n * Initializes a new instance of the CommunicationIdentity class using an Azure KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - An object that is used to authenticate requests to the service. Use the AzureKeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: CommunicationIdentityClientOptions,\n );\n /**\n * Initializes a new instance of the CommunicationIdentity class using a TokenCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net)\n * @param credential - TokenCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: CommunicationIdentityClientOptions,\n );\n\n public constructor(\n connectionStringOrEndpoint: string,\n credentialOrOptions?: KeyCredential | CommunicationIdentityClientOptions | TokenCredential,\n maybeOptions: CommunicationIdentityClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(\n connectionStringOrEndpoint,\n credentialOrOptions,\n );\n const options = isCommunicationIdentityClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n this.client = new IdentityRestClient(url, { endpoint: url, ...internalPipelineOptions });\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Creates a scoped user token.\n *\n * @param user - The user whose tokens are being issued.\n * @param scopes - Scopes to include in the token.\n * @param options - Additional options for the request.\n */\n public getToken(\n user: CommunicationUserIdentifier,\n scopes: TokenScope[],\n options: GetTokenOptions = {},\n ): Promise<CommunicationAccessToken> {\n return tracingClient.withSpan(\"CommunicationIdentity-issueToken\", options, (updatedOptions) => {\n return this.client.communicationIdentityOperations.issueAccessToken(\n user.communicationUserId,\n scopes,\n { expiresInMinutes: options.tokenExpiresInMinutes, ...updatedOptions },\n );\n });\n }\n\n /**\n * Revokes all data and tokens created for a user.\n *\n * @param user - The user whose tokens are being revoked.\n * @param options - Additional options for the request.\n */\n public revokeTokens(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-revokeTokens\",\n options,\n async (updatedOptions) => {\n await this.client.communicationIdentityOperations.revokeAccessTokens(\n user.communicationUserId,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Get an identity by its id.\n *\n * @param user - The user to get.\n * @param options - Additional options for the request.\n */\n public getUserDetail(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<CommunicationUserDetail> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-getUser\",\n options,\n async (updatedOptions) => {\n const result = await this.client.communicationIdentityOperations.get(\n user.communicationUserId,\n {\n ...updatedOptions,\n },\n );\n\n return {\n user: { communicationUserId: result.id },\n customId: result.customId,\n lastTokenIssuedAt: result.lastTokenIssuedAt,\n };\n },\n );\n }\n\n /**\n * Creates a single user.\n *\n * @param options - Additional options for the request.\n */\n public createUser(options: CreateUserOptions = {}): Promise<CommunicationUserIdentifier> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-createUser\",\n options,\n async (updatedOptions) => {\n const result = await this.client.communicationIdentityOperations.create({\n expiresInMinutes: undefined,\n customId: options.customId,\n ...updatedOptions,\n });\n return {\n communicationUserId: result.identity.id,\n };\n },\n );\n }\n\n /**\n * Creates a single user and a token simultaneously.\n *\n * @param scopes - Scopes to include in the token.\n * @param options - Additional options for the request.\n */\n public createUserAndToken(\n scopes: TokenScope[],\n options: CreateUserAndTokenOptions = {},\n ): Promise<CommunicationUserToken> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-createUserAndToken\",\n options,\n async (updatedOptions) => {\n const { identity, accessToken } = await this.client.communicationIdentityOperations.create({\n createTokenWithScopes: scopes,\n expiresInMinutes: options.tokenExpiresInMinutes,\n customId: options.customId,\n ...updatedOptions,\n });\n return {\n ...accessToken!,\n user: { communicationUserId: identity.id },\n };\n },\n );\n }\n\n /**\n * Triggers revocation event for user and deletes all its data.\n *\n * @param user - The user being deleted.\n * @param options - Additional options for the request.\n */\n public deleteUser(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-deleteUser\",\n options,\n async (updatedOptions) => {\n await this.client.communicationIdentityOperations.delete(\n user.communicationUserId,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Exchanges an Azure AD access token of a Teams user for a new Communication Identity access token with a matching expiration time.\n *\n * @param options - Options used to exchange an Azure AD access token of a Teams user for a new Communication Identity access token.\n */\n public getTokenForTeamsUser(\n options: GetTokenForTeamsUserOptions,\n ): Promise<CommunicationAccessToken> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-getTokenForTeamsUser\",\n options,\n (updatedOptions) => {\n const { teamsUserAadToken, clientId, userObjectId } = updatedOptions;\n return this.client.communicationIdentityOperations.exchangeTeamsUserAccessToken(\n teamsUserAadToken,\n clientId,\n userObjectId,\n updatedOptions,\n );\n },\n );\n }\n}\n"]}
@@ -8,13 +8,14 @@
8
8
  import * as coreClient from "@azure/core-client";
9
9
  import { CommunicationIdentityOperationsImpl, TeamsExtensionTokenImpl, TeamsExtensionAssignmentImpl, EntraIdTokenImpl, EntraIdAssignmentsImpl, EntraIdAssignmentImpl, } from "./operations/index.js";
10
10
  export class IdentityRestClient extends coreClient.ServiceClient {
11
+ endpoint;
12
+ apiVersion;
11
13
  /**
12
14
  * Initializes a new instance of the IdentityRestClient class.
13
15
  * @param endpoint The communication resource, for example https://my-resource.communication.azure.com
14
16
  * @param options The parameter options
15
17
  */
16
18
  constructor(endpoint, options) {
17
- var _a, _b;
18
19
  if (endpoint === undefined) {
19
20
  throw new Error("'endpoint' cannot be null");
20
21
  }
@@ -29,9 +30,14 @@ export class IdentityRestClient extends coreClient.ServiceClient {
29
30
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
30
31
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
31
32
  : `${packageDetails}`;
32
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
33
+ const optionsWithDefaults = {
34
+ ...defaults,
35
+ ...options,
36
+ userAgentOptions: {
33
37
  userAgentPrefix,
34
- }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
38
+ },
39
+ endpoint: options.endpoint ?? options.baseUri ?? "{endpoint}",
40
+ };
35
41
  super(optionsWithDefaults);
36
42
  // Parameter assignments
37
43
  this.endpoint = endpoint;
@@ -71,5 +77,11 @@ export class IdentityRestClient extends coreClient.ServiceClient {
71
77
  };
72
78
  this.pipeline.addPolicy(apiVersionPolicy);
73
79
  }
80
+ communicationIdentityOperations;
81
+ teamsExtensionToken;
82
+ teamsExtensionAssignment;
83
+ entraIdToken;
84
+ entraIdAssignments;
85
+ entraIdAssignment;
74
86
  }
75
87
  //# sourceMappingURL=identityRestClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"identityRestClient.js","sourceRoot":"","sources":["../../../../src/generated/src/identityRestClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EACL,mCAAmC,EACnC,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAW/B,MAAM,OAAO,kBAAmB,SAAQ,UAAU,CAAC,aAAa;IAI9D;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAA0C;;QACtE,IAAI,QAAQ,KAAK,SAAS,EA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I,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACzD,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;IAED,8GAA8G;IACtG,yBAAyB,CAAC,UAAmB;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAQF","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 * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n CommunicationIdentityOperationsImpl,\n TeamsExtensionTokenImpl,\n TeamsExtensionAssignmentImpl,\n EntraIdTokenImpl,\n EntraIdAssignmentsImpl,\n EntraIdAssignmentImpl,\n} from \"./operations/index.js\";\nimport {\n CommunicationIdentityOperations,\n TeamsExtensionToken,\n TeamsExtensionAssignment,\n EntraIdToken,\n EntraIdAssignments,\n EntraIdAssignment,\n} from \"./operationsInterfaces/index.js\";\nimport { IdentityRestClientOptionalParams } from \"./models/index.js\";\n\nexport class IdentityRestClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the IdentityRestClient class.\n * @param endpoint The communication resource, for example https://my-resource.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: IdentityRestClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: IdentityRestClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-communication-identity/1.4.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2025-03-02-preview\";\n this.communicationIdentityOperations =\n new CommunicationIdentityOperationsImpl(this);\n this.teamsExtensionToken = new TeamsExtensionTokenImpl(this);\n this.teamsExtensionAssignment = new TeamsExtensionAssignmentImpl(this);\n this.entraIdToken = new EntraIdTokenImpl(this);\n this.entraIdAssignments = new EntraIdAssignmentsImpl(this);\n this.entraIdAssignment = new EntraIdAssignmentImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest,\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n communicationIdentityOperations: CommunicationIdentityOperations;\n teamsExtensionToken: TeamsExtensionToken;\n teamsExtensionAssignment: TeamsExtensionAssignment;\n entraIdToken: EntraIdToken;\n entraIdAssignments: EntraIdAssignments;\n entraIdAssignment: EntraIdAssignment;\n}\n"]}
1
+ {"version":3,"file":"identityRestClient.js","sourceRoot":"","sources":["../../../../src/generated/src/identityRestClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EACL,mCAAmC,EACnC,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAW/B,MAAM,OAAO,kBAAmB,SAAQ,UAAU,CAAC,aAAa;IAC9D,QAAQ,CAAS;IACjB,UAAU,CAAS;IAEnB;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAA0C;QACtE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,C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AA8G;IACtG,yBAAyB,CAAC,UAAmB;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED,+BAA+B,CAAkC;IACjE,mBAAmB,CAAsB;IACzC,wBAAwB,CAA2B;IACnD,YAAY,CAAe;IAC3B,kBAAkB,CAAqB;IACvC,iBAAiB,CAAoB;CACtC","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 * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n CommunicationIdentityOperationsImpl,\n TeamsExtensionTokenImpl,\n TeamsExtensionAssignmentImpl,\n EntraIdTokenImpl,\n EntraIdAssignmentsImpl,\n EntraIdAssignmentImpl,\n} from \"./operations/index.js\";\nimport {\n CommunicationIdentityOperations,\n TeamsExtensionToken,\n TeamsExtensionAssignment,\n EntraIdToken,\n EntraIdAssignments,\n EntraIdAssignment,\n} from \"./operationsInterfaces/index.js\";\nimport { IdentityRestClientOptionalParams } from \"./models/index.js\";\n\nexport class IdentityRestClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the IdentityRestClient class.\n * @param endpoint The communication resource, for example https://my-resource.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: IdentityRestClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: IdentityRestClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-communication-identity/1.4.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2025-03-02-preview\";\n this.communicationIdentityOperations =\n new CommunicationIdentityOperationsImpl(this);\n this.teamsExtensionToken = new TeamsExtensionTokenImpl(this);\n this.teamsExtensionAssignment = new TeamsExtensionAssignmentImpl(this);\n this.entraIdToken = new EntraIdTokenImpl(this);\n this.entraIdAssignments = new EntraIdAssignmentsImpl(this);\n this.entraIdAssignment = new EntraIdAssignmentImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest,\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n communicationIdentityOperations: CommunicationIdentityOperations;\n teamsExtensionToken: TeamsExtensionToken;\n teamsExtensionAssignment: TeamsExtensionAssignment;\n entraIdToken: EntraIdToken;\n entraIdAssignments: EntraIdAssignments;\n entraIdAssignment: EntraIdAssignment;\n}\n"]}
@@ -11,6 +11,7 @@ import * as Mappers from "../models/mappers.js";
11
11
  import * as Parameters from "../models/parameters.js";
12
12
  /** Class containing CommunicationIdentityOperations operations. */
13
13
  export class CommunicationIdentityOperationsImpl {
14
+ client;
14
15
  /**
15
16
  * Initialize a new instance of the class CommunicationIdentityOperations class.
16
17
  * @param client Reference to the service client
@@ -24,7 +25,7 @@ export class CommunicationIdentityOperationsImpl {
24
25
  * @param options The options parameters.
25
26
  */
26
27
  async create(options) {
27
- return tracingClient.withSpan("IdentityRestClient.create", options !== null && options !== void 0 ? options : {}, async (options) => {
28
+ return tracingClient.withSpan("IdentityRestClient.create", options ?? {}, async (options) => {
28
29
  return this.client.sendOperationRequest({ options }, createOperationSpec);
29
30
  });
30
31
  }
@@ -34,7 +35,7 @@ export class CommunicationIdentityOperationsImpl {
34
35
  * @param options The options parameters.
35
36
  */
36
37
  async delete(id, options) {
37
- return tracingClient.withSpan("IdentityRestClient.delete", options !== null && options !== void 0 ? options : {}, async (options) => {
38
+ return tracingClient.withSpan("IdentityRestClient.delete", options ?? {}, async (options) => {
38
39
  return this.client.sendOperationRequest({ id, options }, deleteOperationSpec);
39
40
  });
40
41
  }
@@ -44,7 +45,7 @@ export class CommunicationIdentityOperationsImpl {
44
45
  * @param options The options parameters.
45
46
  */
46
47
  async get(id, options) {
47
- return tracingClient.withSpan("IdentityRestClient.get", options !== null && options !== void 0 ? options : {}, async (options) => {
48
+ return tracingClient.withSpan("IdentityRestClient.get", options ?? {}, async (options) => {
48
49
  return this.client.sendOperationRequest({ id, options }, getOperationSpec);
49
50
  });
50
51
  }
@@ -54,7 +55,7 @@ export class CommunicationIdentityOperationsImpl {
54
55
  * @param options The options parameters.
55
56
  */
56
57
  async revokeAccessTokens(id, options) {
57
- return tracingClient.withSpan("IdentityRestClient.revokeAccessTokens", options !== null && options !== void 0 ? options : {}, async (options) => {
58
+ return tracingClient.withSpan("IdentityRestClient.revokeAccessTokens", options ?? {}, async (options) => {
58
59
  return this.client.sendOperationRequest({ id, options }, revokeAccessTokensOperationSpec);
59
60
  });
60
61
  }
@@ -70,7 +71,7 @@ export class CommunicationIdentityOperationsImpl {
70
71
  * @param options The options parameters.
71
72
  */
72
73
  async exchangeTeamsUserAccessToken(token, appId, userId, options) {
73
- return tracingClient.withSpan("IdentityRestClient.exchangeTeamsUserAccessToken", options !== null && options !== void 0 ? options : {}, async (options) => {
74
+ return tracingClient.withSpan("IdentityRestClient.exchangeTeamsUserAccessToken", options ?? {}, async (options) => {
74
75
  return this.client.sendOperationRequest({ token, appId, userId, options }, exchangeTeamsUserAccessTokenOperationSpec);
75
76
  });
76
77
  }
@@ -81,7 +82,7 @@ export class CommunicationIdentityOperationsImpl {
81
82
  * @param options The options parameters.
82
83
  */
83
84
  async issueAccessToken(id, scopes, options) {
84
- return tracingClient.withSpan("IdentityRestClient.issueAccessToken", options !== null && options !== void 0 ? options : {}, async (options) => {
85
+ return tracingClient.withSpan("IdentityRestClient.issueAccessToken", options ?? {}, async (options) => {
85
86
  return this.client.sendOperationRequest({ id, scopes, options }, issueAccessTokenOperationSpec);
86
87
  });
87
88
  }
@@ -170,7 +171,7 @@ const exchangeTeamsUserAccessTokenOperationSpec = {
170
171
  },
171
172
  requestBody: {
172
173
  parameterPath: { token: ["token"], appId: ["appId"], userId: ["userId"] },
173
- mapper: Object.assign(Object.assign({}, Mappers.TeamsUserExchangeTokenRequest), { required: true }),
174
+ mapper: { ...Mappers.TeamsUserExchangeTokenRequest, required: true },
174
175
  },
175
176
  queryParameters: [Parameters.apiVersion],
176
177
  urlParameters: [Parameters.endpoint],
@@ -194,7 +195,10 @@ const issueAccessTokenOperationSpec = {
194
195
  scopes: ["scopes"],
195
196
  expiresInMinutes: ["options", "expiresInMinutes"],
196
197
  },
197
- mapper: Object.assign(Object.assign({}, Mappers.CommunicationIdentityAccessTokenRequest), { required: true }),
198
+ mapper: {
199
+ ...Mappers.CommunicationIdentityAccessTokenRequest,
200
+ required: true,
201
+ },
198
202
  },
199
203
  queryParameters: [Parameters.apiVersion],
200
204
  urlParameters: [Parameters.endpoint, Parameters.id],
@@ -1 +1 @@
1
- {"version":3,"file":"communicationIdentityOperations.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/communicationIdentityOperations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAgBtD,mEAAmE;AACnE,MAAM,OAAO,mCAAmC;IAK9C;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,OAAmD;QAEnD,O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AQ,CAAC;YAClB,gBAAgB,EAAE,CAAC,SAAS,EAAE,kBAAkB,CAAC;SAClD;QACD,MAAM,kCACD,OAAO,CAAC,uCAAuC,KAClD,QAAQ,EAAE,IAAI,GACf;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,CAAC;IACnD,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,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 { tracingClient } from \"../tracing.js\";\nimport { CommunicationIdentityOperations } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { IdentityRestClient } from \"../identityRestClient.js\";\nimport {\n CommunicationIdentityCreateOptionalParams,\n CommunicationIdentityCreateResponse,\n CommunicationIdentityDeleteOptionalParams,\n CommunicationIdentityGetOptionalParams,\n CommunicationIdentityGetResponse,\n CommunicationIdentityRevokeAccessTokensOptionalParams,\n CommunicationIdentityExchangeTeamsUserAccessTokenOptionalParams,\n CommunicationIdentityExchangeTeamsUserAccessTokenResponse,\n CommunicationIdentityTokenScope,\n CommunicationIdentityIssueAccessTokenOptionalParams,\n CommunicationIdentityIssueAccessTokenResponse,\n} from \"../models/index.js\";\n\n/** Class containing CommunicationIdentityOperations operations. */\nexport class CommunicationIdentityOperationsImpl\n implements CommunicationIdentityOperations\n{\n private readonly client: IdentityRestClient;\n\n /**\n * Initialize a new instance of the class CommunicationIdentityOperations class.\n * @param client Reference to the service client\n */\n constructor(client: IdentityRestClient) {\n this.client = client;\n }\n\n /**\n * Create a new identity with an optional customId mapping, and optionally, an access token. If called\n * again with the same customId, the returned identity will be the same as the one returned previously.\n * @param options The options parameters.\n */\n async create(\n options?: CommunicationIdentityCreateOptionalParams,\n ): Promise<CommunicationIdentityCreateResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.create\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n createOperationSpec,\n ) as Promise<CommunicationIdentityCreateResponse>;\n },\n );\n }\n\n /**\n * Delete the identity, revoke all tokens for the identity and delete all associated data.\n * @param id Identifier of the identity to be deleted.\n * @param options The options parameters.\n */\n async delete(\n id: string,\n options?: CommunicationIdentityDeleteOptionalParams,\n ): Promise<void> {\n return tracingClient.withSpan(\n \"IdentityRestClient.delete\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { id, options },\n deleteOperationSpec,\n ) as Promise<void>;\n },\n );\n }\n\n /**\n * Get an identity by its id.\n * @param id Identifier of the identity.\n * @param options The options parameters.\n */\n async get(\n id: string,\n options?: CommunicationIdentityGetOptionalParams,\n ): Promise<CommunicationIdentityGetResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.get\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { id, options },\n getOperationSpec,\n ) as Promise<CommunicationIdentityGetResponse>;\n },\n );\n }\n\n /**\n * Revoke all access tokens for the specific identity.\n * @param id Identifier of the identity.\n * @param options The options parameters.\n */\n async revokeAccessTokens(\n id: string,\n options?: CommunicationIdentityRevokeAccessTokensOptionalParams,\n ): Promise<void> {\n return tracingClient.withSpan(\n \"IdentityRestClient.revokeAccessTokens\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { id, options },\n revokeAccessTokensOperationSpec,\n ) as Promise<void>;\n },\n );\n }\n\n /**\n * Exchange an Entra ID access token of a Teams user for a new Communication Identity access token with\n * a matching expiration time.\n * @param token Entra ID access token of a Teams User to acquire a new Communication Identity access\n * token.\n * @param appId Client ID of an Entra ID application to be verified against the appid claim in the\n * Entra ID access token.\n * @param userId Object ID of an Entra ID user (Teams User) to be verified against the oid claim in the\n * Entra ID access token.\n * @param options The options parameters.\n */\n async exchangeTeamsUserAccessToken(\n token: string,\n appId: string,\n userId: string,\n options?: CommunicationIdentityExchangeTeamsUserAccessTokenOptionalParams,\n ): Promise<CommunicationIdentityExchangeTeamsUserAccessTokenResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.exchangeTeamsUserAccessToken\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { token, appId, userId, options },\n exchangeTeamsUserAccessTokenOperationSpec,\n ) as Promise<CommunicationIdentityExchangeTeamsUserAccessTokenResponse>;\n },\n );\n }\n\n /**\n * Issue a new token for an identity.\n * @param id Identifier of the identity to issue token for.\n * @param scopes List of scopes attached to the token.\n * @param options The options parameters.\n */\n async issueAccessToken(\n id: string,\n scopes: CommunicationIdentityTokenScope[],\n options?: CommunicationIdentityIssueAccessTokenOptionalParams,\n ): Promise<CommunicationIdentityIssueAccessTokenResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.issueAccessToken\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { id, scopes, options },\n issueAccessTokenOperationSpec,\n ) as Promise<CommunicationIdentityIssueAccessTokenResponse>;\n },\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst createOperationSpec: coreClient.OperationSpec = {\n path: \"/identities\",\n httpMethod: \"POST\",\n responses: {\n 201: {\n bodyMapper: Mappers.CommunicationIdentityAccessTokenResult,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n customId: [\"options\", \"customId\"],\n createTokenWithScopes: [\"options\", \"createTokenWithScopes\"],\n expiresInMinutes: [\"options\", \"expiresInMinutes\"],\n },\n mapper: Mappers.CommunicationIdentityCreateRequest,\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst deleteOperationSpec: coreClient.OperationSpec = {\n path: \"/identities/{id}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.id],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/identities/{id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CommunicationIdentity,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.id],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst revokeAccessTokensOperationSpec: coreClient.OperationSpec = {\n path: \"/identities/{id}/:revokeAccessTokens\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.id],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst exchangeTeamsUserAccessTokenOperationSpec: coreClient.OperationSpec = {\n path: \"/teamsUser/:exchangeAccessToken\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CommunicationIdentityAccessToken,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: {\n parameterPath: { token: [\"token\"], appId: [\"appId\"], userId: [\"userId\"] },\n mapper: { ...Mappers.TeamsUserExchangeTokenRequest, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst issueAccessTokenOperationSpec: coreClient.OperationSpec = {\n path: \"/identities/{id}/:issueAccessToken\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CommunicationIdentityAccessToken,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n scopes: [\"scopes\"],\n expiresInMinutes: [\"options\", \"expiresInMinutes\"],\n },\n mapper: {\n ...Mappers.CommunicationIdentityAccessTokenRequest,\n required: true,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.id],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\n"]}
1
+ {"version":3,"file":"communicationIdentityOperations.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/communicationIdentityOperations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAgBtD,mEAAmE;AACnE,MAAM,OAAO,mCAAmC;IAG7B,MAAM,CAAqB;IAE5C;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,OAAmD;QAEnD,OAAO,aAAa,CAAC,QAAQ,CAC3B,2BAA2B,EAC3B,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,OAAO,EAAE,EACX,mBAAmB,CAC4B,CAAC;QACpD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,EAAU,EACV,OAAmD;QAEnD,OAAO,aAAa,CAAC,QAAQ,CAC3B,2BAA2B,EAC3B,OAAO,IAAI,EAAE,EACb,KAAK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AE;QACX,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE;QACzE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,6BAA6B,EAAE,QAAQ,EAAE,IAAI,EAAE;KACrE;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,6BAA6B,GAA6B;IAC9D,IAAI,EAAE,oCAAoC;IAC1C,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gCAAgC;SACrD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,WAAW,EAAE;QACX,aAAa,EAAE;YACb,MAAM,EAAE,CAAC,QAAQ,CAAC;YAClB,gBAAgB,EAAE,CAAC,SAAS,EAAE,kBAAkB,CAAC;SAClD;QACD,MAAM,EAAE;YACN,GAAG,OAAO,CAAC,uCAAuC;YAClD,QAAQ,EAAE,IAAI;SACf;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,CAAC;IACnD,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,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 { tracingClient } from \"../tracing.js\";\nimport { CommunicationIdentityOperations } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { IdentityRestClient } from \"../identityRestClient.js\";\nimport {\n CommunicationIdentityCreateOptionalParams,\n CommunicationIdentityCreateResponse,\n CommunicationIdentityDeleteOptionalParams,\n CommunicationIdentityGetOptionalParams,\n CommunicationIdentityGetResponse,\n CommunicationIdentityRevokeAccessTokensOptionalParams,\n CommunicationIdentityExchangeTeamsUserAccessTokenOptionalParams,\n CommunicationIdentityExchangeTeamsUserAccessTokenResponse,\n CommunicationIdentityTokenScope,\n CommunicationIdentityIssueAccessTokenOptionalParams,\n CommunicationIdentityIssueAccessTokenResponse,\n} from \"../models/index.js\";\n\n/** Class containing CommunicationIdentityOperations operations. */\nexport class CommunicationIdentityOperationsImpl\n implements CommunicationIdentityOperations\n{\n private readonly client: IdentityRestClient;\n\n /**\n * Initialize a new instance of the class CommunicationIdentityOperations class.\n * @param client Reference to the service client\n */\n constructor(client: IdentityRestClient) {\n this.client = client;\n }\n\n /**\n * Create a new identity with an optional customId mapping, and optionally, an access token. If called\n * again with the same customId, the returned identity will be the same as the one returned previously.\n * @param options The options parameters.\n */\n async create(\n options?: CommunicationIdentityCreateOptionalParams,\n ): Promise<CommunicationIdentityCreateResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.create\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n createOperationSpec,\n ) as Promise<CommunicationIdentityCreateResponse>;\n },\n );\n }\n\n /**\n * Delete the identity, revoke all tokens for the identity and delete all associated data.\n * @param id Identifier of the identity to be deleted.\n * @param options The options parameters.\n */\n async delete(\n id: string,\n options?: CommunicationIdentityDeleteOptionalParams,\n ): Promise<void> {\n return tracingClient.withSpan(\n \"IdentityRestClient.delete\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { id, options },\n deleteOperationSpec,\n ) as Promise<void>;\n },\n );\n }\n\n /**\n * Get an identity by its id.\n * @param id Identifier of the identity.\n * @param options The options parameters.\n */\n async get(\n id: string,\n options?: CommunicationIdentityGetOptionalParams,\n ): Promise<CommunicationIdentityGetResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.get\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { id, options },\n getOperationSpec,\n ) as Promise<CommunicationIdentityGetResponse>;\n },\n );\n }\n\n /**\n * Revoke all access tokens for the specific identity.\n * @param id Identifier of the identity.\n * @param options The options parameters.\n */\n async revokeAccessTokens(\n id: string,\n options?: CommunicationIdentityRevokeAccessTokensOptionalParams,\n ): Promise<void> {\n return tracingClient.withSpan(\n \"IdentityRestClient.revokeAccessTokens\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { id, options },\n revokeAccessTokensOperationSpec,\n ) as Promise<void>;\n },\n );\n }\n\n /**\n * Exchange an Entra ID access token of a Teams user for a new Communication Identity access token with\n * a matching expiration time.\n * @param token Entra ID access token of a Teams User to acquire a new Communication Identity access\n * token.\n * @param appId Client ID of an Entra ID application to be verified against the appid claim in the\n * Entra ID access token.\n * @param userId Object ID of an Entra ID user (Teams User) to be verified against the oid claim in the\n * Entra ID access token.\n * @param options The options parameters.\n */\n async exchangeTeamsUserAccessToken(\n token: string,\n appId: string,\n userId: string,\n options?: CommunicationIdentityExchangeTeamsUserAccessTokenOptionalParams,\n ): Promise<CommunicationIdentityExchangeTeamsUserAccessTokenResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.exchangeTeamsUserAccessToken\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { token, appId, userId, options },\n exchangeTeamsUserAccessTokenOperationSpec,\n ) as Promise<CommunicationIdentityExchangeTeamsUserAccessTokenResponse>;\n },\n );\n }\n\n /**\n * Issue a new token for an identity.\n * @param id Identifier of the identity to issue token for.\n * @param scopes List of scopes attached to the token.\n * @param options The options parameters.\n */\n async issueAccessToken(\n id: string,\n scopes: CommunicationIdentityTokenScope[],\n options?: CommunicationIdentityIssueAccessTokenOptionalParams,\n ): Promise<CommunicationIdentityIssueAccessTokenResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.issueAccessToken\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { id, scopes, options },\n issueAccessTokenOperationSpec,\n ) as Promise<CommunicationIdentityIssueAccessTokenResponse>;\n },\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst createOperationSpec: coreClient.OperationSpec = {\n path: \"/identities\",\n httpMethod: \"POST\",\n responses: {\n 201: {\n bodyMapper: Mappers.CommunicationIdentityAccessTokenResult,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n customId: [\"options\", \"customId\"],\n createTokenWithScopes: [\"options\", \"createTokenWithScopes\"],\n expiresInMinutes: [\"options\", \"expiresInMinutes\"],\n },\n mapper: Mappers.CommunicationIdentityCreateRequest,\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst deleteOperationSpec: coreClient.OperationSpec = {\n path: \"/identities/{id}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.id],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/identities/{id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CommunicationIdentity,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.id],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst revokeAccessTokensOperationSpec: coreClient.OperationSpec = {\n path: \"/identities/{id}/:revokeAccessTokens\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.id],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst exchangeTeamsUserAccessTokenOperationSpec: coreClient.OperationSpec = {\n path: \"/teamsUser/:exchangeAccessToken\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CommunicationIdentityAccessToken,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: {\n parameterPath: { token: [\"token\"], appId: [\"appId\"], userId: [\"userId\"] },\n mapper: { ...Mappers.TeamsUserExchangeTokenRequest, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst issueAccessTokenOperationSpec: coreClient.OperationSpec = {\n path: \"/identities/{id}/:issueAccessToken\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CommunicationIdentityAccessToken,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n scopes: [\"scopes\"],\n expiresInMinutes: [\"options\", \"expiresInMinutes\"],\n },\n mapper: {\n ...Mappers.CommunicationIdentityAccessTokenRequest,\n required: true,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.id],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\n"]}
@@ -11,6 +11,7 @@ import * as Mappers from "../models/mappers.js";
11
11
  import * as Parameters from "../models/parameters.js";
12
12
  /** Class containing EntraIdAssignment operations. */
13
13
  export class EntraIdAssignmentImpl {
14
+ client;
14
15
  /**
15
16
  * Initialize a new instance of the class EntraIdAssignment class.
16
17
  * @param client Reference to the service client
@@ -25,7 +26,7 @@ export class EntraIdAssignmentImpl {
25
26
  * @param options The options parameters.
26
27
  */
27
28
  async get(objectId, options) {
28
- return tracingClient.withSpan("IdentityRestClient.get", options !== null && options !== void 0 ? options : {}, async (options) => {
29
+ return tracingClient.withSpan("IdentityRestClient.get", options ?? {}, async (options) => {
29
30
  return this.client.sendOperationRequest({ objectId, options }, getOperationSpec);
30
31
  });
31
32
  }
@@ -38,7 +39,7 @@ export class EntraIdAssignmentImpl {
38
39
  * @param options The options parameters.
39
40
  */
40
41
  async upsert(objectId, tenantId, principalType, clientIds, options) {
41
- return tracingClient.withSpan("IdentityRestClient.upsert", options !== null && options !== void 0 ? options : {}, async (options) => {
42
+ return tracingClient.withSpan("IdentityRestClient.upsert", options ?? {}, async (options) => {
42
43
  return this.client.sendOperationRequest({ objectId, tenantId, principalType, clientIds, options }, upsertOperationSpec);
43
44
  });
44
45
  }
@@ -49,7 +50,7 @@ export class EntraIdAssignmentImpl {
49
50
  * @param options The options parameters.
50
51
  */
51
52
  async delete(objectId, options) {
52
- return tracingClient.withSpan("IdentityRestClient.delete", options !== null && options !== void 0 ? options : {}, async (options) => {
53
+ return tracingClient.withSpan("IdentityRestClient.delete", options ?? {}, async (options) => {
53
54
  return this.client.sendOperationRequest({ objectId, options }, deleteOperationSpec);
54
55
  });
55
56
  }
@@ -92,7 +93,7 @@ const upsertOperationSpec = {
92
93
  principalType: ["principalType"],
93
94
  clientIds: ["clientIds"],
94
95
  },
95
- mapper: Object.assign(Object.assign({}, Mappers.EntraAssignmentCreateOrUpdateRequest), { required: true }),
96
+ mapper: { ...Mappers.EntraAssignmentCreateOrUpdateRequest, required: true },
96
97
  },
97
98
  queryParameters: [Parameters.apiVersion],
98
99
  urlParameters: [Parameters.endpoint, Parameters.objectId],
@@ -1 +1 @@
1
- {"version":3,"file":"entraIdAssignment.js","sourceRoot":"","sources":["../../../../../src/generated/src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Q,EAAE,IAAI,GAAE;KAC5E;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,mBAAmB,GAA6B;IACpD,IAAI,EAAE,sCAAsC;IAC5C,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE;QACT,GAAG,EAAE,EAAE;QACP,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,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 { tracingClient } from \"../tracing.js\";\nimport { EntraIdAssignment } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { IdentityRestClient } from \"../identityRestClient.js\";\nimport {\n EntraIdAssignmentGetOptionalParams,\n EntraIdAssignmentGetResponse,\n EntraPrincipalType,\n EntraIdAssignmentUpsertOptionalParams,\n EntraIdAssignmentUpsertResponse,\n EntraIdAssignmentDeleteOptionalParams,\n} from \"../models/index.js\";\n\n/** Class containing EntraIdAssignment operations. */\nexport class EntraIdAssignmentImpl implements EntraIdAssignment {\n private readonly client: IdentityRestClient;\n\n /**\n * Initialize a new instance of the class EntraIdAssignment class.\n * @param client Reference to the service client\n */\n constructor(client: IdentityRestClient) {\n this.client = client;\n }\n\n /**\n * Get Entra access assignment by object id.\n * @param objectId objectId we want to get the assignment for. AcsResourceId is taken from\n * authentication.\n * @param options The options parameters.\n */\n async get(\n objectId: string,\n options?: EntraIdAssignmentGetOptionalParams,\n ): Promise<EntraIdAssignmentGetResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.get\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { objectId, options },\n getOperationSpec,\n ) as Promise<EntraIdAssignmentGetResponse>;\n },\n );\n }\n\n /**\n * Creates or replaces an Entra access assignment.\n * @param objectId objectId we want to update the assignment for.\n * @param tenantId\n * @param principalType\n * @param clientIds Array of EntraAssignmentCreateOrUpdateRequestClientIdsItem\n * @param options The options parameters.\n */\n async upsert(\n objectId: string,\n tenantId: string,\n principalType: EntraPrincipalType,\n clientIds: string[],\n options?: EntraIdAssignmentUpsertOptionalParams,\n ): Promise<EntraIdAssignmentUpsertResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.upsert\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { objectId, tenantId, principalType, clientIds, options },\n upsertOperationSpec,\n ) as Promise<EntraIdAssignmentUpsertResponse>;\n },\n );\n }\n\n /**\n * Removes an Entra access assignment.\n * @param objectId objectId we want to remove the assignment for. AcsResourceId is taken from\n * authentication.\n * @param options The options parameters.\n */\n async delete(\n objectId: string,\n options?: EntraIdAssignmentDeleteOptionalParams,\n ): Promise<void> {\n return tracingClient.withSpan(\n \"IdentityRestClient.delete\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { objectId, options },\n deleteOperationSpec,\n ) as Promise<void>;\n },\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments/{objectId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignment,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.objectId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst upsertOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments/{objectId}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignment,\n },\n 201: {\n bodyMapper: Mappers.EntraAssignment,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n tenantId: [\"tenantId\"],\n principalType: [\"principalType\"],\n clientIds: [\"clientIds\"],\n },\n mapper: { ...Mappers.EntraAssignmentCreateOrUpdateRequest, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.objectId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst deleteOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments/{objectId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.objectId],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"entraIdAssignment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/entraIdAssignment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAWtD,qDAAqD;AACrD,MAAM,OAAO,qBAAqB;IACf,MAAM,CAAqB;IAE5C;;;OAGG;IACH,YAA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S,EAAE;QACT,GAAG,EAAE,EAAE;QACP,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,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 { tracingClient } from \"../tracing.js\";\nimport { EntraIdAssignment } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { IdentityRestClient } from \"../identityRestClient.js\";\nimport {\n EntraIdAssignmentGetOptionalParams,\n EntraIdAssignmentGetResponse,\n EntraPrincipalType,\n EntraIdAssignmentUpsertOptionalParams,\n EntraIdAssignmentUpsertResponse,\n EntraIdAssignmentDeleteOptionalParams,\n} from \"../models/index.js\";\n\n/** Class containing EntraIdAssignment operations. */\nexport class EntraIdAssignmentImpl implements EntraIdAssignment {\n private readonly client: IdentityRestClient;\n\n /**\n * Initialize a new instance of the class EntraIdAssignment class.\n * @param client Reference to the service client\n */\n constructor(client: IdentityRestClient) {\n this.client = client;\n }\n\n /**\n * Get Entra access assignment by object id.\n * @param objectId objectId we want to get the assignment for. AcsResourceId is taken from\n * authentication.\n * @param options The options parameters.\n */\n async get(\n objectId: string,\n options?: EntraIdAssignmentGetOptionalParams,\n ): Promise<EntraIdAssignmentGetResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.get\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { objectId, options },\n getOperationSpec,\n ) as Promise<EntraIdAssignmentGetResponse>;\n },\n );\n }\n\n /**\n * Creates or replaces an Entra access assignment.\n * @param objectId objectId we want to update the assignment for.\n * @param tenantId\n * @param principalType\n * @param clientIds Array of EntraAssignmentCreateOrUpdateRequestClientIdsItem\n * @param options The options parameters.\n */\n async upsert(\n objectId: string,\n tenantId: string,\n principalType: EntraPrincipalType,\n clientIds: string[],\n options?: EntraIdAssignmentUpsertOptionalParams,\n ): Promise<EntraIdAssignmentUpsertResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.upsert\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { objectId, tenantId, principalType, clientIds, options },\n upsertOperationSpec,\n ) as Promise<EntraIdAssignmentUpsertResponse>;\n },\n );\n }\n\n /**\n * Removes an Entra access assignment.\n * @param objectId objectId we want to remove the assignment for. AcsResourceId is taken from\n * authentication.\n * @param options The options parameters.\n */\n async delete(\n objectId: string,\n options?: EntraIdAssignmentDeleteOptionalParams,\n ): Promise<void> {\n return tracingClient.withSpan(\n \"IdentityRestClient.delete\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { objectId, options },\n deleteOperationSpec,\n ) as Promise<void>;\n },\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments/{objectId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignment,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.objectId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst upsertOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments/{objectId}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignment,\n },\n 201: {\n bodyMapper: Mappers.EntraAssignment,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n tenantId: [\"tenantId\"],\n principalType: [\"principalType\"],\n clientIds: [\"clientIds\"],\n },\n mapper: { ...Mappers.EntraAssignmentCreateOrUpdateRequest, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.objectId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst deleteOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments/{objectId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.objectId],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -5,7 +5,6 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import { tracingClient } from "../tracing.js";
10
9
  import { setContinuationToken } from "../pagingHelper.js";
11
10
  import * as coreClient from "@azure/core-client";
@@ -14,6 +13,7 @@ import * as Parameters from "../models/parameters.js";
14
13
  /// <reference lib="esnext.asynciterable" />
15
14
  /** Class containing EntraIdAssignments operations. */
16
15
  export class EntraIdAssignmentsImpl {
16
+ client;
17
17
  /**
18
18
  * Initialize a new instance of the class EntraIdAssignments class.
19
19
  * @param client Reference to the service client
@@ -36,52 +36,35 @@ export class EntraIdAssignmentsImpl {
36
36
  return this;
37
37
  },
38
38
  byPage: (settings) => {
39
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
39
+ if (settings?.maxPageSize) {
40
40
  throw new Error("maxPageSize is not supported by this operation.");
41
41
  }
42
42
  return this.updatePagingPage(body, options, settings);
43
43
  },
44
44
  };
45
45
  }
46
- updatePagingPage(body, options, settings) {
47
- return __asyncGenerator(this, arguments, function* updatePagingPage_1() {
48
- let result;
49
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
50
- if (!continuationToken) {
51
- result = yield __await(this._update(body, options));
52
- let page = result.value || [];
53
- continuationToken = result.nextLink;
54
- setContinuationToken(page, continuationToken);
55
- yield yield __await(page);
56
- }
57
- while (continuationToken) {
58
- result = yield __await(this._updateNext(body, continuationToken, options));
59
- continuationToken = result.nextLink;
60
- let page = result.value || [];
61
- setContinuationToken(page, continuationToken);
62
- yield yield __await(page);
63
- }
64
- });
46
+ async *updatePagingPage(body, options, settings) {
47
+ let result;
48
+ let continuationToken = settings?.continuationToken;
49
+ if (!continuationToken) {
50
+ result = await this._update(body, options);
51
+ let page = result.value || [];
52
+ continuationToken = result.nextLink;
53
+ setContinuationToken(page, continuationToken);
54
+ yield page;
55
+ }
56
+ while (continuationToken) {
57
+ result = await this._updateNext(body, continuationToken, options);
58
+ continuationToken = result.nextLink;
59
+ let page = result.value || [];
60
+ setContinuationToken(page, continuationToken);
61
+ yield page;
62
+ }
65
63
  }
66
- updatePagingAll(body, options) {
67
- return __asyncGenerator(this, arguments, function* updatePagingAll_1() {
68
- var _a, e_1, _b, _c;
69
- try {
70
- for (var _d = true, _e = __asyncValues(this.updatePagingPage(body, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
71
- _c = _f.value;
72
- _d = false;
73
- const page = _c;
74
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
75
- }
76
- }
77
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
78
- finally {
79
- try {
80
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
81
- }
82
- finally { if (e_1) throw e_1.error; }
83
- }
84
- });
64
+ async *updatePagingAll(body, options) {
65
+ for await (const page of this.updatePagingPage(body, options)) {
66
+ yield* page;
67
+ }
85
68
  }
86
69
  /**
87
70
  * Updates Entra access assignments in bulk.
@@ -89,7 +72,7 @@ export class EntraIdAssignmentsImpl {
89
72
  * @param options The options parameters.
90
73
  */
91
74
  async _update(body, options) {
92
- return tracingClient.withSpan("IdentityRestClient._update", options !== null && options !== void 0 ? options : {}, async (options) => {
75
+ return tracingClient.withSpan("IdentityRestClient._update", options ?? {}, async (options) => {
93
76
  return this.client.sendOperationRequest({ body, options }, updateOperationSpec);
94
77
  });
95
78
  }
@@ -98,7 +81,7 @@ export class EntraIdAssignmentsImpl {
98
81
  * @param options The options parameters.
99
82
  */
100
83
  async list(options) {
101
- return tracingClient.withSpan("IdentityRestClient.list", options !== null && options !== void 0 ? options : {}, async (options) => {
84
+ return tracingClient.withSpan("IdentityRestClient.list", options ?? {}, async (options) => {
102
85
  return this.client.sendOperationRequest({ options }, listOperationSpec);
103
86
  });
104
87
  }
@@ -109,7 +92,7 @@ export class EntraIdAssignmentsImpl {
109
92
  * @param options The options parameters.
110
93
  */
111
94
  async _updateNext(body, nextLink, options) {
112
- return tracingClient.withSpan("IdentityRestClient._updateNext", options !== null && options !== void 0 ? options : {}, async (options) => {
95
+ return tracingClient.withSpan("IdentityRestClient._updateNext", options ?? {}, async (options) => {
113
96
  return this.client.sendOperationRequest({ body, nextLink, options }, updateNextOperationSpec);
114
97
  });
115
98
  }