From 2137e99f611d440c0571fef1dbef97b829673d20 Mon Sep 17 00:00:00 2001 From: gracewilcox Date: Thu, 8 Jun 2023 10:30:37 -0700 Subject: [PATCH] prep-for-release --- sdk/security/keyvault/azadmin/CHANGELOG.md | 2 +- sdk/security/keyvault/azkeys/CHANGELOG.md | 3 ++- sdk/security/keyvault/azkeys/autorest.md | 11 +++++++++ sdk/security/keyvault/azkeys/client_test.go | 6 ++--- sdk/security/keyvault/azkeys/example_test.go | 6 ++--- sdk/security/keyvault/azkeys/models.go | 18 +++++++-------- sdk/security/keyvault/azkeys/models_serde.go | 24 ++++++++++---------- sdk/security/keyvault/azsecrets/CHANGELOG.md | 2 +- 8 files changed, 42 insertions(+), 30 deletions(-) diff --git a/sdk/security/keyvault/azadmin/CHANGELOG.md b/sdk/security/keyvault/azadmin/CHANGELOG.md index 4d75080ce3b4..e10594cfbb91 100644 --- a/sdk/security/keyvault/azadmin/CHANGELOG.md +++ b/sdk/security/keyvault/azadmin/CHANGELOG.md @@ -1,6 +1,6 @@ ## Release History -## 0.3.0 (2023-06-06) +## 0.3.0 (2023-06-08) ### Breatking Changes * Renamed `SASTokenParameter` to `SASTokenParameters` diff --git a/sdk/security/keyvault/azkeys/CHANGELOG.md b/sdk/security/keyvault/azkeys/CHANGELOG.md index d44aa77524db..f93ca4454ae2 100644 --- a/sdk/security/keyvault/azkeys/CHANGELOG.md +++ b/sdk/security/keyvault/azkeys/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 0.12.0 (unreleased) +## 0.12.0 (2023-06-08) ### Breaking Changes @@ -24,6 +24,7 @@ * `JSONWebKeyEncryptionAlgorithm` to `EncryptionAlgorithm` * `JSONWebKeySignatureAlgorithm` to `SignatureAlgorithm` * `JSONWebKeyType` to `KeyType` +* `LifetimeActions` to `LifetimeAction` * Removed `DeletionRecoveryLevel` type * Removed `SignatureAlgorithmRSNULL` constant * Removed `KeyOperationExport` constant diff --git a/sdk/security/keyvault/azkeys/autorest.md b/sdk/security/keyvault/azkeys/autorest.md index 7744bd7c5e5d..12bbe95edc0f 100644 --- a/sdk/security/keyvault/azkeys/autorest.md +++ b/sdk/security/keyvault/azkeys/autorest.md @@ -85,6 +85,17 @@ directive: where: $.definitions.RestoreKeyParameters.properties.value transform: $["x-ms-client-name"] = "KeyBackup" + # Change LifetimeActions to LifetimeAction + - rename-model: + from: LifetimeActions + to: LifetimeAction + - rename-model: + from: LifetimeActionsType + to: LifetimeActionType + - rename-model: + from: LifetimeActionsTrigger + to: LifetimeActionTrigger + # Remove MaxResults parameter - where: "$.paths..*" remove-parameter: diff --git a/sdk/security/keyvault/azkeys/client_test.go b/sdk/security/keyvault/azkeys/client_test.go index aaaf94f21011..cacc87da5d0e 100644 --- a/sdk/security/keyvault/azkeys/client_test.go +++ b/sdk/security/keyvault/azkeys/client_test.go @@ -620,12 +620,12 @@ func TestRotateKey(t *testing.T) { Attributes: &azkeys.KeyRotationPolicyAttributes{ ExpiryTime: to.Ptr("P90D"), }, - LifetimeActions: []*azkeys.LifetimeActions{ + LifetimeActions: []*azkeys.LifetimeAction{ { - Action: &azkeys.LifetimeActionsType{ + Action: &azkeys.LifetimeActionType{ Type: to.Ptr(azkeys.KeyRotationPolicyActionRotate), }, - Trigger: &azkeys.LifetimeActionsTrigger{ + Trigger: &azkeys.LifetimeActionTrigger{ TimeAfterCreate: timeAfterCreate, }, }, diff --git a/sdk/security/keyvault/azkeys/example_test.go b/sdk/security/keyvault/azkeys/example_test.go index ef61055b6435..88ff3a44987b 100644 --- a/sdk/security/keyvault/azkeys/example_test.go +++ b/sdk/security/keyvault/azkeys/example_test.go @@ -123,12 +123,12 @@ func ExampleClient_UpdateKey() { func ExampleClient_UpdateKeyRotationPolicy() { // this policy rotates the key every 18 months policy := azkeys.KeyRotationPolicy{ - LifetimeActions: []*azkeys.LifetimeActions{ + LifetimeActions: []*azkeys.LifetimeAction{ { - Action: &azkeys.LifetimeActionsType{ + Action: &azkeys.LifetimeActionType{ Type: to.Ptr(azkeys.KeyRotationPolicyActionRotate), }, - Trigger: &azkeys.LifetimeActionsTrigger{ + Trigger: &azkeys.LifetimeActionTrigger{ TimeAfterCreate: to.Ptr("P18M"), }, }, diff --git a/sdk/security/keyvault/azkeys/models.go b/sdk/security/keyvault/azkeys/models.go index 070332c93fae..c81b7a752fd4 100644 --- a/sdk/security/keyvault/azkeys/models.go +++ b/sdk/security/keyvault/azkeys/models.go @@ -437,7 +437,7 @@ type KeyRotationPolicy struct { // Actions that will be performed by Key Vault over the lifetime of a key. For preview, lifetimeActions can only have two // items at maximum: one for rotate, one for notify. Notification time would be // default to 30 days before expiry and it is not configurable. - LifetimeActions []*LifetimeActions `json:"lifetimeActions,omitempty"` + LifetimeActions []*LifetimeAction `json:"lifetimeActions,omitempty"` // READ-ONLY; The key policy id. ID *string `json:"id,omitempty" azure:"ro"` @@ -462,17 +462,17 @@ type KeyVerifyResult struct { Value *bool `json:"value,omitempty" azure:"ro"` } -// LifetimeActions - Action and its trigger that will be performed by Key Vault over the lifetime of a key. -type LifetimeActions struct { +// LifetimeAction - Action and its trigger that will be performed by Key Vault over the lifetime of a key. +type LifetimeAction struct { // The action that will be executed. - Action *LifetimeActionsType `json:"action,omitempty"` + Action *LifetimeActionType `json:"action,omitempty"` // The condition that will execute the action. - Trigger *LifetimeActionsTrigger `json:"trigger,omitempty"` + Trigger *LifetimeActionTrigger `json:"trigger,omitempty"` } -// LifetimeActionsTrigger - A condition to be satisfied for an action to be executed. -type LifetimeActionsTrigger struct { +// LifetimeActionTrigger - A condition to be satisfied for an action to be executed. +type LifetimeActionTrigger struct { // Time after creation to attempt to rotate. It only applies to rotate. It will be in ISO 8601 duration format. Example: 90 // days : "P90D" TimeAfterCreate *string `json:"timeAfterCreate,omitempty"` @@ -481,8 +481,8 @@ type LifetimeActionsTrigger struct { TimeBeforeExpiry *string `json:"timeBeforeExpiry,omitempty"` } -// LifetimeActionsType - The action that will be executed. -type LifetimeActionsType struct { +// LifetimeActionType - The action that will be executed. +type LifetimeActionType struct { // The type of the action. Type *KeyRotationPolicyAction `json:"type,omitempty"` } diff --git a/sdk/security/keyvault/azkeys/models_serde.go b/sdk/security/keyvault/azkeys/models_serde.go index e62b9b7c2efd..2bcbe5563274 100644 --- a/sdk/security/keyvault/azkeys/models_serde.go +++ b/sdk/security/keyvault/azkeys/models_serde.go @@ -806,16 +806,16 @@ func (k *KeyVerifyResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LifetimeActions. -func (l LifetimeActions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LifetimeAction. +func (l LifetimeAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "action", l.Action) populate(objectMap, "trigger", l.Trigger) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeActions. -func (l *LifetimeActions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeAction. +func (l *LifetimeAction) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -837,16 +837,16 @@ func (l *LifetimeActions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LifetimeActionsTrigger. -func (l LifetimeActionsTrigger) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LifetimeActionTrigger. +func (l LifetimeActionTrigger) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "timeAfterCreate", l.TimeAfterCreate) populate(objectMap, "timeBeforeExpiry", l.TimeBeforeExpiry) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeActionsTrigger. -func (l *LifetimeActionsTrigger) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeActionTrigger. +func (l *LifetimeActionTrigger) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -868,15 +868,15 @@ func (l *LifetimeActionsTrigger) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LifetimeActionsType. -func (l LifetimeActionsType) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LifetimeActionType. +func (l LifetimeActionType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeActionsType. -func (l *LifetimeActionsType) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeActionType. +func (l *LifetimeActionType) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) diff --git a/sdk/security/keyvault/azsecrets/CHANGELOG.md b/sdk/security/keyvault/azsecrets/CHANGELOG.md index 44e740a94980..a244ac68f53d 100644 --- a/sdk/security/keyvault/azsecrets/CHANGELOG.md +++ b/sdk/security/keyvault/azsecrets/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 0.14.0 (2023-06-06) +## 0.14.0 (2023-06-08) ### Breaking Changes * Renamed `Client.ListSecrets` to `Client.ListSecretProperties`