diff --git a/custom-words.txt b/custom-words.txt index ccb191e08946..9b7b49489de5 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -1785,6 +1785,7 @@ routable routingendpointhealth rpki RPKI +rpmsg rpns RSAES RSASSA diff --git a/specification/communication/data-plane/Email/preview/2021-10-01-preview/CommunicationServicesEmail.json b/specification/communication/data-plane/Email/preview/2021-10-01-preview/CommunicationServicesEmail.json new file mode 100644 index 000000000000..1a427a342c99 --- /dev/null +++ b/specification/communication/data-plane/Email/preview/2021-10-01-preview/CommunicationServicesEmail.json @@ -0,0 +1,461 @@ +{ + "swagger": "2.0", + "info": { + "title": "CommunicationEmailClient", + "description": "Azure Communication Email Service", + "version": "2021-10-01-preview" + }, + "paths": { + "/emails/{messageId}/status": { + "get": { + "tags": [ + "EmailGetSendStatus" + ], + "summary": "Gets the status of a message sent previously.", + "operationId": "Email_GetSendStatus", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "messageId", + "description": "System generated message id (GUID) returned from a previous call to send email", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "headers": { + "x-ms-error-code": { + "description": "Error code - this will be the same as the code in the error property in the response body.", + "type": "string" + } + }, + "schema": { + "$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Message status was successfully retrieved.", + "headers": { + "Retry-After": { + "description": "Amount of time client should wait before retrying the request, specified in seconds ", + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/SendStatusResult" + } + } + }, + "x-ms-examples": { + "Get Message Status": { + "$ref": "./examples/GetSendStatus.json" + } + } + } + }, + "/emails:send": { + "post": { + "tags": [ + "EmailSend" + ], + "summary": "Queues an email message to be sent to one or more recipients", + "operationId": "Email_Send", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "header", + "name": "repeatability-request-id", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs.", + "type": "string", + "required": true + }, + { + "in": "header", + "name": "repeatability-first-sent", + "description": "Must be sent by clients to specify that a request is repeatable. Repeatability-First-Sent is used to specify the date and time at which the request was first created in the IMF-fix date form of HTTP-date as defined in RFC7231. eg- Tue, 26 Mar 2019 16:06:51 GMT", + "type": "string", + "required": true + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "emailMessage", + "description": "Message payload for sending an email", + "required": true, + "schema": { + "$ref": "#/definitions/EmailMessage" + } + } + ], + "responses": { + "default": { + "description": "Error", + "headers": { + "x-ms-error-code": { + "description": "Error code - this will be the same as the code in the error property in the response body.", + "type": "string" + } + }, + "schema": { + "$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "Message accepted, the `Operation-Location` header contains the URL to poll for the message status.", + "headers": { + "Repeatability-Result": { + "description": "Status of a repeatable request.", + "type": "string" + }, + "Operation-Location": { + "description": "Location url of where to poll the status of this message from.", + "type": "string" + }, + "Retry-After": { + "description": "Amount of time client should wait before retrying the request, specified in seconds ", + "type": "integer" + }, + "x-ms-request-id": { + "description": "System generated GUID indicating the id of this specific message, to be used for tracking purposes.", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "Send Email": { + "$ref": "./examples/SendEmail.json" + } + } + } + } + }, + "definitions": { + "EmailMessage": { + "description": "Message payload for sending an email", + "required": [ + "sender", + "content", + "recipients" + ], + "type": "object", + "properties": { + "headers": { + "description": "Custom email headers to be passed.", + "type": "array", + "x-ms-client-name": "CustomHeaders", + "items": { + "$ref": "#/definitions/EmailCustomHeader" + } + }, + "sender": { + "description": "Sender email address from a verified domain.", + "type": "string", + "example": "info@contoso.com" + }, + "content": { + "description": "Email content to be sent.", + "$ref": "#/definitions/EmailContent" + }, + "importance": { + "description": "The importance type for the email.", + "$ref": "#/definitions/EmailImportance" + }, + "recipients": { + "description": "Recipients for the email.", + "$ref": "#/definitions/EmailRecipients" + }, + "attachments": { + "description": "list of attachments", + "type": "array", + "items": { + "$ref": "#/definitions/EmailAttachment" + } + }, + "replyTo": { + "description": "Email addresses where recipients' replies will be sent to.", + "type": "array", + "items": { + "$ref": "#/definitions/EmailAddress" + } + }, + "disableUserEngagementTracking": { + "description": "Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane.", + "type": "boolean" + } + } + }, + "EmailCustomHeader": { + "description": "Custom header for email.", + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "description": "Header name.", + "type": "string", + "example": "" + }, + "value": { + "description": "Header value.", + "type": "string", + "example": "" + } + } + }, + "EmailAddress": { + "description": "An object representing the email address and its display name", + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "description": "Email address.", + "type": "string", + "example": "abc@contoso.com" + }, + "displayName": { + "description": "Email display name.", + "type": "string", + "example": "abc" + } + } + }, + "EmailContent": { + "description": "Content of the email.", + "type": "object", + "required": [ + "subject" + ], + "properties": { + "subject": { + "description": "Subject of the email message", + "type": "string", + "example": "An exciting offer especially for you!" + }, + "plainText": { + "description": "Plain text version of the email message.", + "type": "string", + "example": "This exciting offer was created especially for you, our most loyal customer." + }, + "html": { + "description": "Html version of the email message.", + "type": "string", + "example": "Exciting offer!

This exciting offer was created especially for you, our most loyal customer.

" + } + } + }, + "EmailImportance": { + "description": "The importance type for the email.", + "enum": [ + "high", + "normal", + "low" + ], + "type": "string", + "default": "normal", + "x-ms-enum": { + "name": "EmailImportance", + "modelAsString": true + } + }, + "EmailAttachment": { + "description": "Attachment to the email.", + "type": "object", + "required": [ + "name", + "attachmentType", + "contentBytesBase64" + ], + "properties": { + "name": { + "description": "Name of the attachment", + "type": "string", + "example": "attachment.pdf" + }, + "attachmentType": { + "$ref": "#/definitions/EmailAttachmentType" + }, + "contentBytesBase64": { + "description": "Base64 encoded contents of the attachment", + "type": "string", + "example": "TWFueSBoYW5kcyBtYWtlIGxpZ2h0I" + } + } + }, + "EmailAttachmentType": { + "description": "The type of attachment file.", + "enum": [ + "avi", + "bmp", + "doc", + "docm", + "docx", + "gif", + "jpeg", + "mp3", + "one", + "pdf", + "png", + "ppsm", + "ppsx", + "ppt", + "pptm", + "pptx", + "pub", + "rpmsg", + "rtf", + "tif", + "txt", + "vsd", + "wav", + "wma", + "xls", + "xlsb", + "xlsm", + "xlsx" + ], + "type": "string", + "x-ms-enum": { + "name": "EmailAttachmentType", + "modelAsString": true + } + }, + "EmailRecipients": { + "description": "Recipients of the email", + "type": "object", + "required": [ + "to" + ], + "properties": { + "to": { + "description": "Email To recipients", + "type": "array", + "items": { + "$ref": "#/definitions/EmailAddress" + } + }, + "CC": { + "description": "Email CC recipients", + "type": "array", + "items": { + "$ref": "#/definitions/EmailAddress" + } + }, + "bCC": { + "description": "Email BCC recipients", + "type": "array", + "items": { + "$ref": "#/definitions/EmailAddress" + } + } + } + }, + "SendStatusResult": { + "description": "Status of an email message that was sent previously.", + "type": "object", + "required": [ + "messageId", + "status" + ], + "properties": { + "messageId": { + "description": "System generated id of an email message sent.", + "type": "string", + "example": "F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4" + }, + "status": { + "$ref": "#/definitions/SendStatus" + } + } + }, + "SendStatus": { + "description": "The type indicating the status of a request.", + "enum": [ + "queued", + "outForDelivery", + "dropped" + ], + "type": "string", + "x-ms-enum": { + "name": "SendStatus", + "modelAsString": true, + "values": [ + { + "value": "queued", + "description": "The message has passed basic validations and has been queued to be processed further." + }, + { + "value": "outForDelivery", + "description": "The message has been processed and is now out for delivery." + }, + { + "value": "dropped", + "description": "The message could not be processed and was dropped." + } + ] + } + } + }, + "parameters": { + "ApiVersionParameter": { + "in": "query", + "name": "api-version", + "description": "Version of API to invoke.", + "required": true, + "enum": [ + "2021-10-01-preview" + ], + "type": "string" + } + }, + "securityDefinitions": { + "Authorization": { + "type": "apiKey", + "name": "Authorization", + "in": "header", + "description": "An authentication string containing a signature generated using HMAC-SHA256 scheme." + } + }, + "security": [ + { + "Authorization": [] + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "description": "The communication resource, for example https://my-resource.communication.azure.com", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" + } + ] + } +} diff --git a/specification/communication/data-plane/Email/preview/2021-10-01-preview/examples/GetSendStatus.json b/specification/communication/data-plane/Email/preview/2021-10-01-preview/examples/GetSendStatus.json new file mode 100644 index 000000000000..31bb078abc0e --- /dev/null +++ b/specification/communication/data-plane/Email/preview/2021-10-01-preview/examples/GetSendStatus.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-10-01-preview", + "authorization": "HMAC-SHA256 SignedHeaders=x-ms-date;host;x-ms-content-sha256&Signature=aaaa", + "messageId": "F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4" + }, + "responses": { + "200": { + "headers": { + "Retry-After": 100 + }, + "body": { + "messageId": "F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4", + "status": "queued" + } + } + } +} diff --git a/specification/communication/data-plane/Email/preview/2021-10-01-preview/examples/SendEmail.json b/specification/communication/data-plane/Email/preview/2021-10-01-preview/examples/SendEmail.json new file mode 100644 index 000000000000..331b415fa3a9 --- /dev/null +++ b/specification/communication/data-plane/Email/preview/2021-10-01-preview/examples/SendEmail.json @@ -0,0 +1,89 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-10-01-preview", + "repeatability-request-id": "8540c0de-899f-5cce-acb5-3ec493af3800", + "repeatability-first-sent": "Sun, 06 Nov 1994 08:49:37 GMT", + "authorization": "HMAC-SHA256 SignedHeaders=x-ms-date;host;x-ms-content-sha256&Signature=aaaa", + "emailMessage": { + "headers": [ + { + "name": "ClientCorrelationId", + "value": "123" + }, + { + "name": "ClientCustomHeaderName", + "value": "ClientCustomHeaderValue" + } + ], + "sender": "abc@domain.com", + "content": { + "subject": "An exciting offer especially for you!", + "plainText": "This exciting offer was created especially for you, our most loyal customer.", + "html": "Exciting offer!

This exciting offer was created especially for you, our most loyal customer.

" + }, + "importance": "normal", + "recipients": { + "to": [ + { + "email": "john.doe@domain.com", + "displayName": "John Doe" + }, + { + "email": "jane.doe@domain2.com", + "displayName": "Jane Doe" + } + ], + "CC": [ + { + "email": "wendy@someotherdomain.com", + "displayName": "Wendy" + }, + { + "email": "jimmy@anotherdomain.com", + "displayName": "Jimmy Johns" + } + ], + "bCC": [ + { + "email": "bob@anotherdomain.com", + "displayName": "Bob" + }, + { + "email": "mail@yetanotherdomain.com", + "displayName": "Another DisplayName" + } + ] + }, + "attachments": [ + { + "name": "MyAttachment.pdf", + "attachmentType": "pdf", + "contentBytesBase64": "TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu" + }, + { + "name": "MyAttachment2.docx", + "attachmentType": "docx", + "contentBytesBase64": "pZ2h0IHdvcmsu5kcyBtYWtlIGxpZ2h0IHdvcmsu" + } + ], + "replyTo": [ + { + "email": "contoso-support@contoso.com", + "displayName": "Contoso Support" + } + ], + "disableUserEngagementTracking": true + } + }, + "responses": { + "202": { + "headers": { + "Repeatability-Result": "accepted", + "Operation-Location": "https://contoso.westus.communications.azure.com//email/status/8540c0de-899f-5cce-acb5-3ec493af3800?api-version=2021-10-01-preview", + "Retry-After": 1, + "x-ms-request-id": "8540c0de-899f-5cce-acb5-3ec493af3800" + } + } + } +} diff --git a/specification/communication/data-plane/Email/readme.csharp.md b/specification/communication/data-plane/Email/readme.csharp.md new file mode 100644 index 000000000000..2efd3715cdc3 --- /dev/null +++ b/specification/communication/data-plane/Email/readme.csharp.md @@ -0,0 +1,15 @@ +## C + +These settings apply only when `--csharp` is specified on the command line. +Please also specify `--csharp-sdks-folder=`. + +```yaml $(csharp) +csharp: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 1 + clear-output-folder: true + client-side-validation: false + namespace: Microsoft.CommunicationServices + output-folder: $(csharp-sdks-folder)/communicationservices/management/Microsoft.CommunicationServices/GeneratedProtocol +``` diff --git a/specification/communication/data-plane/Email/readme.md b/specification/communication/data-plane/Email/readme.md new file mode 100644 index 000000000000..5a081adf4b64 --- /dev/null +++ b/specification/communication/data-plane/Email/readme.md @@ -0,0 +1,64 @@ +# communicationservices + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for communicationservices. + +## Getting Started + +To build the SDKs for My API, simply install AutoRest via `npm` (`npm install -g autorest`) and then run: + +> `autorest readme.md` + +To see additional help and options, run: + +> `autorest --help` + +For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page. + +--- + +## Configuration + +### Basic Information + +These are the global settings for the communicationservices. + +```yaml +openapi-type: data-plane +tag: package-2021-10-01-preview +``` + +### Tag: package-2021-10-01-preview + +These settings apply only when `--tag=package-2021-10-01-preview` is specified on the command line. + +```yaml $(tag) == 'package-2021-10-01-preview' +input-file: + - preview/2021-10-01-preview/CommunicationServicesEmail.json +title: + Azure Communication Services +``` + +--- + +# Code Generation + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +## CSharp + +See configuration in [readme.csharp.md](./readme.csharp.md) + +## Suppression + +``` yaml +directive: + - suppress: DefinitionsPropertiesNamesCamelCase + from: CommunicationServicesEmail.json + where: $.definitions.EmailRecipients.properties.CC + reason: Linter enforcement of this rule (camelCase) for two-letter acronyms conflicts with the description in the rule (all capitalized). +```