Skip to content

Commit

Permalink
Communication common api types (#11749)
Browse files Browse the repository at this point in the history
* Common API types for Communication Services: Error and Identifier

* Rename type to kind

* Make error, code, message required as specified in guidelines

* Make all props on Identifier read-only

* prettier fix to add an empty line at the end

* add common.json to README

* make identifier id required and fix linter issues

* fix spelling

* make details an array of errors, rename error to CommunicationError

* grammar fix

* remove properties that are identical to id
  • Loading branch information
DominikMe authored Dec 2, 2020
1 parent 2ca86cf commit 82dc61d
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"swagger": "2.0",
"info": {
"title": "Communication",
"description": "Communication Services API common types.",
"version": "2020-11-19-preview1"
},
"paths": {},
"definitions": {
"CommunicationErrorResponse": {
"description": "The Communication Services error.",
"required": [
"error"
],
"properties": {
"error": {
"description": "The Communication Services error.",
"$ref": "#/definitions/CommunicationError"
}
}
},
"CommunicationError": {
"description": "The Communication Services error.",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"description": "The error code."
},
"message": {
"type": "string",
"description": "The error message."
},
"target": {
"type": "string",
"readOnly": true,
"description": "The error target."
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/CommunicationError"
},
"readOnly": true,
"description": "Further details about specific errors that led to this error."
},
"innererror": {
"x-ms-client-name": "innerError",
"readOnly": true,
"$ref": "#/definitions/CommunicationError",
"description": "The inner error if any."
}
},
"x-nullable": true
},
"CommunicationIdentifierKind": {
"description": "The kind of a communication identifier.",
"type": "string",
"enum": [
"unknown",
"communicationUser",
"phoneNumber",
"callingApplication"
],
"x-ms-enum": {
"name": "CommunicationIdentifierKind",
"modelAsString": true
}
},
"CommunicationIdentifier": {
"description": "Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user.",
"required": [
"kind",
"id"
],
"properties": {
"kind": {
"$ref": "#/definitions/CommunicationIdentifierKind",
"description": "Kind of the communication identifier."
},
"id": {
"type": "string",
"description": "Full Id of the identifier."
},
"phoneNumber": {
"type": "string",
"readOnly": true,
"description": "The phone number in E.164 format."
}
}
}
},
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow.",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
}
}
9 changes: 9 additions & 0 deletions specification/communication/data-plane/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ input-file:
- Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/CommunicationIdentity.json
```

### Tag: package-2020-11-19-preview1

These settings apply only when `--tag=package-2020-11-19-preview1` is specified on the command line.

```yaml $(tag) == 'package-2020-11-19-preview1'
input-file:
- Microsoft.CommunicationServicesCommon/preview/2020-11-19-preview1/common.json
```

---

# Code Generation
Expand Down

0 comments on commit 82dc61d

Please sign in to comment.