-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stable version of common model swagger for Azure Communication Services #12799
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "Communication", | ||
"description": "Communication Services API common types.", | ||
"version": "2021-03-07" | ||
}, | ||
"paths": {}, | ||
"definitions": { | ||
"CommunicationErrorResponse": { | ||
"description": "The Communication Services error.", | ||
"type": "object", | ||
"required": [ | ||
"error" | ||
], | ||
"properties": { | ||
"error": { | ||
"description": "The Communication Services error.", | ||
"$ref": "#/definitions/CommunicationError" | ||
} | ||
} | ||
}, | ||
"CommunicationError": { | ||
"description": "The Communication Services error.", | ||
"type": "object", | ||
"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." | ||
} | ||
} | ||
}, | ||
"CommunicationCloudEnvironmentModel": { | ||
"description": "The cloud that the identifier belongs to.", | ||
"type": "string", | ||
"enum": [ | ||
"public", | ||
"dod", | ||
"gcch" | ||
], | ||
"x-ms-enum": { | ||
"name": "CommunicationCloudEnvironmentModel", | ||
"modelAsString": true | ||
} | ||
}, | ||
"CommunicationIdentifierModel": { | ||
"description": "Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set.", | ||
"type": "object", | ||
"properties": { | ||
"rawId": { | ||
amrelroumy-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"type": "string", | ||
"description": "Raw Id of the identifier. Optional in requests, required in responses." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. assuming rawId would be required in events as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, any outbound from Communication Services would include the |
||
}, | ||
"communicationUser": { | ||
"$ref": "#/definitions/CommunicationUserIdentifierModel", | ||
"description": "The communication user." | ||
}, | ||
"phoneNumber": { | ||
"$ref": "#/definitions/PhoneNumberIdentifierModel", | ||
"description": "The phone number." | ||
}, | ||
"microsoftTeamsUser": { | ||
"$ref": "#/definitions/MicrosoftTeamsUserIdentifierModel", | ||
"description": "The Microsoft Teams user." | ||
} | ||
} | ||
}, | ||
"CommunicationUserIdentifierModel": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with eliminating explicit "kind" enum and having "optional" full objects, would result customers processing the events as : if (eventData.CommunicationUser != null) Not a clean switch case. Also it will be difficult distinguish between an error case(all user representation objects are null) and new user object(which can be detected by default label in a switch case). So would it be beneficial to include "kind" along with the specific objects? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. having There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
👆🏻 is a valid case, all being null is equivalent to |
||
"description": "A user that got created with an Azure Communication Services resource.", | ||
"type": "object", | ||
"required": [ | ||
"id" | ||
], | ||
"properties": { | ||
"id": { | ||
amrelroumy-msft marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this "id" be full MRI or will it be the inside "8:acs:<stable_resource_id>_"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the full MRI |
||
"type": "string", | ||
"description": "The Id of the communication user." | ||
} | ||
} | ||
}, | ||
"PhoneNumberIdentifierModel": { | ||
"description": "A phone number.", | ||
"type": "object", | ||
"required": [ | ||
"value" | ||
], | ||
"properties": { | ||
"value": { | ||
"type": "string", | ||
"description": "The phone number in E.164 format." | ||
} | ||
} | ||
}, | ||
"MicrosoftTeamsUserIdentifierModel": { | ||
"description": "A Microsoft Teams user.", | ||
"type": "object", | ||
"required": [ | ||
"userId" | ||
], | ||
"properties": { | ||
"userId": { | ||
"type": "string", | ||
"description": "The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user." | ||
}, | ||
"isAnonymous": { | ||
"type": "boolean", | ||
"description": "True if the Microsoft Teams user is anonymous. By default false if missing." | ||
}, | ||
"cloud": { | ||
"$ref": "#/definitions/CommunicationCloudEnvironmentModel", | ||
"description": "The cloud that the Microsoft Teams user belongs to. By default 'public' if missing." | ||
} | ||
} | ||
} | ||
}, | ||
"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" | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would CallingApplication be brought back later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, once we support it, we should add it. We removed it for now, as it does not seem to be used in any GA service and internally we have yet to finalize which format would be mapped to applications to avoid breaking changes in the SDK code. Once they are all decided, we can add it back as a non-breaking change