Skip to content

Commit

Permalink
deviceupdate change and add readme (test-repo-billy#3066)
Browse files Browse the repository at this point in the history
  • Loading branch information
dw511214992 authored and azure-sdk committed Jun 7, 2022
1 parent e4ec042 commit 3314542
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
"azure_auth": [
"user_impersonation"
]
},
{
"AADToken": [
"https://api.adu.microsoft.com/.default"
]
}
],
"securityDefinitions": {
Expand All @@ -39,6 +44,12 @@
"scopes": {
"user_impersonation": "impersonate your user account"
}
},
"AADToken": {
"type": "oauth2",
"flow": "accessCode",
"authorizationUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/authorize",
"tokenUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/token"
}
},
"paths": {
Expand Down Expand Up @@ -1198,56 +1209,6 @@
}
}
},
"/deviceupdate/{instanceId}/management/groups/{groupId}/bestUpdates": {
"get": {
"tags": [
"Device and deployment management"
],
"description": "Get the best available updates for a group and a count of how many devices need each update.",
"operationId": "DeviceManagement_ListBestUpdatesForGroup",
"x-ms-examples": {
"DeviceManagement_ListBestUpdatesForGroup": {
"$ref": "./examples/DeviceManagement_ListBestUpdatesForGroup.json"
}
},
"parameters": [
{
"$ref": "#/parameters/InstanceIdParameter"
},
{
"$ref": "#/parameters/GroupIdParameter"
},
{
"name": "$filter",
"in": "query",
"required": false,
"type": "string",
"description": "Restricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property."
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "The best available updates for a group and a count of how many devices need each update.",
"schema": {
"$ref": "#/definitions/UpdatableDevicesList"
}
},
"default": {
"description": "Default response.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-odata": "#/definitions/GroupBestUpdatesFilter",
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments": {
"get": {
"tags": [
Expand Down
14 changes: 14 additions & 0 deletions specification/deviceupdate/data-plane/readme.csharp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## csharp

These settings apply only when `--csharp` is specified on the command line.
Please also specify `--csharp-sdks-folder=<path to "SDKs" directory of your azure-sdk-for-net clone>`.

```yaml $(csharp)
public-clients: true
title: DeviceUpdate
namespace: Azure.IoT.DeviceUpdate
data-plane: true
security: AADToken
security-scopes: https://api.adu.microsoft.com/.default
output-folder: $(csharp-sdks-folder)/sdk/deviceupdate/$(namespace)/src/Generated
```
23 changes: 23 additions & 0 deletions specification/deviceupdate/data-plane/readme.java.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Java

``` yaml $(java)
packages:
- name: azure-iot-deviceupdate
tag: package-2021-06-01-preview
input-file:
- Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json
```
``` yaml $(java) && $(tag) == 'package-2021-06-01-preview'
namespace: com.azure.iot.deviceupdate
low-level-client: true
title: DeviceUpdateClient
artifact-id: azure-iot-deviceupdate
service-name: DeviceUpdate
generate-samples: true
service-versions:
- '2021-06-01-preview'
polling: {}

generate-builder-per-client: false
```
67 changes: 8 additions & 59 deletions specification/deviceupdate/data-plane/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ These are the global settings for the deviceupdate.

```yaml
openapi-type: data-plane
tag: package-2022-07-01-preview
tag: package-2021-06-01-preview
security: AADToken
security-scopes: https://api.adu.microsoft.com/.default
title: DeviceUpdateClient
```
### Tag: package-2020-09-01
Expand All @@ -47,31 +50,6 @@ input-file:
- Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json
```

### Tag: package-2022-07-01-preview

These settings apply only when `--tag=package-2022-07-01-preview` is specified on the command line.

```yaml $(tag) == 'package-2022-07-01-preview'
input-file:
- Microsoft.DeviceUpdate/preview/2022-07-01-preview/deviceupdate.json
```

## Suppressions

``` yaml
directive:
- suppress: LongRunningResponseStatusCode
reason: The validation tools do not properly recognize 202 as a supported response code.
- supress: R2010
reason: Approved by SDK team.
from: Microsoft.DeviceUpdate/preview/2022-07-01-preview/deviceupdate.json
- supress: R2010
reason: Approved by SDK team.
from: Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json
```

---

# Code Generation

## Swagger to SDK
Expand All @@ -81,41 +59,12 @@ This is not used by Autorest itself.

```yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-python-track2
- repo: azure-sdk-for-java
- repo: azure-sdk-for-js
after_scripts:
- bundle install && rake arm:regen_all_profiles['deviceupdate']
- repo: azure-sdk-for-js-dataplane
- repo: azure-sdk-for-python-dataplane
- repo: azure-sdk-for-java-dataplane
- repo: azure-sdk-for-net-dataplane
```

## Python

See configuration in [readme.python.md](./readme.python.md)

## TypeScript

See configuration in [readme.typescript.md](./readme.typescript.md)

## Multi-API/Profile support for AutoRest v3 generators

AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files.

This block is updated by an automatic script. Edits may be lost!

``` yaml $(tag) == 'all-api-versions' /* autogenerated */
# include the azure profile definitions from the standard location
require: $(this-folder)/../../../../profiles/readme.md
# all the input files across all versions
input-file:
- $(this-folder)/Microsoft.DeviceUpdate/preview/2022-07-01-preview/deviceupdate.json
```

If there are files that should not be in the `all-api-versions` set,
uncomment the `exclude-file` section below and add the file paths.

``` yaml $(tag) == 'all-api-versions'
#exclude-file:
# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json
```
24 changes: 6 additions & 18 deletions specification/deviceupdate/data-plane/readme.python.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
## Python

These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.

``` yaml $(track2)
python-mode: create
``` yaml
license-header: MICROSOFT_MIT_NO_VERSION
namespace: azure.iot.deviceupdate
package-version: 1.0.0b1
package-name: azure-iot-deviceupdate
package-version: 1.1.0b1
clear-output-folder: true
add-credentials: true
namespace: azure.iot.deviceupdate
credential-scopes: https://api.adu.microsoft.com/.default
```
``` yaml $(python-mode) == 'create' && $(track2)
basic-setup-py: true
output-folder: $(python-sdks-folder)/deviceupdate/azure-iot-deviceupdate
```
``` yaml $(python-mode) == 'update' && $(track2)
add-credential: true
clear-output-folder: true
no-namespace-folders: true
output-folder: $(python-sdks-folder)/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate
```
```
14 changes: 9 additions & 5 deletions specification/deviceupdate/data-plane/readme.typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ Please also specify `--typescript-sdks-folder=<path to root folder of your azure

```yaml $(typescript)
typescript:
azure-arm: false
package-name: "@azure/device-update"
output-folder: "$(typescript-sdks-folder)/sdk/deviceupdate/device-update"
payload-flattening-threshold: 1
generate-metadata: true
package-name: "@azure-rest/iot-device-update"
description: Iot Device Update Client
package-version: 1.0.0-beta.1
output-folder: "$(typescript-sdks-folder)/sdk/deviceupdate/iot-device-update-rest"
rest-level-client: true
add-credentials: true
license-header: MICROSOFT_MIT_NO_VERSION
generate-metadata: false
credential-scopes: https://api.adu.microsoft.com/.default
```

0 comments on commit 3314542

Please sign in to comment.