Skip to content

Commit cc98dfe

Browse files
authored
[keyvault] azcertificates renames (Azure#20978)
* renames * update tests * feedback * id type
1 parent 1e4fb7e commit cc98dfe

File tree

10 files changed

+1114
-1032
lines changed

10 files changed

+1114
-1032
lines changed

sdk/security/keyvault/azcertificates/CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,42 @@
22

33
## 0.11.0 (unreleased)
44

5+
### Breaking Changes
6+
* Rename `ListCertificates` to `ListCertificateProperties`
7+
* `ListCertificateIssuers` to `ListIssuerProperties`
8+
* `ListCertificateVersions` to `ListCertificatePropertiesVersions`
9+
* `ListDeletedCertificates` to `ListDeletedCertificateProperties`
10+
* `CertificateListResult` to `CertificatePropertiesListResult`
11+
* `DeletedCertificateListResult` to `DeletedCertificatePropertiesListResult`
12+
* `SetCertificateContacts` to `SetContacts`
13+
* `GetCertificateContacts` to `GetContacts`
14+
* `DeleteCertificateContacts` to `DeleteContacts`
15+
* `SetCertificateIssuer` to `SetIssuer`
16+
* `UpdateCertificateIssuer` to `UpdateIssuer`
17+
* `GetCertificateIssuer` to `GetIssuer`
18+
* `DeleteCertificateIssuer` to `DeleteIssuer`
19+
* `CertificateIssuerListResult` to `IssuerPropertiesListResult`
20+
* `UpdateCertificateIssuerParameters` to `UpdateIssuerParameters`
21+
* `SetCertificateIssuerParameters` to `SetIssuerParameters`
22+
* `CertificateBundle` to `Certificate`
23+
* `CertificateItem` to `CertificateProperties`
24+
* `DeletedCertificateBundle` to `DeletedCertificate`
25+
* `DeletedCertificateItem` to `DeletedCertificateProperties`
26+
* `IssuerBundle` to `Issuer`
27+
* `CertificateIssuerItem` to `IssuerProperties`
28+
* `RestoreCertificateParameters.CertificateBundleBackup` to `RestoreCertificateParameters.CertificateBackup`
29+
* `JSONWebKeyCurveName` to `CurveName`
30+
* `JSONWebKeyType` to `KeyType`
31+
* `Trigger` to `LifetimeActionTrigger`
32+
* `Action` to `LifetimeActionType`
33+
* `AdministratorDetails` to ``AdministratorContact`
34+
* `OrganizationDetails.AdminDetails` to `OrganizationDetails.AdminContacts`
35+
* `EmailAddress` to `Email`
36+
* `UPNs` to `UserPrincipalNames`
37+
* `EKUs` to `EnhancedKeyUsage`
38+
* remove `MaxResults` parameter
39+
* remove `DeletionRecoveryLevel` type
40+
541
### Other Changes
642
* Updated dependencies
743

sdk/security/keyvault/azcertificates/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "go",
44
"TagPrefix": "go/security/keyvault/azcertificates",
5-
"Tag": "go/security/keyvault/azcertificates_0abf787d93"
5+
"Tag": "go/security/keyvault/azcertificates_a266a0061e"
66
}

sdk/security/keyvault/azcertificates/autorest.md

Lines changed: 135 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,145 @@ directive:
5353
# rename paged operations from Get* to List*
5454
- rename-operation:
5555
from: GetCertificates
56-
to: ListCertificates
56+
to: ListCertificateProperties
5757
- rename-operation:
5858
from: GetCertificateIssuers
59-
to: ListCertificateIssuers
59+
to: ListIssuerProperties
6060
- rename-operation:
6161
from: GetCertificateVersions
62-
to: ListCertificateVersions
62+
to: ListCertificatePropertiesVersions
6363
- rename-operation:
6464
from: GetDeletedCertificates
65-
to: ListDeletedCertificates
65+
to: ListDeletedCertificateProperties
66+
- rename-model:
67+
from: CertificateListResult
68+
to: CertificatePropertiesListResult
69+
- rename-model:
70+
from: DeletedCertificateListResult
71+
to: DeletedCertificatePropertiesListResult
6672

67-
# Maxresults -> MaxResults
68-
- from: swagger-document
69-
where: $.paths..parameters..[?(@.name=='maxresults')]
70-
transform: $["x-ms-client-name"] = "MaxResults"
73+
# remove redunant "certificate" from operation name
74+
- rename-operation:
75+
from: SetCertificateContacts
76+
to: SetContacts
77+
- rename-operation:
78+
from: GetCertificateContacts
79+
to: GetContacts
80+
- rename-operation:
81+
from: DeleteCertificateContacts
82+
to: DeleteContacts
83+
- rename-operation:
84+
from: SetCertificateIssuer
85+
to: SetIssuer
86+
- rename-operation:
87+
from: UpdateCertificateIssuer
88+
to: UpdateIssuer
89+
- rename-operation:
90+
from: GetCertificateIssuer
91+
to: GetIssuer
92+
- rename-operation:
93+
from: DeleteCertificateIssuer
94+
to: DeleteIssuer
95+
- rename-model:
96+
from: CertificateIssuerListResult
97+
to: IssuerPropertiesListResult
98+
- rename-model:
99+
from: UpdateCertificateIssuerParameters
100+
to: UpdateIssuerParameters
101+
- rename-model:
102+
from: SetCertificateIssuerParameters
103+
to: SetIssuerParameters
104+
105+
# rename LifetimeAction
106+
- rename-model:
107+
from: Action
108+
to: LifetimeActionType
109+
- rename-model:
110+
from: Trigger
111+
to: LifetimeActionTrigger
112+
113+
# rename CertificateBundle, CertificateItem, IssuerBundle
114+
- rename-model:
115+
from: CertificateBundle
116+
to: Certificate
117+
- rename-model:
118+
from: CertificateItem
119+
to: CertificateProperties
120+
- rename-model:
121+
from: DeletedCertificateBundle
122+
to: DeletedCertificate
123+
- rename-model:
124+
from: DeletedCertificateItem
125+
to: DeletedCertificateProperties
126+
- rename-model:
127+
from: IssuerBundle
128+
to: Issuer
129+
- rename-model:
130+
from: CertificateIssuerItem
131+
to: IssuerProperties
132+
- where-model: RestoreCertificateParameters
133+
transform: $.properties.value["x-ms-client-name"] = "CertificateBackup"
134+
135+
# rename AdministratorDetails to AdministratorContact
136+
- rename-model:
137+
from: AdministratorDetails
138+
to: AdministratorContact
139+
- where-model: OrganizationDetails
140+
transform: $.properties.admin_details["x-ms-client-name"] = "AdminContacts"
141+
- where-model:
142+
- Contact
143+
- AdministratorContact
144+
transform: $.properties.email["x-ms-client-name"] = "Email"
145+
146+
# rename UPNs to UserPrincipalNames
147+
- where-model: SubjectAlternativeNames
148+
transform: $.properties.upns["x-ms-client-name"] = "UserPrincipalNames"
149+
150+
# rename EKUs to EnhancedKeyUsage
151+
- where-model: X509CertificateProperties
152+
transform: $.properties.ekus["x-ms-client-name"] = "EnhancedKeyUsage"
71153

72154
# capitalize acronyms
73-
- where-model: CertificateBundle
155+
- where-model: Certificate
74156
transform: $.properties.cer["x-ms-client-name"] = "CER"
75-
- where-model: CertificateBundle
157+
- where-model: Certificate
76158
transform: $.properties.kid["x-ms-client-name"] = "KID"
77-
- where-model: CertificateBundle
159+
- where-model: Certificate
78160
transform: $.properties.sid["x-ms-client-name"] = "SID"
79161
- where-model: CertificateOperation
80162
transform: $.properties.csr["x-ms-client-name"] = "CSR"
81-
- where-model: SubjectAlternativeNames
82-
transform: $.properties.upns["x-ms-client-name"] = "UPNs"
83-
- where-model: X509CertificateProperties
84-
transform: $.properties.ekus["x-ms-client-name"] = "EKUs"
163+
164+
# Remove MaxResults parameter
165+
- where: "$.paths..*"
166+
remove-parameter:
167+
in: query
168+
name: maxresults
169+
170+
# remove JSONWeb prefix
171+
- from:
172+
- models.go
173+
- constants.go
174+
where: $
175+
transform: return $.replace(/JSONWebKeyCurveName/g, "CurveName");
176+
- from:
177+
- models.go
178+
- constants.go
179+
where: $
180+
transform: return $.replace(/JSONWebKeyType/g, "KeyType");
181+
182+
# remove DeletionRecoveryLevel type
183+
- from: models.go
184+
where: $
185+
transform: return $.replace(/RecoveryLevel \*DeletionRecoveryLevel/g, "RecoveryLevel *string");
186+
- from: constants.go
187+
where: $
188+
transform: return $.replace(/(?:\/\/.*\s)+type DeletionRecoveryLevel string/, "");
189+
- from: constants.go
190+
where: $
191+
transform: return $.replace(/(?:\/\/.*\s)+func PossibleDeletionRecovery(?:.+\s)+\}/, "");
192+
- from: constants.go
193+
where: $
194+
transform: return $.replace(/const \(\n\s\/\/ DeletionRecoveryLevel(?:.+\s)+\)/, "");
85195

86196
# delete unused error models
87197
- from: models.go
@@ -116,15 +226,21 @@ directive:
116226
transform: return $.replace(/Client(\w+)((?:Options|Response))/g, "$1$2");
117227

118228
# make cert IDs a convenience type so we can add parsing methods
119-
# (specifying models because others have "ID" fields whose values aren't cert IDs)
229+
# (specifying models because others have "ID" fields whose values aren't key vault object identifiers)
120230
- from: models.go
121231
where: $
122-
transform: return $.replace(/(type (?:Deleted)?Certificate(?:Bundle|Item) struct \{(?:\s.+\s)+\sID \*)string/g, "$1ID")
232+
transform: return $.replace(/(type (?:Deleted)?Certificate(?:Properties|Policy|Operation)? struct \{(?:\s.+\s)+\sID \*)string/g, "$1ID")
233+
- from: models.go
234+
where: $
235+
transform: return $.replace(/(type (?:Deleted)?Certificate struct \{(?:\s.+\s)+\sKID \*)string/g, "$1ID")
236+
- from: models.go
237+
where: $
238+
transform: return $.replace(/(type (?:Deleted)?Certificate struct \{(?:\s.+\s)+\sSID \*)string/g, "$1ID")
123239

124240
# remove "certificate" prefix from some method parameter names
125241
- from: client.go
126-
- where: $
127-
- transform: return $.replace(/certificate((?:Name|Policy|Version)) string/g, (match) => { return match[0].toLowerCase() + match.substr(1); })
242+
where: $
243+
transform: return $.replace(/certificate((?:Name|Policy|Version)) string/g, (match) => { return match[0].toLowerCase() + match.substr(1); })
128244

129245
# add doc comment
130246
- from: swagger-document

0 commit comments

Comments
 (0)