Skip to content

Commit

Permalink
[Do not merge] IoTCentral - Add ARM endpoint, update model responses/…
Browse files Browse the repository at this point in the history
…inputs to align with expected values (#4015)

* Fix error model received from ARM

* Change model names to be specific to method, add validation to parameter, and send the type of query being requested

* Add endpoint to check subdomain availability

* Update models to align with expected responses

* Fix build errors

* Add required field to definitions

* Revert model name change.

* Remove typo

* Update spec file examples

* add x-ms-client-flatten to errorSchema

* Test default required field for .net SDK

* test enum default

* revert test changes
  • Loading branch information
r-delgadillo authored and jianghaolu committed Oct 19, 2018
1 parent 4a92c16 commit 17fe887
Show file tree
Hide file tree
Showing 10 changed files with 268 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,30 @@
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"api-version": "2018-09-01",
"operationInputs": {
"name": "myIoTCentralApp"
"name": "myIoTCentralApp",
"type": "IoTApps"
}
},
"responses": {
"200": {
"headers": {},
"description": "Returns information about resource name availability",
"headers": {
"code": "200"
},
"body": {
"nameAvailable": true
}
},
"default": {
"description": "Error message returned for an unexpected response",
"headers": {},
"body": {
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"api-version": "2018-09-01",
"operationInputs": {
"name": "myIoTCentralApp",
"type": "IoTApps"
}
},
"responses": {
"200": {
"description": "Returns information about resource subdomain availability",
"headers": {
"code": "200"
},
"body": {
"nameAvailable": true
}
},
"default": {
"description": "Error message returned for an unexpected response",
"headers": {},
"body": {
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@
},
"responses": {
"200": {
"headers": {},
"header": {
"code": "200",
"message": "OK"
},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.IoTCentral/IoTApps/myIoTCentralApp",
"name": "myIoTCentralApp",
"type": "Microsoft.IoTCentral/IoTApps",
"location": "westus",
"tags": {
"key": "value"
},
"properties": {
"applicationId": "6ebd8fd3-6e34-419e-908f-9be61ec6f6d6",
"displayName": "My IoT Central App 2",
Expand All @@ -34,12 +40,19 @@
}
},
"201": {
"headers": {},
"headers": {
"code": "201",
"message": "Created",
"target": "ResourceHandler.ExecutePutRequest"
},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.IoTCentral/IoTApps/myIoTCentralApp",
"name": "myIoTCentralApp",
"type": "Microsoft.IoTCentral/IoTApps",
"location": "westus",
"tags": {
"key": "value"
},
"properties": {
"applicationId": "6ebd8fd3-6e34-419e-908f-9be61ec6f6d6",
"displayName": "My IoT Central App",
Expand All @@ -51,6 +64,17 @@
}
}
},
"202": {}
"202": {},
"default": {
"description": "Error message returned for an unexpected response",
"headers": {},
"body": {
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,28 @@
"api-version": "2018-09-01"
},
"responses": {
"200": {},
"200": {
"header": {
"code": "200",
"message": "OK",
"target": "ResourceHandler.ExecuteDeleteRequest"
}
},
"202": {},
"204": {}
"204": {},
"default": {
"description": "Error message returned for an unexpected response",
"headers": {
"message": "Created",
"code": "200"
},
"body": {
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
},
"responses": {
"200": {
"headers": {},
"description": "Returns the application details",
"headers": {
"code": "200"
},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.IoTCentral/IoTApps/myIoTCentralApp",
"location": "westus",
"type": "Microsoft.IoTCentral/IoTApps",
"name": "myIoTCentralApp",
"tags": {
"key": "value"
},
"properties": {
"applicationId": "6ebd8fd3-6e34-419e-908f-9be61ec6f6d6",
"displayName": "My IoT Central App",
Expand All @@ -23,6 +29,17 @@
"name": "F1"
}
}
},
"default": {
"description": "Error message returned for an unexpected response",
"headers": {},
"body": {
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@
},
"responses": {
"200": {
"headers": {},
"headers": {
"code": "200"
},
"body": {
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.IoTCentral/IoTApps/myIoTCentralApp",
"location": "westus",
"type": "Microsoft.IoTCentral/IoTApps",
"name": "myIoTCentralApp",
"tags": {
"key": "value"
},
"properties": {
"applicationId": "6ebd8fd3-6e34-419e-908f-9be61ec6f6d6",
"displayName": "My IoT Central App",
Expand All @@ -24,7 +29,19 @@
"name": "F1"
}
}
]
],
"nextLink": null
}
},
"default": {
"description": "Error message returned for an unexpected response",
"headers": {},
"body": {
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
},
"responses": {
"200": {
"headers": {},
"headers": {
"code": "200"
},
"body": {
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.IoTCentral/IoTApps/myIoTCentralApp",
"location": "westus",
"type": "Microsoft.IoTCentral/IoTApps",
"name": "myIoTCentralApp",
"tags": {
"key": "value"
},
"properties": {
"applicationId": "6ebd8fd3-6e34-419e-908f-9be61ec6f6d6",
"displayName": "My IoT Central App",
Expand All @@ -23,7 +28,19 @@
"name": "F1"
}
}
]
],
"nextLink": null
},
"default": {
"description": "Error message returned for an unexpected response",
"headers": {},
"body": {
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@
},
"responses": {
"200": {
"headers": {},
"headers": {
"code": "200",
"message": "OK",
"target": "ResourceHandler.ExecutePatchRequest"
},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.IoTCentral/IoTApps/myIoTCentralApp",
"location": "westus",
"type": "Microsoft.IoTCentral/IoTApps",
"name": "myIoTCentralApp",
"tags": {
"key": "value"
},
"properties": {
"applicationId": "6ebd8fd3-6e34-419e-908f-9be61ec6f6d6",
"displayName": "My IoT Central App 2",
Expand All @@ -27,6 +34,17 @@
}
}
},
"202": {}
"202": {},
"default": {
"description": "Error message returned for an unexpected response",
"headers": {},
"body": {
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
},
"responses": {
"200": {
"headers": {},
"headers": {
"code": "200"
},
"body": {
"value": [
{
Expand Down Expand Up @@ -52,7 +54,19 @@
"description": "Gets all the available operations on IoT Central Applications"
}
}
]
],
"nextLink": null
}
},
"default": {
"description": "Error message returned for an unexpected response",
"headers": {},
"body": {
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
}
}
Expand Down
Loading

0 comments on commit 17fe887

Please sign in to comment.