Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[keyvault] azcertificates renames #20978

Merged
merged 4 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions sdk/security/keyvault/azcertificates/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

## 0.11.0 (unreleased)

### Breaking Changes
* Rename `ListCertificates` to `ListCertificateProperties`
* `ListCertificateIssuers` to `ListIssuerProperties`
* `ListCertificateVersions` to `ListCertificatePropertiesVersions`
* `ListDeletedCertificates` to `ListDeletedCertificateProperties`
* `CertificateListResult` to `CertificatePropertiesListResult`
* `DeletedCertificateListResult` to `DeletedCertificatePropertiesListResult`
* `SetCertificateContacts` to `SetContacts`
* `GetCertificateContacts` to `GetContacts`
* `DeleteCertificateContacts` to `DeleteContacts`
* `SetCertificateIssuer` to `SetIssuer`
* `UpdateCertificateIssuer` to `UpdateIssuer`
* `GetCertificateIssuer` to `GetIssuer`
* `DeleteCertificateIssuer` to `DeleteIssuer`
* `CertificateIssuerListResult` to `IssuerPropertiesListResult`
* `UpdateCertificateIssuerParameters` to `UpdateIssuerParameters`
* `SetCertificateIssuerParameters` to `SetIssuerParameters`
* `CertificateBundle` to `Certificate`
* `CertificateItem` to `CertificateProperties`
* `DeletedCertificateBundle` to `DeletedCertificate`
* `DeletedCertificateItem` to `DeletedCertificateProperties`
* `IssuerBundle` to `Issuer`
* `CertificateIssuerItem` to `IssuerProperties`
* `RestoreCertificateParameters.CertificateBundleBackup` to `RestoreCertificateParameters.CertificateBackup`
* `JSONWebKeyCurveName` to `CurveName`
* `JSONWebKeyType` to `KeyType`
* `Trigger` to `LifetimeActionTrigger`
* `Action` to `LifetimeActionType`
* `AdministratorDetails` to ``AdministratorContact`
* `OrganizationDetails.AdminDetails` to `OrganizationDetails.AdminContacts`
* `EmailAddress` to `Email`
* `UPNs` to `UserPrincipalNames`
* `EKUs` to `EnhancedKeyUsage`
* remove `MaxResults` parameter
* remove `DeletionRecoveryLevel` type

### Other Changes
* Updated dependencies

Expand Down
2 changes: 1 addition & 1 deletion sdk/security/keyvault/azcertificates/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/security/keyvault/azcertificates",
"Tag": "go/security/keyvault/azcertificates_0abf787d93"
"Tag": "go/security/keyvault/azcertificates_a266a0061e"
}
142 changes: 126 additions & 16 deletions sdk/security/keyvault/azcertificates/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,145 @@ directive:
# rename paged operations from Get* to List*
- rename-operation:
from: GetCertificates
to: ListCertificates
to: ListCertificateProperties
- rename-operation:
from: GetCertificateIssuers
to: ListCertificateIssuers
to: ListIssuerProperties
- rename-operation:
from: GetCertificateVersions
to: ListCertificateVersions
to: ListCertificatePropertiesVersions
- rename-operation:
from: GetDeletedCertificates
to: ListDeletedCertificates
to: ListDeletedCertificateProperties
- rename-model:
from: CertificateListResult
to: CertificatePropertiesListResult
- rename-model:
from: DeletedCertificateListResult
to: DeletedCertificatePropertiesListResult

# Maxresults -> MaxResults
- from: swagger-document
where: $.paths..parameters..[?(@.name=='maxresults')]
transform: $["x-ms-client-name"] = "MaxResults"
# remove redunant "certificate" from operation name
- rename-operation:
from: SetCertificateContacts
to: SetContacts
- rename-operation:
from: GetCertificateContacts
to: GetContacts
- rename-operation:
from: DeleteCertificateContacts
to: DeleteContacts
- rename-operation:
from: SetCertificateIssuer
to: SetIssuer
- rename-operation:
from: UpdateCertificateIssuer
to: UpdateIssuer
- rename-operation:
from: GetCertificateIssuer
to: GetIssuer
- rename-operation:
from: DeleteCertificateIssuer
to: DeleteIssuer
- rename-model:
from: CertificateIssuerListResult
to: IssuerPropertiesListResult
- rename-model:
from: UpdateCertificateIssuerParameters
to: UpdateIssuerParameters
- rename-model:
from: SetCertificateIssuerParameters
to: SetIssuerParameters

# rename LifetimeAction
- rename-model:
from: Action
to: LifetimeActionType
- rename-model:
from: Trigger
to: LifetimeActionTrigger

# rename CertificateBundle, CertificateItem, IssuerBundle
- rename-model:
from: CertificateBundle
to: Certificate
- rename-model:
from: CertificateItem
to: CertificateProperties
- rename-model:
from: DeletedCertificateBundle
to: DeletedCertificate
- rename-model:
from: DeletedCertificateItem
to: DeletedCertificateProperties
- rename-model:
from: IssuerBundle
to: Issuer
- rename-model:
from: CertificateIssuerItem
to: IssuerProperties
- where-model: RestoreCertificateParameters
transform: $.properties.value["x-ms-client-name"] = "CertificateBackup"

# rename AdministratorDetails to AdministratorContact
- rename-model:
from: AdministratorDetails
to: AdministratorContact
- where-model: OrganizationDetails
transform: $.properties.admin_details["x-ms-client-name"] = "AdminContacts"
- where-model:
- Contact
- AdministratorContact
transform: $.properties.email["x-ms-client-name"] = "Email"

# rename UPNs to UserPrincipalNames
- where-model: SubjectAlternativeNames
transform: $.properties.upns["x-ms-client-name"] = "UserPrincipalNames"

# rename EKUs to EnhancedKeyUsage
- where-model: X509CertificateProperties
transform: $.properties.ekus["x-ms-client-name"] = "EnhancedKeyUsage"

# capitalize acronyms
- where-model: CertificateBundle
- where-model: Certificate
transform: $.properties.cer["x-ms-client-name"] = "CER"
- where-model: CertificateBundle
- where-model: Certificate
transform: $.properties.kid["x-ms-client-name"] = "KID"
- where-model: CertificateBundle
- where-model: Certificate
transform: $.properties.sid["x-ms-client-name"] = "SID"
- where-model: CertificateOperation
transform: $.properties.csr["x-ms-client-name"] = "CSR"
- where-model: SubjectAlternativeNames
transform: $.properties.upns["x-ms-client-name"] = "UPNs"
- where-model: X509CertificateProperties
transform: $.properties.ekus["x-ms-client-name"] = "EKUs"

# Remove MaxResults parameter
- where: "$.paths..*"
remove-parameter:
in: query
name: maxresults

# remove JSONWeb prefix
- from:
- models.go
- constants.go
where: $
transform: return $.replace(/JSONWebKeyCurveName/g, "CurveName");
- from:
- models.go
- constants.go
where: $
transform: return $.replace(/JSONWebKeyType/g, "KeyType");

# remove DeletionRecoveryLevel type
- from: models.go
where: $
transform: return $.replace(/RecoveryLevel \*DeletionRecoveryLevel/g, "RecoveryLevel *string");
- from: constants.go
where: $
transform: return $.replace(/(?:\/\/.*\s)+type DeletionRecoveryLevel string/, "");
- from: constants.go
where: $
transform: return $.replace(/(?:\/\/.*\s)+func PossibleDeletionRecovery(?:.+\s)+\}/, "");
- from: constants.go
where: $
transform: return $.replace(/const \(\n\s\/\/ DeletionRecoveryLevel(?:.+\s)+\)/, "");

# delete unused error models
- from: models.go
Expand Down Expand Up @@ -119,7 +229,7 @@ directive:
# (specifying models because others have "ID" fields whose values aren't cert IDs)
- from: models.go
where: $
transform: return $.replace(/(type (?:Deleted)?Certificate(?:Bundle|Item) struct \{(?:\s.+\s)+\sID \*)string/g, "$1ID")
transform: return $.replace(/(type (?:Deleted)?Certificate(?:Properties)? struct \{(?:\s.+\s)+\sID \*)string/g, "$1ID")

# remove "certificate" prefix from some method parameter names
- from: client.go
Expand Down
Loading