Skip to content

Commit 3583e04

Browse files
committed
add to toc and small snippet improvements
1 parent abd97d6 commit 3583e04

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

articles/communication-services/concepts/includes/identifiers/identifiers-android.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The `MicrosoftTeamsUserIdentifier` represents a Teams user with its Azure AD use
4141

4242
```java
4343
// get the Teams user's ID if only the email is known, assuming a helper method
44-
var userId = getUserIdFromGraph("[email protected]");
44+
String userId = getUserIdFromGraph("[email protected]");
4545

4646
// create an identifier
4747
var teamsUser = new MicrosoftTeamsUserIdentifier(userId);

articles/communication-services/concepts/includes/identifiers/identifiers-java.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The `MicrosoftTeamsUserIdentifier` represents a Teams user with its Azure AD use
4141

4242
```java
4343
// get the Teams user's ID if only the email is known, assuming a helper method
44-
var userId = getUserIdFromGraph("[email protected]");
44+
String userId = getUserIdFromGraph("[email protected]");
4545

4646
// create an identifier
4747
var teamsUser = new MicrosoftTeamsUserIdentifier(userId);

articles/communication-services/concepts/includes/identifiers/identifiers-js.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The `CommunicationUserIdentifier` interface represents a user identity that was
2020

2121
#### Basic usage
2222

23-
```typescript
23+
```javascript
2424
// at some point you will have created a new user identity in your trusted service
2525
const newUser = await identityClient.createUser();
2626

@@ -39,7 +39,7 @@ The `MicrosoftTeamsUserIdentifier` interface represents a Teams user. You need t
3939

4040
#### Basic usage
4141

42-
```typescript
42+
```javascript
4343
// get the Teams user's ID if only the email is known, assuming a helper method
4444
const userId = await getUserIdFromGraph("[email protected]");
4545

@@ -60,7 +60,7 @@ The `PhoneNumberIdentifier` interface represents a phone number. The service ass
6060

6161
#### Basic usage
6262

63-
```typescript
63+
```javascript
6464
// create an identifier
6565
const phoneNumber = { phoneNumber: "+112345556789" };
6666
```
@@ -75,7 +75,7 @@ The `UnknownIdentifier` interface exists for future-proofing and you might encou
7575

7676
#### Basic usage
7777

78-
```typescript
78+
```javascript
7979
// create an identifier
8080
const unknownId = { id: "a raw id that originated in the service" };
8181
```
@@ -88,7 +88,7 @@ const unknownId = { id: "a raw id that originated in the service" };
8888

8989
While you construct identifiers for a concrete type that you pass *into* the SDK, the SDK returns a `CommunicationIdentifierKind`, which is a [discriminated union](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions). It's easy to narrow to a concrete type and we suggest a switch-case statement with pattern matching:
9090

91-
```typescript
91+
```javascript
9292
switch (communicationIdentifier.kind)
9393
{
9494
case "communicationUser":
@@ -116,7 +116,7 @@ switch (communicationIdentifier.kind)
116116

117117
The identifier interfaces have been designed so that you don't have to specify `kind` to reduce verbosity, and the discriminating union with the `kind` property is only used when returned from the SDK. However, if you find yourself needing to translate an identifier to its corresponding discriminating union type you can use this helper:
118118

119-
```typescript
119+
```javascript
120120
const identifierKind = getIdentifierKind(identifier); // now you can switch-case on the kind
121121
```
122122

@@ -128,7 +128,7 @@ For that purpose, identifiers have another representation called `RawId`. An ide
128128

129129
Since `[email protected]` the SDK helps with the conversion:
130130

131-
```typescript
131+
```javascript
132132
// get an identifier's raw Id
133133
const rawId = getIdentifierRawId(communicationIdentifier);
134134

articles/communication-services/concepts/includes/identifiers/identifiers-net.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The `MicrosoftTeamsUserIdentifier` represents a Teams user with its Azure AD use
4141

4242
```csharp
4343
// get the Teams user's ID if only the email is known, assuming a helper method
44-
var userId = await GetUserIdFromGraph("[email protected]");
44+
string userId = await GetUserIdFromGraph("[email protected]");
4545

4646
// create an identifier
4747
var teamsUser = new MicrosoftTeamsUserIdentifier(userId);

articles/communication-services/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ items:
145145
href: concepts/identity-model.md
146146
- name: Authenticating services
147147
href: concepts/authentication.md
148+
- name: Understand identifiers
149+
href: concepts/identifiers.md
148150
- name: Credentials best practices
149151
href: concepts/credentials-best-practices.md
150152
- name: Chat

0 commit comments

Comments
 (0)