Skip to content

Commit

Permalink
Add missing debugsend and patch operation for NotificationHub resource (
Browse files Browse the repository at this point in the history
#3215)

* Add suppressions for linting errors. Approved by Gaurav

* Add debugsend and NH patch operation

* Fix build error due to missing parameterId

* Fix build errors

* Fix more errors

* Fix build errors due to mismatch parameters

* Fix error with missing parameters value for DebugSend

* Change DebugSendResult from string to object

* Fix DebugSend build errors
  • Loading branch information
blocphan authored and jianghaolu committed Jun 13, 2018
1 parent ffb011f commit 289cf40
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"api-version": "2017-04-01",
"subscriptionId": "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40",
"parameters": {
"name": "sdk-Namespace-2924",
"location": "West Europe"
"name": "sdk-Namespace-2924"
}
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"parameters": {
"namespaceName": "nh-sdk-ns",
"resourceGroupName": "5ktrial",
"notificationHubName": "nh-sdk-hub",
"api-version": "2017-04-01",
"subscriptionId": "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40",
"parameters": {
"data": {
"message": "Hello"
}
}
},
"responses": {
"201": {
"body": {
"id": "/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/sdkresourceGroup/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/notificationHubs/nh-sdk-hub",
"name": "nh-sdk-hub",
"type": "Microsoft.NotificationHubs/namespaces/notificationHubs",
"location": "South Central US",
"tags": null,
"properties": {
"success": 1,
"failure": 0,
"results": null
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"parameters": {
"namespaceName": "nh-sdk-ns",
"resourceGroupName": "sdkresourceGroup",
"notificationHubName": "sdk-notificationHubs-8708",
"api-version": "2017-04-01",
"subscriptionId": "29cfa613-cbbc-4512-b1d6-1b3a92c7fa40",
"parameters": {
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/sdkresourceGroup/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/notificationHubs/nh-sdk-hub",
"name": "nh-sdk-hub",
"type": "Microsoft.NotificationHubs/namespaces/notificationHubs",
"location": "South Central US",
"tags": null,
"properties": {
"registrationTtl": "10675199.02:48:05.4775807",
"authorizationRules": []
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,64 @@
}
}
},
"patch": {
"tags": [
"NotificationHubs"
],
"x-ms-examples": {
"notificationhubPatch": {
"$ref": "./examples/NotificationHubs/NotificationHubPatch.json"
}
},
"operationId": "NotificationHubs_Patch",
"description": "Patch a NotificationHub in a namespace.",
"parameters": [
{
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group."
},
{
"name": "namespaceName",
"in": "path",
"required": true,
"type": "string",
"description": "The namespace name."
},
{
"name": "notificationHubName",
"in": "path",
"required": true,
"type": "string",
"description": "The notification hub name."
},
{
"name": "parameters",
"in": "body",
"required": false,
"schema": {
"$ref": "#/definitions/NotificationHubPatchParameters"
},
"description": "Parameters supplied to patch a NotificationHub Resource."
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "NotificationHub is patched",
"schema": {
"$ref": "#/definitions/NotificationHubResource"
}
}
}
},
"delete": {
"tags": [
"NotificationHubs"
Expand Down Expand Up @@ -916,6 +974,66 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend": {
"post": {
"tags": [
"NotificationHubs"
],
"x-ms-examples": {
"debugsend": {
"$ref": "./examples/NotificationHubs/NotificationHubDebugSend.json"
}
},
"operationId": "NotificationHubs_DebugSend",
"description": "test send a push notification",
"parameters": [
{
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group."
},
{
"name": "namespaceName",
"in": "path",
"required": true,
"type": "string",
"description": "The namespace name."
},
{
"name": "notificationHubName",
"in": "path",
"required": true,
"type": "string",
"description": "The notification hub name."
},
{
"name": "parameters",
"in": "body",
"required": false,
"schema": {
"$ref": "#/definitions/DebugSendParameters"
},
"description": "Debug send parameters"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"201": {
"description": "push send status",
"schema": {
"$ref": "#/definitions/DebugSendResponse"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}": {
"put": {
"tags": [
Expand Down Expand Up @@ -1474,8 +1592,7 @@
}
},
"required": [
"name",
"location"
"name"
],
"description": "Parameters supplied to the Check Name Availability for Namespace and NotificationHubs."
},
Expand Down Expand Up @@ -2017,6 +2134,25 @@
],
"description": "Parameters supplied to the CreateOrUpdate NotificationHub operation."
},
"NotificationHubPatchParameters": {
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/NotificationHubProperties",
"description": "Properties of the NotificationHub."
}
},
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"description": "Parameters supplied to the patch NotificationHub operation."
},
"DebugSendParameters": {
"description": "Debug Send payload",
"type": "object"
},
"NotificationHubResource": {
"properties": {
"properties": {
Expand All @@ -2032,6 +2168,21 @@
],
"description": "Description of a NotificationHub Resource."
},
"DebugSendResponse": {
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/DebugSendResult",
"description": "Properties of the NotificationHub."
}
},
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"description": "Description of a NotificationHub Resource."
},
"PnsCredentialsResource": {
"properties": {
"properties": {
Expand Down Expand Up @@ -2136,6 +2287,23 @@
},
"x-ms-azure-resource": true
},
"DebugSendResult": {
"properties": {
"success": {
"type": "number",
"description": "successful send"
},
"failure": {
"type": "number",
"description": "send failure"
},
"results": {
"type": "object",
"description": "actual failure description"
}
},
"x-ms-azure-resource": true
},
"Sku": {
"properties": {
"name": {
Expand Down
7 changes: 6 additions & 1 deletion specification/notificationhubs/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ directive:
``` yaml
openapi-type: arm
tag: package-2017-04
directive:
- where:
- $.definitions.NamespaceCreateOrUpdateParameters
suppress:
- TrackedResourcePatchOperation
- TrackedResourceGetOperation
```
### Tag: package-2017-04
These settings apply only when `--tag=package-2017-04` is specified on the command line.
Expand Down

0 comments on commit 289cf40

Please sign in to comment.