Skip to content

Commit e7682aa

Browse files
authored
[policyinsights] Fix next_link (Azure#15165)
* fix next_link * directive * Update readme.nodejs.md * js directvie * Update readme.md * supress other language * Update readme.go.md * swagger lint * swagger lint * swagger lint * Update readme.md
1 parent 19707b7 commit e7682aa

File tree

4 files changed

+60
-24
lines changed

4 files changed

+60
-24
lines changed

specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/policyEvents.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@
634634
}
635635
},
636636
"x-ms-paths": {
637-
"/{nextLink}?Next paging op for policy events": {
637+
"{nextLink}?Next paging op for policy events": {
638638
"post": {
639639
"operationId": "PolicyEvents_NextLink",
640640
"description": "Subsequent post calls to the next link",

specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/policyStates.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,10 @@
11611161
}
11621162
}
11631163
}
1164-
},
1165-
"/{nextLink}": {
1164+
}
1165+
},
1166+
"x-ms-paths": {
1167+
"{nextLink}?Next paging op for policy states": {
11661168
"post": {
11671169
"operationId": "PolicyStates_NextLink",
11681170
"description": "Subsequent post calls to the next link",

specification/policyinsights/resource-manager/readme.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,59 @@ directive:
7979
where: $.definitions.Attestation.properties
8080
reason: systemData is now a required top level property
8181
82+
- suppress: OBJECT_ADDITIONAL_PROPERTIES
83+
from: policyEvents.json
84+
reason: unnecessary check
85+
86+
- suppress: OBJECT_ADDITIONAL_PROPERTIES
87+
from: policyStates.json
88+
reason: unnecessary check
89+
90+
- suppress: MISSING_REQUIRED_PARAMETER
91+
from: policyEvents.json
92+
reason: unnecessary check
93+
94+
- suppress: MISSING_REQUIRED_PARAMETER
95+
from: policyStates.json
96+
reason: unnecessary check
97+
98+
```
99+
100+
``` yaml !$(python)
101+
directive:
102+
- from: policyEvents.json
103+
where: $
104+
transform: delete $['x-ms-paths']
105+
reason: other languages which still use track1 does not support remove '/' for 'next_link'
106+
107+
- from: policyStates.json
108+
where: $
109+
transform: delete $['x-ms-paths']
110+
reason: other languages which still use track1 does not support remove '/' for 'next_link'
111+
112+
- from: policyEvents.json
113+
where:
114+
- $.path["/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"]
115+
- $.path["/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"]
116+
- $.path["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"]
117+
- $.path["/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"]
118+
- $.path["/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"]
119+
- $.path["/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"]
120+
- $.path["/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"]
121+
- $.path["/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"]
122+
transform: delete $['post']['x-ms-pageable']['operationName']
123+
124+
- from: policyStates.json
125+
where:
126+
- $.path["/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults"]
127+
- $.path["/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults"]
128+
- $.path["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults"]
129+
- $.path["/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults"]
130+
- $.path["/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults"]
131+
- $.path["/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults"]
132+
- $.path["/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults"]
133+
- $.path["/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults"]
134+
transform: delete $['post']['x-ms-pageable']['operationName']
82135
```
83136

84137
### Tag: package-2021-01
@@ -160,10 +213,8 @@ This is not used by Autorest itself.
160213
``` yaml $(swagger-to-sdk)
161214
swagger-to-sdk:
162215
- repo: azure-sdk-for-net
163-
- repo: azure-sdk-for-python
164216
- repo: azure-sdk-for-python-track2
165217
- repo: azure-sdk-for-java
166-
- repo: azure-sdk-for-go
167218
- repo: azure-sdk-for-js
168219
- repo: azure-sdk-for-node
169220
- repo: azure-resource-manager-schemas

specification/policyinsights/resource-manager/readme.python.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ These settings apply only when `--python` is specified on the command line.
44
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
55
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.
66

7-
``` yaml $(python) && !$(track2)
8-
python-mode: create
9-
python:
10-
azure-arm: true
11-
license-header: MICROSOFT_MIT_NO_VERSION
12-
payload-flattening-threshold: 2
13-
namespace: azure.mgmt.policyinsights
14-
package-name: azure-mgmt-policyinsights
15-
clear-output-folder: true
16-
```
17-
187
``` yaml $(python) && $(track2)
198
python-mode: create
209
azure-arm: true
@@ -25,19 +14,13 @@ package-version: 1.0.0b1
2514
clear-output-folder: true
2615
```
2716
28-
``` yaml $(python) && $(python-mode) == 'update'
17+
``` yaml $(python) && $(python-mode) == 'update' && $(track2)
2918
no-namespace-folders: true
3019
output-folder: $(python-sdks-folder)/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights
31-
python:
32-
no-namespace-folders: true
33-
output-folder: $(python-sdks-folder)/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights
3420
```
35-
``` yaml $(python) && $(python-mode) == 'create'
21+
``` yaml $(python) && $(python-mode) == 'create' && $(track2)
3622
basic-setup-py: true
3723
output-folder: $(python-sdks-folder)/policyinsights/azure-mgmt-policyinsights
38-
python:
39-
basic-setup-py: true
40-
output-folder: $(python-sdks-folder)/policyinsights/azure-mgmt-policyinsights
4124
```
4225
4326
``` yaml $(python) && $(track2)

0 commit comments

Comments
 (0)