Skip to content

Commit

Permalink
[Hub Generated] Review request for Microsoft.Communication to add ver…
Browse files Browse the repository at this point in the history
…sion preview/2020-08-20-preview (#11308)

* Add checkNameAvailability endpoint

* Add checkNameAvailability examples

* Whitespace in examples

* Spelling

Co-authored-by: Ben Viglietta <[email protected]>
  • Loading branch information
bviglietta and Ben Viglietta authored Oct 27, 2020
1 parent 618cbfe commit fae84d4
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,60 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Communication/checkNameAvailability": {
"post": {
"description": "Checks that the CommunicationService name is valid and is not already in use.",
"operationId": "CommunicationService_CheckNameAvailability",
"summary": "Check Name Availability",
"tags": [
"CommunicationService"
],
"parameters": [
{
"name": "nameAvailabilityParameters",
"in": "body",
"schema": {
"$ref": "#/definitions/NameAvailabilityParameters"
},
"description": "Parameters supplied to the operation."
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
}
],
"consumes": [
"application/json"
],
"responses": {
"200": {
"description": "Success. The response describes the name availability.",
"schema": {
"$ref": "#/definitions/NameAvailability"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"produces": [
"application/json"
],
"x-ms-examples": {
"Check name availability available": {
"$ref": "./examples/checkNameAvailabilityAvailable.json"
},
"Check name availability unavailable": {
"$ref": "./examples/checkNameAvailabilityUnavailable.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/linkNotificationHub": {
"post": {
"description": "Links an Azure Notification Hub to this communication service.",
Expand Down Expand Up @@ -763,6 +817,42 @@
}
}
},
"NameAvailabilityParameters": {
"description": "Data POST-ed to the nameAvailability action",
"required": [
"type",
"name"
],
"type": "object",
"properties": {
"type": {
"description": "The resource type. Should be always \"Microsoft.Communication/CommunicationServices\".",
"type": "string"
},
"name": {
"description": "The CommunicationService name to validate. e.g.\"my-CommunicationService-name-here\"",
"type": "string"
}
}
},
"NameAvailability": {
"description": "Result of the request to check name availability. It contains a flag and possible reason of failure.",
"type": "object",
"properties": {
"nameAvailable": {
"description": "Indicates whether the name is available or not.",
"type": "boolean"
},
"reason": {
"description": "The reason of the availability. Required if name is not available.",
"type": "string"
},
"message": {
"description": "The message of the operation.",
"type": "string"
}
}
},
"LinkNotificationHubParameters": {
"description": "Description of an Azure Notification Hub to link to the communication service",
"required": [
Expand Down Expand Up @@ -796,7 +886,7 @@
"type": "object",
"properties": {
"id": {
"description": "The operation Id.",
"description": "Fully qualified ID for the operation status.",
"type": "string",
"readOnly": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parameters": {
"subscriptionId": "12345",
"api-version": "2020-08-20-preview",
"nameAvailabilityParameters": {
"type": "Microsoft.Communication/CommunicationServices",
"name": "MyCommunicationService"
}
},
"responses": {
"200": {
"body": {
"nameAvailable": true,
"reason": "NameAvailable",
"message": "Requested name is available for the requested type"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parameters": {
"subscriptionId": "12345",
"api-version": "2020-08-20-preview",
"nameAvailabilityParameters": {
"type": "Microsoft.Communication/CommunicationServices",
"name": "MyCommunicationService"
}
},
"responses": {
"200": {
"body": {
"nameAvailable": false,
"reason": "AlreadyExists",
"message": "Requested name is unavailable for the requested type"
}
}
}
}

0 comments on commit fae84d4

Please sign in to comment.