From 964517804e20dcf27874281b7a367bdaddf5f663 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 11 Nov 2026 21:58:21 +0000 Subject: [PATCH] Configurations: 'specification/keyvault/resource-manager/Microsoft.KeyVault/KeyVault/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: '67d7ae2c7878c896d0ddb588e45bd90726ea2044' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=7066458 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../keyvault/armkeyvault/CHANGELOG.md | 37 ++ .../keyvault/armkeyvault/client_factory.go | 8 + .../keyvault/armkeyvault/constants.go | 169 ++++- ...ksecurityperimeterconfigurations_server.go | 216 +++++++ .../armkeyvault/fake/server_factory.go | 35 +- .../keyvault/armkeyvault/keys_client.go | 12 +- .../armkeyvault/keys_client_example_test.go | 10 +- .../armkeyvault/managedhsmkeys_client.go | 12 +- .../managedhsmkeys_client_example_test.go | 10 +- .../armkeyvault/managedhsms_client.go | 22 +- .../managedhsms_client_example_test.go | 20 +- .../mhsmprivateendpointconnections_client.go | 10 +- ...endpointconnections_client_example_test.go | 8 +- .../mhsmprivatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 2 +- .../armkeyvault/mhsmregions_client.go | 4 +- .../mhsmregions_client_example_test.go | 2 +- .../keyvault/armkeyvault/models.go | 250 ++++++++ .../keyvault/armkeyvault/models_serde.go | 565 ++++++++++++++++ ...ksecurityperimeterconfigurations_client.go | 247 +++++++ ...meterconfigurations_client_example_test.go | 160 +++++ .../keyvault/armkeyvault/operations_client.go | 4 +- .../operations_client_example_test.go | 2 +- .../keyvault/armkeyvault/options.go | 18 + .../privateendpointconnections_client.go | 10 +- ...endpointconnections_client_example_test.go | 8 +- .../privatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 2 +- .../keyvault/armkeyvault/responses.go | 17 + .../keyvault/armkeyvault/secrets_client.go | 10 +- .../secrets_client_example_test.go | 8 +- .../armkeyvault/testdata/_metadata.json | 2 +- .../keyvault/armkeyvault/tsp-location.yaml | 2 +- .../keyvault/armkeyvault/vaults_client.go | 24 +- .../armkeyvault/vaults_client_example_test.go | 606 +++++++++++++++++- .../keyvault/armkeyvault/version.go | 2 +- 36 files changed, 2397 insertions(+), 125 deletions(-) create mode 100644 sdk/resourcemanager/keyvault/armkeyvault/fake/networksecurityperimeterconfigurations_server.go create mode 100644 sdk/resourcemanager/keyvault/armkeyvault/networksecurityperimeterconfigurations_client.go create mode 100644 sdk/resourcemanager/keyvault/armkeyvault/networksecurityperimeterconfigurations_client_example_test.go diff --git a/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md b/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md index 2eb67d76ed81..57b61a358d6c 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md +++ b/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md @@ -1,5 +1,42 @@ # Release History +## 2.2.0-beta.1 (2026-11-11) +### Features Added + +- New enum type `AccessRuleDirection` with values `AccessRuleDirectionInbound`, `AccessRuleDirectionOutbound` +- New enum type `IssueType` with values `IssueTypeConfigurationPropagationFailure`, `IssueTypeMissingIdentityConfiguration`, `IssueTypeMissingPerimeterConfiguration`, `IssueTypeUnknown` +- New enum type `NetworkSecurityPerimeterConfigurationProvisioningState` with values `NetworkSecurityPerimeterConfigurationProvisioningStateAccepted`, `NetworkSecurityPerimeterConfigurationProvisioningStateCanceled`, `NetworkSecurityPerimeterConfigurationProvisioningStateCreating`, `NetworkSecurityPerimeterConfigurationProvisioningStateDeleting`, `NetworkSecurityPerimeterConfigurationProvisioningStateFailed`, `NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded`, `NetworkSecurityPerimeterConfigurationProvisioningStateUpdating` +- New enum type `ResourceAssociationAccessMode` with values `ResourceAssociationAccessModeAudit`, `ResourceAssociationAccessModeEnforced`, `ResourceAssociationAccessModeLearning` +- New enum type `Severity` with values `SeverityError`, `SeverityWarning` +- New enum type `TokenBindingMode` with values `TokenBindingModeEnforced`, `TokenBindingModeNotEnforced` +- New enum type `TokenBindingStrength` with values `TokenBindingStrengthAttestedConfidential`, `TokenBindingStrengthAttestedTrustedLaunch`, `TokenBindingStrengthNoValidation`, `TokenBindingStrengthUnattested` +- New function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient` +- New function `NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.GetConfiguration(ctx context.Context, resourceGroupName string, vaultName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientGetConfigurationOptions) (NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.NewListConfigurationsPager(resourceGroupName string, vaultName string, options *NetworkSecurityPerimeterConfigurationsClientListConfigurationsOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse]` +- New function `*NetworkSecurityPerimeterConfigurationsClient.ReconcileConfiguration(ctx context.Context, resourceGroupName string, vaultName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationOptions) (NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationResponse, error)` +- New struct `AccessRule` +- New struct `AccessRuleProperties` +- New struct `AccessRulePropertiesSubscription` +- New struct `NetworkSecurityPerimeter` +- New struct `NetworkSecurityPerimeterConfiguration` +- New struct `NetworkSecurityPerimeterConfigurationListResult` +- New struct `NetworkSecurityPerimeterConfigurationProperties` +- New struct `NetworkSecurityProfile` +- New struct `ProvisioningIssue` +- New struct `ProvisioningIssueProperties` +- New struct `ResourceAssociation` +- New struct `TokenBindingParameters` +- New struct `WrappingKeyAuthenticationData` +- New struct `WrappingKeyConfiguration` +- New struct `WrappingKeyValue` +- New field `Identity` in struct `Vault` +- New field `Identity` in struct `VaultCreateOrUpdateParameters` +- New field `Identity` in struct `VaultPatchParameters` +- New field `EnableCrossTenantAccessProtection`, `ProtectionKeysWrappingKey`, `TokenBindingParameters` in struct `VaultPatchProperties` +- New field `EnableCrossTenantAccessProtection`, `ProtectionKeysWrappingKey`, `TokenBindingParameters` in struct `VaultProperties` + + ## 2.1.0 (2026-10-06) ### Features Added diff --git a/sdk/resourcemanager/keyvault/armkeyvault/client_factory.go b/sdk/resourcemanager/keyvault/armkeyvault/client_factory.go index a4ed2875ec53..253468fd4965 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/client_factory.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/client_factory.go @@ -80,6 +80,14 @@ func (c *ClientFactory) NewManagedHsmsClient() *ManagedHsmsClient { } } +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient. +func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient { + return &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { return &OperationsClient{ diff --git a/sdk/resourcemanager/keyvault/armkeyvault/constants.go b/sdk/resourcemanager/keyvault/armkeyvault/constants.go index c1ec3e7db96f..d3d713f679f8 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/constants.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/constants.go @@ -5,7 +5,7 @@ package armkeyvault const ( - version20260515 string = "2026-05-15" + version20261001Preview string = "2026-10-01-preview" ) type AccessPolicyUpdateKind string @@ -25,6 +25,24 @@ func PossibleAccessPolicyUpdateKindValues() []AccessPolicyUpdateKind { } } +// AccessRuleDirection - Direction of Access Rule +type AccessRuleDirection string + +const ( + // AccessRuleDirectionInbound - Applies to inbound network traffic to the secured resources. + AccessRuleDirectionInbound AccessRuleDirection = "Inbound" + // AccessRuleDirectionOutbound - Applies to outbound network traffic from the secured resources + AccessRuleDirectionOutbound AccessRuleDirection = "Outbound" +) + +// PossibleAccessRuleDirectionValues returns the possible values for the AccessRuleDirection const type. +func PossibleAccessRuleDirectionValues() []AccessRuleDirection { + return []AccessRuleDirection{ + AccessRuleDirectionInbound, + AccessRuleDirectionOutbound, + } +} + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. type ActionsRequired string @@ -194,6 +212,33 @@ func PossibleGeoReplicationRegionProvisioningStateValues() []GeoReplicationRegio } } +// IssueType - Type of issue +type IssueType string + +const ( + // IssueTypeConfigurationPropagationFailure - An error occurred while applying the network security perimeter (NSP) configuration. + IssueTypeConfigurationPropagationFailure IssueType = "ConfigurationPropagationFailure" + // IssueTypeMissingIdentityConfiguration - An managed identity hasn't been associated with the resource. The resource will + // still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but + // it won't be able to perform outbound access as a member of the NSP. + IssueTypeMissingIdentityConfiguration IssueType = "MissingIdentityConfiguration" + // IssueTypeMissingPerimeterConfiguration - A network connectivity issue is happening on the resource which could be addressed + // either by adding new resources to the network security perimeter (NSP) or by modifying access rules. + IssueTypeMissingPerimeterConfiguration IssueType = "MissingPerimeterConfiguration" + // IssueTypeUnknown - Unknown issue type + IssueTypeUnknown IssueType = "Unknown" +) + +// PossibleIssueTypeValues returns the possible values for the IssueType const type. +func PossibleIssueTypeValues() []IssueType { + return []IssueType{ + IssueTypeConfigurationPropagationFailure, + IssueTypeMissingIdentityConfiguration, + IssueTypeMissingPerimeterConfiguration, + IssueTypeUnknown, + } +} + // JSONWebKeyCurveName - The elliptic curve name. For valid values, see JsonWebKeyCurveName. Default for EC and EC-HSM keys // is P-256 type JSONWebKeyCurveName string @@ -450,6 +495,41 @@ func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { } } +// NetworkSecurityPerimeterConfigurationProvisioningState - Provisioning state of a network security perimeter configuration +// that is being created or updated. +type NetworkSecurityPerimeterConfigurationProvisioningState string + +const ( + // NetworkSecurityPerimeterConfigurationProvisioningStateAccepted - The configuration request was accepted and provisioning + // has not started yet. + NetworkSecurityPerimeterConfigurationProvisioningStateAccepted NetworkSecurityPerimeterConfigurationProvisioningState = "Accepted" + // NetworkSecurityPerimeterConfigurationProvisioningStateCanceled - The configuration provisioning was canceled. + NetworkSecurityPerimeterConfigurationProvisioningStateCanceled NetworkSecurityPerimeterConfigurationProvisioningState = "Canceled" + // NetworkSecurityPerimeterConfigurationProvisioningStateCreating - The configuration is being created. + NetworkSecurityPerimeterConfigurationProvisioningStateCreating NetworkSecurityPerimeterConfigurationProvisioningState = "Creating" + // NetworkSecurityPerimeterConfigurationProvisioningStateDeleting - The configuration is being deleted. + NetworkSecurityPerimeterConfigurationProvisioningStateDeleting NetworkSecurityPerimeterConfigurationProvisioningState = "Deleting" + // NetworkSecurityPerimeterConfigurationProvisioningStateFailed - The configuration failed to provision. + NetworkSecurityPerimeterConfigurationProvisioningStateFailed NetworkSecurityPerimeterConfigurationProvisioningState = "Failed" + // NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded - The configuration was provisioned successfully. + NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded NetworkSecurityPerimeterConfigurationProvisioningState = "Succeeded" + // NetworkSecurityPerimeterConfigurationProvisioningStateUpdating - The configuration is being updated. + NetworkSecurityPerimeterConfigurationProvisioningStateUpdating NetworkSecurityPerimeterConfigurationProvisioningState = "Updating" +) + +// PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues returns the possible values for the NetworkSecurityPerimeterConfigurationProvisioningState const type. +func PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues() []NetworkSecurityPerimeterConfigurationProvisioningState { + return []NetworkSecurityPerimeterConfigurationProvisioningState{ + NetworkSecurityPerimeterConfigurationProvisioningStateAccepted, + NetworkSecurityPerimeterConfigurationProvisioningStateCanceled, + NetworkSecurityPerimeterConfigurationProvisioningStateCreating, + NetworkSecurityPerimeterConfigurationProvisioningStateDeleting, + NetworkSecurityPerimeterConfigurationProvisioningStateFailed, + NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded, + NetworkSecurityPerimeterConfigurationProvisioningStateUpdating, + } +} + // PrivateEndpointConnectionProvisioningState - The current provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -562,6 +642,29 @@ func PossibleReasonValues() []Reason { } } +// ResourceAssociationAccessMode - Access mode of the resource association +type ResourceAssociationAccessMode string + +const ( + // ResourceAssociationAccessModeAudit - Audit access mode - traffic to the resource that fails access checks is logged but + // not blocked + ResourceAssociationAccessModeAudit ResourceAssociationAccessMode = "Audit" + // ResourceAssociationAccessModeEnforced - Enforced access mode - traffic to the resource that failed access checks is blocked + ResourceAssociationAccessModeEnforced ResourceAssociationAccessMode = "Enforced" + // ResourceAssociationAccessModeLearning - Learning access mode - traffic to the resource is enabled for analysis but not + // blocked + ResourceAssociationAccessModeLearning ResourceAssociationAccessMode = "Learning" +) + +// PossibleResourceAssociationAccessModeValues returns the possible values for the ResourceAssociationAccessMode const type. +func PossibleResourceAssociationAccessModeValues() []ResourceAssociationAccessMode { + return []ResourceAssociationAccessMode{ + ResourceAssociationAccessModeAudit, + ResourceAssociationAccessModeEnforced, + ResourceAssociationAccessModeLearning, + } +} + // SKUFamily - SKU family name type SKUFamily string @@ -621,6 +724,24 @@ func PossibleSecretPermissionsValues() []SecretPermissions { } } +// Severity - Severity of the issue. +type Severity string + +const ( + // SeverityError - The issue is an error and prevents the configuration from being applied. + SeverityError Severity = "Error" + // SeverityWarning - The issue is a warning and does not prevent the configuration from being applied. + SeverityWarning Severity = "Warning" +) + +// PossibleSeverityValues returns the possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{ + SeverityError, + SeverityWarning, + } +} + type StoragePermissions string const ( @@ -662,6 +783,52 @@ func PossibleStoragePermissionsValues() []StoragePermissions { } } +// TokenBindingMode - This specifies whether token binding is disabled, enabled or enforced. +type TokenBindingMode string + +const ( + // TokenBindingModeEnforced - Token binding is enforced for the vault. Only bounded tokens will be accepted. Bearer tokens + // will be rejected. + TokenBindingModeEnforced TokenBindingMode = "Enforced" + // TokenBindingModeNotEnforced - Token binding is not enforced for the vault. Bounded tokens will be rejected. + TokenBindingModeNotEnforced TokenBindingMode = "NotEnforced" +) + +// PossibleTokenBindingModeValues returns the possible values for the TokenBindingMode const type. +func PossibleTokenBindingModeValues() []TokenBindingMode { + return []TokenBindingMode{ + TokenBindingModeEnforced, + TokenBindingModeNotEnforced, + } +} + +// TokenBindingStrength - Must be one of the following values "NoValidation", "Unattested", "AttestedTrustedLaunch", "AttestedConfidential". +// Strength of the token binding increases with each value in that order. +type TokenBindingStrength string + +const ( + // TokenBindingStrengthAttestedConfidential - Bounded Entra token must originate from a confidential VM with attestation proof + // from the attestation authority like Microsoft Azure Attestation. + TokenBindingStrengthAttestedConfidential TokenBindingStrength = "AttestedConfidential" + // TokenBindingStrengthAttestedTrustedLaunch - Bounded Entra token must originate from a trusted launch VM with attestation + // proof from the attestation authority like Microsoft Azure Attestation. + TokenBindingStrengthAttestedTrustedLaunch TokenBindingStrength = "AttestedTrustedLaunch" + // TokenBindingStrengthNoValidation - This is default when token binding is not enabled. + TokenBindingStrengthNoValidation TokenBindingStrength = "NoValidation" + // TokenBindingStrengthUnattested - No attestation proof is required for the bounded token. + TokenBindingStrengthUnattested TokenBindingStrength = "Unattested" +) + +// PossibleTokenBindingStrengthValues returns the possible values for the TokenBindingStrength const type. +func PossibleTokenBindingStrengthValues() []TokenBindingStrength { + return []TokenBindingStrength{ + TokenBindingStrengthAttestedConfidential, + TokenBindingStrengthAttestedTrustedLaunch, + TokenBindingStrengthNoValidation, + TokenBindingStrengthUnattested, + } +} + // VaultProvisioningState - Provisioning state of the vault. type VaultProvisioningState string diff --git a/sdk/resourcemanager/keyvault/armkeyvault/fake/networksecurityperimeterconfigurations_server.go b/sdk/resourcemanager/keyvault/armkeyvault/fake/networksecurityperimeterconfigurations_server.go new file mode 100644 index 000000000000..faa6b6f2d2c6 --- /dev/null +++ b/sdk/resourcemanager/keyvault/armkeyvault/fake/networksecurityperimeterconfigurations_server.go @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault/v2" + "net/http" + "net/url" + "regexp" + "slices" +) + +// NetworkSecurityPerimeterConfigurationsServer is a fake server for instances of the armkeyvault.NetworkSecurityPerimeterConfigurationsClient type. +type NetworkSecurityPerimeterConfigurationsServer struct { + // GetConfiguration is the fake for method NetworkSecurityPerimeterConfigurationsClient.GetConfiguration + // HTTP status codes to indicate success: http.StatusOK + GetConfiguration func(ctx context.Context, resourceGroupName string, vaultName string, networkSecurityPerimeterConfigurationName string, options *armkeyvault.NetworkSecurityPerimeterConfigurationsClientGetConfigurationOptions) (resp azfake.Responder[armkeyvault.NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse], errResp azfake.ErrorResponder) + + // NewListConfigurationsPager is the fake for method NetworkSecurityPerimeterConfigurationsClient.NewListConfigurationsPager + // HTTP status codes to indicate success: http.StatusOK + NewListConfigurationsPager func(resourceGroupName string, vaultName string, options *armkeyvault.NetworkSecurityPerimeterConfigurationsClientListConfigurationsOptions) (resp azfake.PagerResponder[armkeyvault.NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse]) + + // ReconcileConfiguration is the fake for method NetworkSecurityPerimeterConfigurationsClient.ReconcileConfiguration + // HTTP status codes to indicate success: http.StatusNoContent + ReconcileConfiguration func(ctx context.Context, resourceGroupName string, vaultName string, networkSecurityPerimeterConfigurationName string, options *armkeyvault.NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationOptions) (resp azfake.Responder[armkeyvault.NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationResponse], errResp azfake.ErrorResponder) +} + +// NewNetworkSecurityPerimeterConfigurationsServerTransport creates a new instance of NetworkSecurityPerimeterConfigurationsServerTransport with the provided implementation. +// The returned NetworkSecurityPerimeterConfigurationsServerTransport instance is connected to an instance of armkeyvault.NetworkSecurityPerimeterConfigurationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNetworkSecurityPerimeterConfigurationsServerTransport(srv *NetworkSecurityPerimeterConfigurationsServer) *NetworkSecurityPerimeterConfigurationsServerTransport { + return &NetworkSecurityPerimeterConfigurationsServerTransport{ + srv: srv, + newListConfigurationsPager: newTracker[azfake.PagerResponder[armkeyvault.NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse]](), + } +} + +// NetworkSecurityPerimeterConfigurationsServerTransport connects instances of armkeyvault.NetworkSecurityPerimeterConfigurationsClient to instances of NetworkSecurityPerimeterConfigurationsServer. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsServerTransport instead. +type NetworkSecurityPerimeterConfigurationsServerTransport struct { + srv *NetworkSecurityPerimeterConfigurationsServer + newListConfigurationsPager *tracker[azfake.PagerResponder[armkeyvault.NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse]] +} + +// Do implements the policy.Transporter interface for NetworkSecurityPerimeterConfigurationsServerTransport. +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, &nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return n.dispatchToMethodFake(req, method) +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result, 1) + go func() { + var intercepted bool + var res result + if networkSecurityPerimeterConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = networkSecurityPerimeterConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NetworkSecurityPerimeterConfigurationsClient.GetConfiguration": + res.resp, res.err = n.dispatchGetConfiguration(req) + case "NetworkSecurityPerimeterConfigurationsClient.NewListConfigurationsPager": + res.resp, res.err = n.dispatchNewListConfigurationsPager(req) + case "NetworkSecurityPerimeterConfigurationsClient.ReconcileConfiguration": + res.resp, res.err = n.dispatchReconcileConfiguration(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + resultChan <- res + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchGetConfiguration(req *http.Request) (*http.Response, error) { + if n.srv.GetConfiguration == nil { + return nil, &nonRetriableError{errors.New("fake for method GetConfiguration not implemented")} + } + const regexStr = `/subscriptions/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/resourceGroups/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/providers/Microsoft\.KeyVault/vaults/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/networkSecurityPerimeterConfigurations/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + vaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("vaultName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterConfigurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterConfigurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.GetConfiguration(req.Context(), resourceGroupNameParam, vaultNameParam, networkSecurityPerimeterConfigurationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NetworkSecurityPerimeterConfiguration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchNewListConfigurationsPager(req *http.Request) (*http.Response, error) { + if n.srv.NewListConfigurationsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListConfigurationsPager not implemented")} + } + newListConfigurationsPager := n.newListConfigurationsPager.get(req) + if newListConfigurationsPager == nil { + const regexStr = `/subscriptions/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/resourceGroups/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/providers/Microsoft\.KeyVault/vaults/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/networkSecurityPerimeterConfigurations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + vaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("vaultName")]) + if err != nil { + return nil, err + } + resp := n.srv.NewListConfigurationsPager(resourceGroupNameParam, vaultNameParam, nil) + newListConfigurationsPager = &resp + n.newListConfigurationsPager.add(req, newListConfigurationsPager) + server.PagerResponderInjectNextLinks(newListConfigurationsPager, req, func(page *armkeyvault.NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListConfigurationsPager, req) + if err != nil { + return nil, err + } + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { + n.newListConfigurationsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListConfigurationsPager) { + n.newListConfigurationsPager.remove(req) + } + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchReconcileConfiguration(req *http.Request) (*http.Response, error) { + if n.srv.ReconcileConfiguration == nil { + return nil, &nonRetriableError{errors.New("fake for method ReconcileConfiguration not implemented")} + } + const regexStr = `/subscriptions/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/resourceGroups/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/providers/Microsoft\.KeyVault/vaults/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/networkSecurityPerimeterConfigurations/(?P[a-zA-Z0-9._~%!$&'()*+,;=:@-]+)/reconcile` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + vaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("vaultName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterConfigurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterConfigurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.ReconcileConfiguration(req.Context(), resourceGroupNameParam, vaultNameParam, networkSecurityPerimeterConfigurationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !slices.Contains([]int{http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to NetworkSecurityPerimeterConfigurationsServerTransport +var networkSecurityPerimeterConfigurationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/fake/server_factory.go b/sdk/resourcemanager/keyvault/armkeyvault/fake/server_factory.go index 19a68afbcd81..9e2d9ed8dd65 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/fake/server_factory.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/fake/server_factory.go @@ -33,6 +33,9 @@ type ServerFactory struct { // ManagedHsmsServer contains the fakes for client ManagedHsmsClient ManagedHsmsServer ManagedHsmsServer + // NetworkSecurityPerimeterConfigurationsServer contains the fakes for client NetworkSecurityPerimeterConfigurationsClient + NetworkSecurityPerimeterConfigurationsServer NetworkSecurityPerimeterConfigurationsServer + // OperationsServer contains the fakes for client OperationsClient OperationsServer OperationsServer @@ -61,19 +64,20 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armkeyvault.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trKeysServer *KeysServerTransport - trMHSMPrivateEndpointConnectionsServer *MHSMPrivateEndpointConnectionsServerTransport - trMHSMPrivateLinkResourcesServer *MHSMPrivateLinkResourcesServerTransport - trMHSMRegionsServer *MHSMRegionsServerTransport - trManagedHsmKeysServer *ManagedHsmKeysServerTransport - trManagedHsmsServer *ManagedHsmsServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trSecretsServer *SecretsServerTransport - trVaultsServer *VaultsServerTransport + srv *ServerFactory + trMu sync.Mutex + trKeysServer *KeysServerTransport + trMHSMPrivateEndpointConnectionsServer *MHSMPrivateEndpointConnectionsServerTransport + trMHSMPrivateLinkResourcesServer *MHSMPrivateLinkResourcesServerTransport + trMHSMRegionsServer *MHSMRegionsServerTransport + trManagedHsmKeysServer *ManagedHsmKeysServerTransport + trManagedHsmsServer *ManagedHsmsServerTransport + trNetworkSecurityPerimeterConfigurationsServer *NetworkSecurityPerimeterConfigurationsServerTransport + trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trSecretsServer *SecretsServerTransport + trVaultsServer *VaultsServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -113,6 +117,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ManagedHsmsClient": initServer(&s.trMu, &s.trManagedHsmsServer, func() *ManagedHsmsServerTransport { return NewManagedHsmsServerTransport(&s.srv.ManagedHsmsServer) }) resp, err = s.trManagedHsmsServer.Do(req) + case "NetworkSecurityPerimeterConfigurationsClient": + initServer(&s.trMu, &s.trNetworkSecurityPerimeterConfigurationsServer, func() *NetworkSecurityPerimeterConfigurationsServerTransport { + return NewNetworkSecurityPerimeterConfigurationsServerTransport(&s.srv.NetworkSecurityPerimeterConfigurationsServer) + }) + resp, err = s.trNetworkSecurityPerimeterConfigurationsServer.Do(req) case "OperationsClient": initServer(&s.trMu, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) diff --git a/sdk/resourcemanager/keyvault/armkeyvault/keys_client.go b/sdk/resourcemanager/keyvault/armkeyvault/keys_client.go index 8df54f0fc9fb..eee360eaf50e 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/keys_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/keys_client.go @@ -19,7 +19,7 @@ import ( // KeysClient contains the methods for the Keys group. // Don't use this type directly, use NewKeysClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type KeysClient struct { internal *arm.Client subscriptionID string @@ -95,7 +95,7 @@ func (client *KeysClient) createIfNotExistCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -165,7 +165,7 @@ func (client *KeysClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +236,7 @@ func (client *KeysClient) getVersionCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -311,7 +311,7 @@ func (client *KeysClient) listCreateRequest(ctx context.Context, resourceGroupNa } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -392,7 +392,7 @@ func (client *KeysClient) listVersionsCreateRequest(ctx context.Context, resourc } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } diff --git a/sdk/resourcemanager/keyvault/armkeyvault/keys_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/keys_client_example_test.go index d0bcab919c8b..ee2a08cc9c7e 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/keys_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/keys_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/createKey.json +// Generated from example definition: 2026-10-01-preview/createKey.json func ExampleKeysClient_CreateIfNotExist() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -64,7 +64,7 @@ func ExampleKeysClient_CreateIfNotExist() { // } } -// Generated from example definition: 2026-05-15/getKey.json +// Generated from example definition: 2026-10-01-preview/getKey.json func ExampleKeysClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -112,7 +112,7 @@ func ExampleKeysClient_Get() { // } } -// Generated from example definition: 2026-05-15/getKeyVersion.json +// Generated from example definition: 2026-10-01-preview/getKeyVersion.json func ExampleKeysClient_GetVersion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -160,7 +160,7 @@ func ExampleKeysClient_GetVersion() { // } } -// Generated from example definition: 2026-05-15/listKeys.json +// Generated from example definition: 2026-10-01-preview/listKeys.json func ExampleKeysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -221,7 +221,7 @@ func ExampleKeysClient_NewListPager() { } } -// Generated from example definition: 2026-05-15/listKeyVersions.json +// Generated from example definition: 2026-10-01-preview/listKeyVersions.json func ExampleKeysClient_NewListVersionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client.go b/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client.go index 5b3fd42076e6..1874a08ed9c5 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client.go @@ -19,7 +19,7 @@ import ( // ManagedHsmKeysClient contains the methods for the ManagedHsmKeys group. // Don't use this type directly, use NewManagedHsmKeysClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type ManagedHsmKeysClient struct { internal *arm.Client subscriptionID string @@ -97,7 +97,7 @@ func (client *ManagedHsmKeysClient) createIfNotExistCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -168,7 +168,7 @@ func (client *ManagedHsmKeysClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,7 +241,7 @@ func (client *ManagedHsmKeysClient) getVersionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +316,7 @@ func (client *ManagedHsmKeysClient) listCreateRequest(ctx context.Context, resou } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -399,7 +399,7 @@ func (client *ManagedHsmKeysClient) listVersionsCreateRequest(ctx context.Contex } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } diff --git a/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client_example_test.go index 9518d0c87592..3bd06670429d 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/managedHsmCreateKey.json +// Generated from example definition: 2026-10-01-preview/managedHsmCreateKey.json func ExampleManagedHsmKeysClient_CreateIfNotExist() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExampleManagedHsmKeysClient_CreateIfNotExist() { // } } -// Generated from example definition: 2026-05-15/managedHsmGetKey.json +// Generated from example definition: 2026-10-01-preview/managedHsmGetKey.json func ExampleManagedHsmKeysClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -110,7 +110,7 @@ func ExampleManagedHsmKeysClient_Get() { // } } -// Generated from example definition: 2026-05-15/managedHsmGetKeyVersion.json +// Generated from example definition: 2026-10-01-preview/managedHsmGetKeyVersion.json func ExampleManagedHsmKeysClient_GetVersion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -157,7 +157,7 @@ func ExampleManagedHsmKeysClient_GetVersion() { // } } -// Generated from example definition: 2026-05-15/managedHsmListKeys.json +// Generated from example definition: 2026-10-01-preview/managedHsmListKeys.json func ExampleManagedHsmKeysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -216,7 +216,7 @@ func ExampleManagedHsmKeysClient_NewListPager() { } } -// Generated from example definition: 2026-05-15/managedHsmListKeyVersions.json +// Generated from example definition: 2026-10-01-preview/managedHsmListKeyVersions.json func ExampleManagedHsmKeysClient_NewListVersionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client.go b/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client.go index 17c8056360d8..5f24aac5f0dd 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client.go @@ -20,7 +20,7 @@ import ( // ManagedHsmsClient contains the methods for the ManagedHsms group. // Don't use this type directly, use NewManagedHsmsClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type ManagedHsmsClient struct { internal *arm.Client subscriptionID string @@ -112,7 +112,7 @@ func (client *ManagedHsmsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -187,7 +187,7 @@ func (client *ManagedHsmsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } @@ -256,7 +256,7 @@ func (client *ManagedHsmsClient) purgeDeletedCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } @@ -327,7 +327,7 @@ func (client *ManagedHsmsClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -372,7 +372,7 @@ func (client *ManagedHsmsClient) checkMhsmNameAvailabilityCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -437,7 +437,7 @@ func (client *ManagedHsmsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -496,7 +496,7 @@ func (client *ManagedHsmsClient) getDeletedCreateRequest(ctx context.Context, na return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -571,7 +571,7 @@ func (client *ManagedHsmsClient) listByResourceGroupCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -641,7 +641,7 @@ func (client *ManagedHsmsClient) listBySubscriptionCreateRequest(ctx context.Con if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -708,7 +708,7 @@ func (client *ManagedHsmsClient) listDeletedCreateRequest(ctx context.Context, n } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } diff --git a/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client_example_test.go index 61c01e166456..3544b0f439f8 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/ManagedHsm_CreateOrUpdate.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_CreateOrUpdate.json func ExampleManagedHsmsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,7 +83,7 @@ func ExampleManagedHsmsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: 2026-05-15/ManagedHsm_Delete.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_Delete.json func ExampleManagedHsmsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -109,7 +109,7 @@ func ExampleManagedHsmsClient_BeginDelete() { // } } -// Generated from example definition: 2026-05-15/DeletedManagedHsm_Purge.json +// Generated from example definition: 2026-10-01-preview/DeletedManagedHsm_Purge.json func ExampleManagedHsmsClient_BeginPurgeDeleted() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleManagedHsmsClient_BeginPurgeDeleted() { } } -// Generated from example definition: 2026-05-15/ManagedHsm_Update.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_Update.json func ExampleManagedHsmsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -189,7 +189,7 @@ func ExampleManagedHsmsClient_BeginUpdate() { // } } -// Generated from example definition: 2026-05-15/ManagedHsm_checkMhsmNameAvailability.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_checkMhsmNameAvailability.json func ExampleManagedHsmsClient_CheckMhsmNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -216,7 +216,7 @@ func ExampleManagedHsmsClient_CheckMhsmNameAvailability() { // } } -// Generated from example definition: 2026-05-15/ManagedHsm_Get.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_Get.json func ExampleManagedHsmsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -264,7 +264,7 @@ func ExampleManagedHsmsClient_Get() { // } } -// Generated from example definition: 2026-05-15/DeletedManagedHsm_Get.json +// Generated from example definition: 2026-10-01-preview/DeletedManagedHsm_Get.json func ExampleManagedHsmsClient_GetDeleted() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -302,7 +302,7 @@ func ExampleManagedHsmsClient_GetDeleted() { // } } -// Generated from example definition: 2026-05-15/ManagedHsm_ListByResourceGroup.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_ListByResourceGroup.json func ExampleManagedHsmsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -386,7 +386,7 @@ func ExampleManagedHsmsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: 2026-05-15/ManagedHsm_ListBySubscription.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_ListBySubscription.json func ExampleManagedHsmsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -470,7 +470,7 @@ func ExampleManagedHsmsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: 2026-05-15/DeletedManagedHsm_List.json +// Generated from example definition: 2026-10-01-preview/DeletedManagedHsm_List.json func ExampleManagedHsmsClient_NewListDeletedPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client.go b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client.go index 199251169a6f..bc45f565bf21 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client.go @@ -20,7 +20,7 @@ import ( // MHSMPrivateEndpointConnectionsClient contains the methods for the MHSMPrivateEndpointConnections group. // Don't use this type directly, use NewMHSMPrivateEndpointConnectionsClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type MHSMPrivateEndpointConnectionsClient struct { internal *arm.Client subscriptionID string @@ -116,7 +116,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) listByResourceCreateRequest( } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -317,7 +317,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) putCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client_example_test.go index ad69b5ffcb04..8aeb8276ae6f 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/ManagedHsm_deletePrivateEndpointConnection.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_deletePrivateEndpointConnection.json func ExampleMHSMPrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,7 +46,7 @@ func ExampleMHSMPrivateEndpointConnectionsClient_BeginDelete() { // } } -// Generated from example definition: 2026-05-15/ManagedHsm_getPrivateEndpointConnection.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_getPrivateEndpointConnection.json func ExampleMHSMPrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -85,7 +85,7 @@ func ExampleMHSMPrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: 2026-05-15/ManagedHsm_ListPrivateEndpointConnectionsByResource.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_ListPrivateEndpointConnectionsByResource.json func ExampleMHSMPrivateEndpointConnectionsClient_NewListByResourcePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -150,7 +150,7 @@ func ExampleMHSMPrivateEndpointConnectionsClient_NewListByResourcePager() { } } -// Generated from example definition: 2026-05-15/ManagedHsm_putPrivateEndpointConnection.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_putPrivateEndpointConnection.json func ExampleMHSMPrivateEndpointConnectionsClient_Put() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client.go b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client.go index d8a27691a322..5b22eabf3683 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client.go @@ -19,7 +19,7 @@ import ( // MHSMPrivateLinkResourcesClient contains the methods for the MHSMPrivateLinkResources group. // Don't use this type directly, use NewMHSMPrivateLinkResourcesClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type MHSMPrivateLinkResourcesClient struct { internal *arm.Client subscriptionID string @@ -88,7 +88,7 @@ func (client *MHSMPrivateLinkResourcesClient) listByMHSMResourceCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client_example_test.go index a0fdab41088c..4f76c852560b 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/ManagedHsm_listPrivateLinkResources.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_listPrivateLinkResources.json func ExampleMHSMPrivateLinkResourcesClient_ListByMHSMResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client.go b/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client.go index 20e33987800d..a904d343e95a 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client.go @@ -19,7 +19,7 @@ import ( // MHSMRegionsClient contains the methods for the MHSMRegions group. // Don't use this type directly, use NewMHSMRegionsClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type MHSMRegionsClient struct { internal *arm.Client subscriptionID string @@ -102,7 +102,7 @@ func (client *MHSMRegionsClient) listByResourceCreateRequest(ctx context.Context } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } diff --git a/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client_example_test.go index 4c39db8ed110..785549d7d521 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/ManagedHsm_ListRegionsByResource.json +// Generated from example definition: 2026-10-01-preview/ManagedHsm_ListRegionsByResource.json func ExampleMHSMRegionsClient_NewListByResourcePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/models.go b/sdk/resourcemanager/keyvault/armkeyvault/models.go index cff3514e4d88..38f1a2be45ca 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/models.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/models.go @@ -26,6 +26,44 @@ type AccessPolicyEntry struct { ApplicationID *string } +// AccessRule - Access rule in a network security perimeter configuration profile +type AccessRule struct { + // Name of the access rule + Name *string + + // Properties of the access rule + Properties *AccessRuleProperties +} + +// AccessRuleProperties - Properties of Access Rule +type AccessRuleProperties struct { + // Address prefixes in the CIDR format for inbound rules + AddressPrefixes []*string + + // Direction of the access rule + Direction *AccessRuleDirection + + // Email addresses for outbound rules + EmailAddresses []*string + + // Fully qualified domain names (FQDN) for outbound rules + FullyQualifiedDomainNames []*string + + // Network security perimeters for inbound rules + NetworkSecurityPerimeters []*NetworkSecurityPerimeter + + // Phone numbers for outbound rules + PhoneNumbers []*string + + // Subscriptions for inbound rules + Subscriptions []*AccessRulePropertiesSubscription +} + +type AccessRulePropertiesSubscription struct { + // The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') + ID *string +} + type Action struct { // The type of action. Type *KeyRotationPolicyActionType @@ -826,6 +864,81 @@ type NetworkRuleSet struct { VirtualNetworkRules []*VirtualNetworkRule } +// NetworkSecurityPerimeter - Information about a network security perimeter (NSP) +type NetworkSecurityPerimeter struct { + // Fully qualified Azure resource ID of the NSP resource + ID *string + + // Location of the network security perimeter + Location *string + + // Universal unique ID (UUID) of the network security perimeter + PerimeterGUID *string +} + +// NetworkSecurityPerimeterConfiguration - Network security perimeter (NSP) configuration resource +type NetworkSecurityPerimeterConfiguration struct { + // Network security configuration properties. + Properties *NetworkSecurityPerimeterConfigurationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// NetworkSecurityPerimeterConfigurationListResult - Result of a list NSP (network security perimeter) configurations request. +type NetworkSecurityPerimeterConfigurationListResult struct { + // The link used to get the next page of results. + NextLink *string + + // Array of network security perimeter results. + Value []*NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationProperties - Network security configuration properties. +type NetworkSecurityPerimeterConfigurationProperties struct { + // Information about the network security perimeter (NSP) + NetworkSecurityPerimeter *NetworkSecurityPerimeter + + // Network security perimeter configuration profile + Profile *NetworkSecurityProfile + + // Information about the resource association + ResourceAssociation *ResourceAssociation + + // READ-ONLY; List of provisioning issues, if any + ProvisioningIssues []*ProvisioningIssue + + // READ-ONLY; Provisioning state of the network security perimeter configuration + ProvisioningState *NetworkSecurityPerimeterConfigurationProvisioningState +} + +// NetworkSecurityProfile - Network security perimeter configuration profile +type NetworkSecurityProfile struct { + // List of Access Rules + AccessRules []*AccessRule + + // Current access rules version + AccessRulesVersion *int32 + + // Current diagnostic settings version + DiagnosticSettingsVersion *int32 + + // List of log categories that are enabled + EnabledLogCategories []*string + + // Name of the profile + Name *string +} + // Operation - Key Vault REST API operation definition. type Operation struct { // Display metadata associated with the operation. @@ -1010,6 +1123,45 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateEndpointServiceConnectionStatus } +// ProvisioningIssue - Describes a provisioning issue for a network security perimeter configuration +type ProvisioningIssue struct { + // READ-ONLY; Name of the issue + Name *string + + // READ-ONLY; Details of the provisioning issue + Properties *ProvisioningIssueProperties +} + +// ProvisioningIssueProperties - Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource +// providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful +// and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules +type ProvisioningIssueProperties struct { + // READ-ONLY; Description of the issue + Description *string + + // READ-ONLY; Type of issue + IssueType *IssueType + + // READ-ONLY; Severity of the issue. + Severity *Severity + + // READ-ONLY; Access rules that can be added to the network security profile (NSP) to remediate the issue. + SuggestedAccessRules []*AccessRule + + // READ-ONLY; Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter + // (NSP) to remediate the issue. + SuggestedResourceIDs []*string +} + +// ResourceAssociation - Information about resource association +type ResourceAssociation struct { + // Access mode of the resource association + AccessMode *ResourceAssociationAccessMode + + // Name of the resource association + Name *string +} + // ResourceListResult - The list of vault resources. type ResourceListResult struct { // REQUIRED; The list of vault resources. @@ -1166,6 +1318,16 @@ type SystemData struct { LastModifiedByType *CreatedByType } +// TokenBindingParameters - Configuration for Token Binding for Entra tokens +type TokenBindingParameters struct { + // Must be one of the following values "NoValidation", "Unattested", "AttestedTrustedLaunch", "AttestedConfidential". Strength + // of the token binding increases with each value in that order. + MinimumTokenBindingStrength *TokenBindingStrength + + // This specifies whether token binding is disabled, enabled or enforced. + Mode *TokenBindingMode +} + // TrackedResource - Tracked Resource // // The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -1212,6 +1374,9 @@ type Vault struct { // REQUIRED; Properties of the vault Properties *VaultProperties + // The managed service identities assigned to this resource. + Identity *ManagedServiceIdentity + // Azure location of the key vault resource. Location *string @@ -1274,6 +1439,9 @@ type VaultCreateOrUpdateParameters struct { // REQUIRED; Properties of the vault Properties *VaultProperties + // Managed service identity assigned to the vault. + Identity *ManagedServiceIdentity + // The tags that will be assigned to the key vault. Tags map[string]*string } @@ -1289,6 +1457,9 @@ type VaultListResult struct { // VaultPatchParameters - Parameters for creating or updating a vault type VaultPatchParameters struct { + // Managed service identity assigned to the vault. + Identity *ManagedServiceIdentity + // Properties of the vault Properties *VaultPatchProperties @@ -1305,6 +1476,11 @@ type VaultPatchProperties struct { // The vault's create mode to indicate whether the vault need to be recovered or not. CreateMode *CreateMode + // Whether cross-tenant access protection is enabled for this vault. When enabled, changes to the vault tenant ID must use + // the subscription's home tenant ID. Once enabled, this protection cannot be disabled. If omitted, the existing value is + // preserved. + EnableCrossTenantAccessProtection *bool + // Property specifying whether protection against purge is enabled for this vault. Setting this property to true activates // protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable // deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that @@ -1334,6 +1510,20 @@ type VaultPatchProperties struct { // A collection of rules governing the accessibility of the vault from specific network locations. NetworkACLs *NetworkRuleSet + // Configures an external Managed HSM key used to wrap the vault's protection keys. + // When configured, this property is returned in create, update, get, and list responses. + // Responses contain the persisted key reference and authentication mechanism, not key material or credentials. + // It can be supplied when enabling wrapping on an existing vault. + // This property is available starting with API version 2026-10-01-preview, when the protection-key wrapping capability is + // available for the target vault. + // Reapplying an equivalent configuration is supported; replacing or removing it is not. + // A versionless reference can match the persisted versioned reference; resubmitting it does not rotate the key. + // After configuration, vault availability depends on the persisted Managed HSM key version remaining usable and accessible + // to the service. + // Disabling or deleting that key version, or revoking the service's access, can make the vault unavailable. + // Omitting this property preserves the existing configuration. + ProtectionKeysWrappingKey *WrappingKeyConfiguration + // Property to specify whether the vault will accept traffic from public internet. If set to 'disabled' all traffic except // private endpoint traffic and that that originates from trusted services will be blocked. This will override the set firewall // rules, meaning that even if the firewall rules are present we will not honor the rules. @@ -1347,6 +1537,9 @@ type VaultPatchProperties struct { // The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. TenantID *string + + // Configuration for Token Binding for Entra tokens + TokenBindingParameters *TokenBindingParameters } // VaultProperties - Properties of the vault @@ -1365,6 +1558,11 @@ type VaultProperties struct { // The vault's create mode to indicate whether the vault need to be recovered or not. CreateMode *CreateMode + // Whether cross-tenant access protection is enabled for this vault. When enabled, the vault tenant ID can only be set or + // changed to the subscription's home tenant ID. Once enabled, this protection cannot be disabled. If omitted when creating + // a vault, protection is disabled. If omitted when updating a vault, the existing value is preserved. + EnableCrossTenantAccessProtection *bool + // Property specifying whether protection against purge is enabled for this vault. Setting this property to true activates // protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable // deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that @@ -1395,6 +1593,20 @@ type VaultProperties struct { // Rules governing the accessibility of the key vault from specific network locations. NetworkACLs *NetworkRuleSet + // Configures an external Managed HSM key used to wrap the vault's protection keys. + // When configured, this property is returned in create, update, get, and list responses. + // Responses contain the persisted key reference and authentication mechanism, not key material or credentials. + // It can be supplied when creating a vault or enabling wrapping on an existing vault. + // This property is available starting with API version 2026-10-01-preview, when the protection-key wrapping capability is + // available for the target vault. + // Reapplying an equivalent configuration is supported; replacing or removing it is not. + // A versionless reference can match the persisted versioned reference; resubmitting it does not rotate the key. + // After configuration, vault availability depends on the persisted Managed HSM key version remaining usable and accessible + // to the service. + // Disabling or deleting that key version, or revoking the service's access, can make the vault unavailable. + // Omitting this property preserves the existing configuration. + ProtectionKeysWrappingKey *WrappingKeyConfiguration + // Provisioning state of the vault. ProvisioningState *VaultProvisioningState @@ -1406,6 +1618,9 @@ type VaultProperties struct { // softDelete data retention days. It accepts >=7 and <=90. SoftDeleteRetentionInDays *int32 + // Configuration for Token Binding for Entra tokens + TokenBindingParameters *TokenBindingParameters + // The URI of the vault for performing operations on keys and secrets. VaultURI *string @@ -1424,3 +1639,38 @@ type VirtualNetworkRule struct { // Property to specify whether NRP will ignore the check if parent subnet has serviceEndpoints configured. IgnoreMissingVnetServiceEndpoint *bool } + +// WrappingKeyAuthenticationData - Authentication mechanism for accessing the external wrapping key. +type WrappingKeyAuthenticationData struct { + // CONSTANT; Authentication mechanism. Only ServiceIdentity is supported. + // A caller-supplied vault managed identity is not required. + // Field has constant value "ServiceIdentity", any specified value is ignored. + AuthType *string +} + +// WrappingKeyConfiguration - Configuration of the external key used to wrap a vault's protection keys. +// Unsupported properties in this configuration and its nested objects are rejected. +// Unsupported API versions or a feature that is not enabled result in HTTP 400 with NotSupported. +// Invalid configurations or attempted replacement result in HTTP 400 with BadRequest or InvalidParameter. +// Protection key wrapping throttling results in HTTP 429 with InternalError. +// Other protection key wrapping failures result in HTTP 503 with InternalError. +// Errors use the existing CloudError response. +type WrappingKeyConfiguration struct { + // REQUIRED; Specifies how the service authenticates to the external wrapping key. + KeyAuthenticationData *WrappingKeyAuthenticationData + + // REQUIRED; Identifies the external wrapping key. + KeyValue *WrappingKeyValue +} + +// WrappingKeyValue - Reference to an external Managed HSM wrapping key. +type WrappingKeyValue struct { + // CONSTANT; Wrapping key type. Only oct is supported. + // Field has constant value "oct", any specified value is ignored. + Kty *string + + // REQUIRED; Absolute HTTPS URL of a key on a supported Managed HSM endpoint. + // The path must be /keys/{key-name} or /keys/{key-name}/{key-version}. + // User information, query strings, fragments, and non-default ports are not supported. + URL *string +} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/models_serde.go b/sdk/resourcemanager/keyvault/armkeyvault/models_serde.go index 4ac5e3f3a230..c962b765897f 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/models_serde.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/models_serde.go @@ -53,6 +53,115 @@ func (a *AccessPolicyEntry) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AccessRule. +func (a AccessRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessRule. +func (a *AccessRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccessRuleProperties. +func (a AccessRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", a.AddressPrefixes) + populate(objectMap, "direction", a.Direction) + populate(objectMap, "emailAddresses", a.EmailAddresses) + populate(objectMap, "fullyQualifiedDomainNames", a.FullyQualifiedDomainNames) + populate(objectMap, "networkSecurityPerimeters", a.NetworkSecurityPerimeters) + populate(objectMap, "phoneNumbers", a.PhoneNumbers) + populate(objectMap, "subscriptions", a.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessRuleProperties. +func (a *AccessRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &a.AddressPrefixes) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &a.Direction) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &a.EmailAddresses) + delete(rawMsg, key) + case "fullyQualifiedDomainNames": + err = unpopulate(val, "FullyQualifiedDomainNames", &a.FullyQualifiedDomainNames) + delete(rawMsg, key) + case "networkSecurityPerimeters": + err = unpopulate(val, "NetworkSecurityPerimeters", &a.NetworkSecurityPerimeters) + delete(rawMsg, key) + case "phoneNumbers": + err = unpopulate(val, "PhoneNumbers", &a.PhoneNumbers) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &a.Subscriptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccessRulePropertiesSubscription. +func (a AccessRulePropertiesSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessRulePropertiesSubscription. +func (a *AccessRulePropertiesSubscription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Action. func (a Action) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2166,6 +2275,201 @@ func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeter. +func (n NetworkSecurityPerimeter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeter. +func (n *NetworkSecurityPerimeter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationListResult. +func (n NetworkSecurityPerimeterConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationListResult. +func (n *NetworkSecurityPerimeterConfigurationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningIssues", n.ProvisioningIssues) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceAssociation", n.ResourceAssociation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkSecurityPerimeter": + err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter) + delete(rawMsg, key) + case "profile": + err = unpopulate(val, "Profile", &n.Profile) + delete(rawMsg, key) + case "provisioningIssues": + err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "resourceAssociation": + err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityProfile. +func (n NetworkSecurityProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessRules", n.AccessRules) + populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) + populate(objectMap, "diagnosticSettingsVersion", n.DiagnosticSettingsVersion) + populate(objectMap, "enabledLogCategories", n.EnabledLogCategories) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityProfile. +func (n *NetworkSecurityProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessRules": + err = unpopulate(val, "AccessRules", &n.AccessRules) + delete(rawMsg, key) + case "accessRulesVersion": + err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion) + delete(rawMsg, key) + case "diagnosticSettingsVersion": + err = unpopulate(val, "DiagnosticSettingsVersion", &n.DiagnosticSettingsVersion) + delete(rawMsg, key) + case "enabledLogCategories": + err = unpopulate(val, "EnabledLogCategories", &n.EnabledLogCategories) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2676,6 +2980,111 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue. +func (p ProvisioningIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue. +func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssueProperties. +func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) + populate(objectMap, "issueType", p.IssueType) + populate(objectMap, "severity", p.Severity) + populate(objectMap, "suggestedAccessRules", p.SuggestedAccessRules) + populate(objectMap, "suggestedResourceIds", p.SuggestedResourceIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties. +func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "issueType": + err = unpopulate(val, "IssueType", &p.IssueType) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &p.Severity) + delete(rawMsg, key) + case "suggestedAccessRules": + err = unpopulate(val, "SuggestedAccessRules", &p.SuggestedAccessRules) + delete(rawMsg, key) + case "suggestedResourceIds": + err = unpopulate(val, "SuggestedResourceIDs", &p.SuggestedResourceIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceAssociation. +func (r ResourceAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessMode", r.AccessMode) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAssociation. +func (r *ResourceAssociation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessMode": + err = unpopulate(val, "AccessMode", &r.AccessMode) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ResourceListResult. func (r ResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3112,6 +3521,37 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TokenBindingParameters. +func (t TokenBindingParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "minimumTokenBindingStrength", t.MinimumTokenBindingStrength) + populate(objectMap, "mode", t.Mode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TokenBindingParameters. +func (t *TokenBindingParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", t, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "minimumTokenBindingStrength": + err = unpopulate(val, "MinimumTokenBindingStrength", &t.MinimumTokenBindingStrength) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &t.Mode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", t, err.Error()) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3225,6 +3665,7 @@ func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { func (v Vault) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", v.ID) + populate(objectMap, "identity", v.Identity) populate(objectMap, "location", v.Location) populate(objectMap, "name", v.Name) populate(objectMap, "properties", v.Properties) @@ -3246,6 +3687,9 @@ func (v *Vault) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &v.ID) delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &v.Identity) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &v.Location) delete(rawMsg, key) @@ -3376,6 +3820,7 @@ func (v *VaultCheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type VaultCreateOrUpdateParameters. func (v VaultCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "identity", v.Identity) populate(objectMap, "location", v.Location) populate(objectMap, "properties", v.Properties) populate(objectMap, "tags", v.Tags) @@ -3391,6 +3836,9 @@ func (v *VaultCreateOrUpdateParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "identity": + err = unpopulate(val, "Identity", &v.Identity) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &v.Location) delete(rawMsg, key) @@ -3442,6 +3890,7 @@ func (v *VaultListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultPatchParameters. func (v VaultPatchParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "identity", v.Identity) populate(objectMap, "properties", v.Properties) populate(objectMap, "tags", v.Tags) return json.Marshal(objectMap) @@ -3456,6 +3905,9 @@ func (v *VaultPatchParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "identity": + err = unpopulate(val, "Identity", &v.Identity) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &v.Properties) delete(rawMsg, key) @@ -3475,6 +3927,7 @@ func (v VaultPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "accessPolicies", v.AccessPolicies) populate(objectMap, "createMode", v.CreateMode) + populate(objectMap, "enableCrossTenantAccessProtection", v.EnableCrossTenantAccessProtection) populate(objectMap, "enablePurgeProtection", v.EnablePurgeProtection) populate(objectMap, "enableRbacAuthorization", v.EnableRbacAuthorization) populate(objectMap, "enableSoftDelete", v.EnableSoftDelete) @@ -3482,10 +3935,12 @@ func (v VaultPatchProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "enabledForDiskEncryption", v.EnabledForDiskEncryption) populate(objectMap, "enabledForTemplateDeployment", v.EnabledForTemplateDeployment) populate(objectMap, "networkAcls", v.NetworkACLs) + populate(objectMap, "protectionKeysWrappingKey", v.ProtectionKeysWrappingKey) populate(objectMap, "publicNetworkAccess", v.PublicNetworkAccess) populate(objectMap, "sku", v.SKU) populate(objectMap, "softDeleteRetentionInDays", v.SoftDeleteRetentionInDays) populate(objectMap, "tenantId", v.TenantID) + populate(objectMap, "tokenBindingParameters", v.TokenBindingParameters) return json.Marshal(objectMap) } @@ -3504,6 +3959,9 @@ func (v *VaultPatchProperties) UnmarshalJSON(data []byte) error { case "createMode": err = unpopulate(val, "CreateMode", &v.CreateMode) delete(rawMsg, key) + case "enableCrossTenantAccessProtection": + err = unpopulate(val, "EnableCrossTenantAccessProtection", &v.EnableCrossTenantAccessProtection) + delete(rawMsg, key) case "enablePurgeProtection": err = unpopulate(val, "EnablePurgeProtection", &v.EnablePurgeProtection) delete(rawMsg, key) @@ -3525,6 +3983,9 @@ func (v *VaultPatchProperties) UnmarshalJSON(data []byte) error { case "networkAcls": err = unpopulate(val, "NetworkACLs", &v.NetworkACLs) delete(rawMsg, key) + case "protectionKeysWrappingKey": + err = unpopulate(val, "ProtectionKeysWrappingKey", &v.ProtectionKeysWrappingKey) + delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &v.PublicNetworkAccess) delete(rawMsg, key) @@ -3537,6 +3998,9 @@ func (v *VaultPatchProperties) UnmarshalJSON(data []byte) error { case "tenantId": err = unpopulate(val, "TenantID", &v.TenantID) delete(rawMsg, key) + case "tokenBindingParameters": + err = unpopulate(val, "TokenBindingParameters", &v.TokenBindingParameters) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %s", v, err.Error()) @@ -3550,6 +4014,7 @@ func (v VaultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "accessPolicies", v.AccessPolicies) populate(objectMap, "createMode", v.CreateMode) + populate(objectMap, "enableCrossTenantAccessProtection", v.EnableCrossTenantAccessProtection) populate(objectMap, "enablePurgeProtection", v.EnablePurgeProtection) populate(objectMap, "enableRbacAuthorization", v.EnableRbacAuthorization) populate(objectMap, "enableSoftDelete", v.EnableSoftDelete) @@ -3559,11 +4024,13 @@ func (v VaultProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "hsmPoolResourceId", v.HsmPoolResourceID) populate(objectMap, "networkAcls", v.NetworkACLs) populate(objectMap, "privateEndpointConnections", v.PrivateEndpointConnections) + populate(objectMap, "protectionKeysWrappingKey", v.ProtectionKeysWrappingKey) populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "publicNetworkAccess", v.PublicNetworkAccess) populate(objectMap, "sku", v.SKU) populate(objectMap, "softDeleteRetentionInDays", v.SoftDeleteRetentionInDays) populate(objectMap, "tenantId", v.TenantID) + populate(objectMap, "tokenBindingParameters", v.TokenBindingParameters) populate(objectMap, "vaultUri", v.VaultURI) return json.Marshal(objectMap) } @@ -3583,6 +4050,9 @@ func (v *VaultProperties) UnmarshalJSON(data []byte) error { case "createMode": err = unpopulate(val, "CreateMode", &v.CreateMode) delete(rawMsg, key) + case "enableCrossTenantAccessProtection": + err = unpopulate(val, "EnableCrossTenantAccessProtection", &v.EnableCrossTenantAccessProtection) + delete(rawMsg, key) case "enablePurgeProtection": err = unpopulate(val, "EnablePurgeProtection", &v.EnablePurgeProtection) delete(rawMsg, key) @@ -3610,6 +4080,9 @@ func (v *VaultProperties) UnmarshalJSON(data []byte) error { case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &v.PrivateEndpointConnections) delete(rawMsg, key) + case "protectionKeysWrappingKey": + err = unpopulate(val, "ProtectionKeysWrappingKey", &v.ProtectionKeysWrappingKey) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) delete(rawMsg, key) @@ -3625,6 +4098,9 @@ func (v *VaultProperties) UnmarshalJSON(data []byte) error { case "tenantId": err = unpopulate(val, "TenantID", &v.TenantID) delete(rawMsg, key) + case "tokenBindingParameters": + err = unpopulate(val, "TokenBindingParameters", &v.TokenBindingParameters) + delete(rawMsg, key) case "vaultUri": err = unpopulate(val, "VaultURI", &v.VaultURI) delete(rawMsg, key) @@ -3667,6 +4143,95 @@ func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WrappingKeyAuthenticationData. +func (w WrappingKeyAuthenticationData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["authType"] = "ServiceIdentity" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WrappingKeyAuthenticationData. +func (w *WrappingKeyAuthenticationData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "authType": + err = unpopulate(val, "AuthType", &w.AuthType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WrappingKeyConfiguration. +func (w WrappingKeyConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyAuthenticationData", w.KeyAuthenticationData) + populate(objectMap, "keyValue", w.KeyValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WrappingKeyConfiguration. +func (w *WrappingKeyConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyAuthenticationData": + err = unpopulate(val, "KeyAuthenticationData", &w.KeyAuthenticationData) + delete(rawMsg, key) + case "keyValue": + err = unpopulate(val, "KeyValue", &w.KeyValue) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WrappingKeyValue. +func (w WrappingKeyValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kty"] = "oct" + populate(objectMap, "url", w.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WrappingKeyValue. +func (w *WrappingKeyValue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) + } + for key, val := range rawMsg { + var err error + switch key { + case "kty": + err = unpopulate(val, "Kty", &w.Kty) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &w.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) + } + } + return nil +} + func populate(m map[string]any, k string, v any) { if v == nil { return diff --git a/sdk/resourcemanager/keyvault/armkeyvault/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/keyvault/armkeyvault/networksecurityperimeterconfigurations_client.go new file mode 100644 index 000000000000..7de77087b2a4 --- /dev/null +++ b/sdk/resourcemanager/keyvault/armkeyvault/networksecurityperimeterconfigurations_client.go @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armkeyvault + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkSecurityPerimeterConfigurationsClient - Operations for network security perimeter configurations associated with +// a key vault. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsClient() instead. +// +// Generated from API version 2026-10-01-preview +type NetworkSecurityPerimeterConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error) { + if subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// GetConfiguration - Gets the specified network security perimeter configuration for a key vault. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the key vault. +// - networkSecurityPerimeterConfigurationName - The name of the NetworkSecurityPerimeterConfiguration +// - options - NetworkSecurityPerimeterConfigurationsClientGetConfigurationOptions contains the optional parameters for the +// NetworkSecurityPerimeterConfigurationsClient.GetConfiguration method. +func (client *NetworkSecurityPerimeterConfigurationsClient) GetConfiguration(ctx context.Context, resourceGroupName string, vaultName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientGetConfigurationOptions) (NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.GetConfiguration" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getConfigurationCreateRequest(ctx, resourceGroupName, vaultName, networkSecurityPerimeterConfigurationName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse{}, err + } + resp, err := client.getConfigurationHandleResponse(httpResp, http.StatusOK) + return resp, err +} + +// getConfigurationCreateRequest creates the GetConfiguration request. +func (client *NetworkSecurityPerimeterConfigurationsClient) getConfigurationCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientGetConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + if networkSecurityPerimeterConfigurationName == "" { + return nil, errors.New("parameter networkSecurityPerimeterConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterConfigurationName}", url.PathEscape(networkSecurityPerimeterConfigurationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20261001Preview) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getConfigurationHandleResponse handles the GetConfiguration response. +func (client *NetworkSecurityPerimeterConfigurationsClient) getConfigurationHandleResponse(resp *http.Response, successCodes ...int) (NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfiguration); err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse{}, err + } + return result, nil +} + +// NewListConfigurationsPager - Lists the network security perimeter configurations associated with a key vault. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the key vault. +// - options - NetworkSecurityPerimeterConfigurationsClientListConfigurationsOptions contains the optional parameters for the +// NetworkSecurityPerimeterConfigurationsClient.NewListConfigurationsPager method. +func (client *NetworkSecurityPerimeterConfigurationsClient) NewListConfigurationsPager(resourceGroupName string, vaultName string, options *NetworkSecurityPerimeterConfigurationsClientListConfigurationsOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse]{ + More: func(page NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse) (NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "NetworkSecurityPerimeterConfigurationsClient.NewListConfigurationsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + req, err := client.listConfigurationsCreateRequest(ctx, resourceGroupName, vaultName, nextLink, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse{}, err + } + return client.listConfigurationsHandleResponse(resp, http.StatusOK) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listConfigurationsCreateRequest creates the ListConfigurations request. +func (client *NetworkSecurityPerimeterConfigurationsClient) listConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, nextLink string, _ *NetworkSecurityPerimeterConfigurationsClientListConfigurationsOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/networkSecurityPerimeterConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) + } + if err != nil { + return nil, err + } + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20261001Preview) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + } + return req, nil +} + +// listConfigurationsHandleResponse handles the ListConfigurations response. +func (client *NetworkSecurityPerimeterConfigurationsClient) listConfigurationsHandleResponse(resp *http.Response, successCodes ...int) (NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationListResult); err != nil { + return NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse{}, err + } + return result, nil +} + +// ReconcileConfiguration - Reconciles the specified network security perimeter configuration for a key vault. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the key vault. +// - networkSecurityPerimeterConfigurationName - The name of the NetworkSecurityPerimeterConfiguration +// - options - NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationOptions contains the optional parameters for +// the NetworkSecurityPerimeterConfigurationsClient.ReconcileConfiguration method. +func (client *NetworkSecurityPerimeterConfigurationsClient) ReconcileConfiguration(ctx context.Context, resourceGroupName string, vaultName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationOptions) (NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationResponse, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.ReconcileConfiguration" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.reconcileConfigurationCreateRequest(ctx, resourceGroupName, vaultName, networkSecurityPerimeterConfigurationName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationResponse{}, err + } + return NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationResponse{}, nil +} + +// reconcileConfigurationCreateRequest creates the ReconcileConfiguration request. +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileConfigurationCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile" + if client.subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + if networkSecurityPerimeterConfigurationName == "" { + return nil, errors.New("parameter networkSecurityPerimeterConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterConfigurationName}", url.PathEscape(networkSecurityPerimeterConfigurationName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20261001Preview) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + return req, nil +} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/networksecurityperimeterconfigurations_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/networksecurityperimeterconfigurations_client_example_test.go new file mode 100644 index 000000000000..fe7935f96b18 --- /dev/null +++ b/sdk/resourcemanager/keyvault/armkeyvault/networksecurityperimeterconfigurations_client_example_test.go @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armkeyvault_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault/v2" + "log" +) + +// Generated from example definition: 2026-10-01-preview/getNetworkSecurityPerimeterConfiguration.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_GetConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().GetConfiguration(ctx, "sample-resource-group", "sample-vault", "00000000-0000-0000-0000-000000000000.sampleAssociation", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse{ + // NetworkSecurityPerimeterConfiguration: armkeyvault.NetworkSecurityPerimeterConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault/networkSecurityPerimeterConfigurations/00000000-0000-0000-0000-000000000000.sampleAssociation"), + // Name: to.Ptr("00000000-0000-0000-0000-000000000000.sampleAssociation"), + // Type: to.Ptr("Microsoft.KeyVault/vaults/networkSecurityPerimeterConfigurations"), + // Properties: &armkeyvault.NetworkSecurityPerimeterConfigurationProperties{ + // ProvisioningState: to.Ptr(armkeyvault.NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded), + // NetworkSecurityPerimeter: &armkeyvault.NetworkSecurityPerimeter{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.Network/networkSecurityPerimeters/sampleNsp"), + // PerimeterGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Location: to.Ptr("centraluseuap"), + // }, + // ResourceAssociation: &armkeyvault.ResourceAssociation{ + // Name: to.Ptr("sampleAssociation"), + // AccessMode: to.Ptr(armkeyvault.ResourceAssociationAccessModeLearning), + // }, + // Profile: &armkeyvault.NetworkSecurityProfile{ + // Name: to.Ptr("defaultprofile"), + // AccessRulesVersion: to.Ptr[int32](1), + // AccessRules: []*armkeyvault.AccessRule{ + // { + // Name: to.Ptr("sampleRule"), + // Properties: &armkeyvault.AccessRuleProperties{ + // Direction: to.Ptr(armkeyvault.AccessRuleDirectionInbound), + // AddressPrefixes: []*string{ + // to.Ptr("192.0.2.0/24"), + // }, + // Subscriptions: []*armkeyvault.AccessRulePropertiesSubscription{ + // }, + // FullyQualifiedDomainNames: []*string{ + // }, + // }, + // }, + // }, + // DiagnosticSettingsVersion: to.Ptr[int32](0), + // EnabledLogCategories: []*string{ + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/listNetworkSecurityPerimeterConfigurations.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_NewListConfigurationsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().NewListConfigurationsPager("sample-resource-group", "sample-vault", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armkeyvault.NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse{ + // NetworkSecurityPerimeterConfigurationListResult: armkeyvault.NetworkSecurityPerimeterConfigurationListResult{ + // Value: []*armkeyvault.NetworkSecurityPerimeterConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault/networkSecurityPerimeterConfigurations/00000000-0000-0000-0000-000000000000.sampleAssociation"), + // Name: to.Ptr("00000000-0000-0000-0000-000000000000.sampleAssociation"), + // Type: to.Ptr("Microsoft.KeyVault/vaults/networkSecurityPerimeterConfigurations"), + // Properties: &armkeyvault.NetworkSecurityPerimeterConfigurationProperties{ + // ProvisioningState: to.Ptr(armkeyvault.NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded), + // NetworkSecurityPerimeter: &armkeyvault.NetworkSecurityPerimeter{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.Network/networkSecurityPerimeters/sampleNsp"), + // PerimeterGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Location: to.Ptr("centraluseuap"), + // }, + // ResourceAssociation: &armkeyvault.ResourceAssociation{ + // Name: to.Ptr("sampleAssociation"), + // AccessMode: to.Ptr(armkeyvault.ResourceAssociationAccessModeLearning), + // }, + // Profile: &armkeyvault.NetworkSecurityProfile{ + // Name: to.Ptr("defaultprofile"), + // AccessRulesVersion: to.Ptr[int32](1), + // AccessRules: []*armkeyvault.AccessRule{ + // { + // Name: to.Ptr("sampleRule"), + // Properties: &armkeyvault.AccessRuleProperties{ + // Direction: to.Ptr(armkeyvault.AccessRuleDirectionInbound), + // AddressPrefixes: []*string{ + // to.Ptr("192.0.2.0/24"), + // }, + // Subscriptions: []*armkeyvault.AccessRulePropertiesSubscription{ + // }, + // FullyQualifiedDomainNames: []*string{ + // }, + // }, + // }, + // }, + // DiagnosticSettingsVersion: to.Ptr[int32](0), + // EnabledLogCategories: []*string{ + // }, + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2026-10-01-preview/reconcileNetworkSecurityPerimeter.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_ReconcileConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().ReconcileConfiguration(ctx, "sample-resource-group", "sample-vault", "00000000-0000-0000-0000-000000000000.sampleAssociation", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/operations_client.go b/sdk/resourcemanager/keyvault/armkeyvault/operations_client.go index 042f6a400b54..bc01d42fa85a 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/operations_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/operations_client.go @@ -17,7 +17,7 @@ import ( // OperationsClient contains the methods for the Operations group. // Don't use this type directly, use NewOperationsClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type OperationsClient struct { internal *arm.Client } @@ -79,7 +79,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, nextLink } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } diff --git a/sdk/resourcemanager/keyvault/armkeyvault/operations_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/operations_client_example_test.go index f905da099804..32e168a5882f 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/operations_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/operations_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/listOperations.json +// Generated from example definition: 2026-10-01-preview/listOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/options.go b/sdk/resourcemanager/keyvault/armkeyvault/options.go index 3c58180a9eb8..6f6cb1d20397 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/options.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/options.go @@ -154,6 +154,24 @@ type ManagedHsmsClientListDeletedOptions struct { // placeholder for future optional parameters } +// NetworkSecurityPerimeterConfigurationsClientGetConfigurationOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.GetConfiguration +// method. +type NetworkSecurityPerimeterConfigurationsClientGetConfigurationOptions struct { + // placeholder for future optional parameters +} + +// NetworkSecurityPerimeterConfigurationsClientListConfigurationsOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListConfigurationsPager +// method. +type NetworkSecurityPerimeterConfigurationsClientListConfigurationsOptions struct { + // placeholder for future optional parameters +} + +// NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.ReconcileConfiguration +// method. +type NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client.go b/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client.go index 0aae8cdcf5a7..f756e781a479 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client.go @@ -20,7 +20,7 @@ import ( // PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. // Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type PrivateEndpointConnectionsClient struct { internal *arm.Client subscriptionID string @@ -116,7 +116,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *PrivateEndpointConnectionsClient) listByResourceCreateRequest(ctx } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -317,7 +317,7 @@ func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client_example_test.go index eefe8737f37d..bd6723bd7ced 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client_example_test.go @@ -13,7 +13,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/deletePrivateEndpointConnection.json +// Generated from example definition: 2026-10-01-preview/deletePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -47,7 +47,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { // } } -// Generated from example definition: 2026-05-15/getPrivateEndpointConnection.json +// Generated from example definition: 2026-10-01-preview/getPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,7 +86,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: 2026-05-15/listPrivateEndpointConnection.json +// Generated from example definition: 2026-10-01-preview/listPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_NewListByResourcePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -151,7 +151,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListByResourcePager() { } } -// Generated from example definition: 2026-05-15/putPrivateEndpointConnection.json +// Generated from example definition: 2026-10-01-preview/putPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Put() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client.go b/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client.go index b504bcae8090..5d078b5d653d 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client.go @@ -19,7 +19,7 @@ import ( // PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. // Don't use this type directly, use NewPrivateLinkResourcesClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type PrivateLinkResourcesClient struct { internal *arm.Client subscriptionID string @@ -88,7 +88,7 @@ func (client *PrivateLinkResourcesClient) listByVaultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client_example_test.go index dd18172ebac6..66f4c0428005 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/listPrivateLinkResources.json +// Generated from example definition: 2026-10-01-preview/listPrivateLinkResources.json func ExamplePrivateLinkResourcesClient_ListByVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/responses.go b/sdk/resourcemanager/keyvault/armkeyvault/responses.go index 7c0f981a6ac2..4b91a481642d 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/responses.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/responses.go @@ -165,6 +165,23 @@ type ManagedHsmsClientUpdateResponse struct { ManagedHsm } +// NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.GetConfiguration. +type NetworkSecurityPerimeterConfigurationsClientGetConfigurationResponse struct { + // Network security perimeter (NSP) configuration resource + NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.NewListConfigurationsPager. +type NetworkSecurityPerimeterConfigurationsClientListConfigurationsResponse struct { + // Result of a list NSP (network security perimeter) configurations request. + NetworkSecurityPerimeterConfigurationListResult +} + +// NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.ReconcileConfiguration. +type NetworkSecurityPerimeterConfigurationsClientReconcileConfigurationResponse struct { + // placeholder for future response values +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set of diff --git a/sdk/resourcemanager/keyvault/armkeyvault/secrets_client.go b/sdk/resourcemanager/keyvault/armkeyvault/secrets_client.go index d949b9b2c8b3..69a94229faef 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/secrets_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/secrets_client.go @@ -20,7 +20,7 @@ import ( // SecretsClient contains the methods for the Secrets group. // Don't use this type directly, use NewSecretsClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type SecretsClient struct { internal *arm.Client subscriptionID string @@ -95,7 +95,7 @@ func (client *SecretsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -166,7 +166,7 @@ func (client *SecretsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,7 +245,7 @@ func (client *SecretsClient) listCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -314,7 +314,7 @@ func (client *SecretsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/secrets_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/secrets_client_example_test.go index c3c2a6d66010..bdaecc83c08f 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/secrets_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/secrets_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/createSecret.json +// Generated from example definition: 2026-10-01-preview/createSecret.json func ExampleSecretsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -53,7 +53,7 @@ func ExampleSecretsClient_CreateOrUpdate() { // } } -// Generated from example definition: 2026-05-15/getSecret.json +// Generated from example definition: 2026-10-01-preview/getSecret.json func ExampleSecretsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleSecretsClient_Get() { // } } -// Generated from example definition: 2026-05-15/listSecrets.json +// Generated from example definition: 2026-10-01-preview/listSecrets.json func ExampleSecretsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -151,7 +151,7 @@ func ExampleSecretsClient_NewListPager() { } } -// Generated from example definition: 2026-05-15/updateSecret.json +// Generated from example definition: 2026-10-01-preview/updateSecret.json func ExampleSecretsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/testdata/_metadata.json b/sdk/resourcemanager/keyvault/armkeyvault/testdata/_metadata.json index dddfd3b168e8..950c94b7a444 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/testdata/_metadata.json +++ b/sdk/resourcemanager/keyvault/armkeyvault/testdata/_metadata.json @@ -1,6 +1,6 @@ { "apiVersions": { - "Microsoft.KeyVault": "2026-05-15" + "Microsoft.KeyVault": "2026-10-01-preview" }, "emitterVersion": "0.18.0" } diff --git a/sdk/resourcemanager/keyvault/armkeyvault/tsp-location.yaml b/sdk/resourcemanager/keyvault/armkeyvault/tsp-location.yaml index 0edbe5696994..6638845906d1 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/tsp-location.yaml +++ b/sdk/resourcemanager/keyvault/armkeyvault/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/keyvault/resource-manager/Microsoft.KeyVault/KeyVault -commit: 3d13a66faf3cdca3fc4178de005faab79c7bcdad +commit: 67d7ae2c7878c896d0ddb588e45bd90726ea2044 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/resourcemanager/keyvault/armkeyvault/vaults_client.go b/sdk/resourcemanager/keyvault/armkeyvault/vaults_client.go index f81ecc578646..5bcf0e5b9c58 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/vaults_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/vaults_client.go @@ -20,7 +20,7 @@ import ( // VaultsClient contains the methods for the Vaults group. // Don't use this type directly, use NewVaultsClient() instead. // -// Generated from API version 2026-05-15 +// Generated from API version 2026-10-01-preview type VaultsClient struct { internal *arm.Client subscriptionID string @@ -112,7 +112,7 @@ func (client *VaultsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -186,7 +186,7 @@ func (client *VaultsClient) purgeDeletedCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } @@ -226,7 +226,7 @@ func (client *VaultsClient) checkNameAvailabilityCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -294,7 +294,7 @@ func (client *VaultsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } @@ -342,7 +342,7 @@ func (client *VaultsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -401,7 +401,7 @@ func (client *VaultsClient) getDeletedCreateRequest(ctx context.Context, vaultNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -476,7 +476,7 @@ func (client *VaultsClient) listByResourceGroupCreateRequest(ctx context.Context if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -546,7 +546,7 @@ func (client *VaultsClient) listBySubscriptionCreateRequest(ctx context.Context, if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -612,7 +612,7 @@ func (client *VaultsClient) listDeletedCreateRequest(ctx context.Context, nextLi } if firstPage { reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} } @@ -745,7 +745,7 @@ func (client *VaultsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -817,7 +817,7 @@ func (client *VaultsClient) updateAccessPolicyCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", version20260515) + reqQP.Set("api-version", version20261001Preview) req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/vaults_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/vaults_client_example_test.go index b813dea578a5..261996143519 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/vaults_client_example_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/vaults_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2026-05-15/createVault.json +// Generated from example definition: 2026-10-01-preview/createVault.json func ExampleVaultsClient_BeginCreateOrUpdate_createANewVaultOrUpdateAnExistingVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -216,7 +216,133 @@ func ExampleVaultsClient_BeginCreateOrUpdate_createANewVaultOrUpdateAnExistingVa // } } -// Generated from example definition: 2026-05-15/createVaultWithNetworkAcls.json +// Generated from example definition: 2026-10-01-preview/createVaultWithCrossTenantAccessProtection.json +func ExampleVaultsClient_BeginCreateOrUpdate_createAVaultWithCrossTenantAccessProtectionEnabled() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultCreateOrUpdateParameters{ + Location: to.Ptr("westus"), + Properties: &armkeyvault.VaultProperties{ + EnableCrossTenantAccessProtection: to.Ptr(true), + EnableRbacAuthorization: to.Ptr(true), + SKU: &armkeyvault.SKU{ + Name: to.Ptr(armkeyvault.SKUNameStandard), + Family: to.Ptr(armkeyvault.SKUFamilyA), + }, + TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientCreateOrUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Properties: &armkeyvault.VaultProperties{ + // EnableCrossTenantAccessProtection: to.Ptr(true), + // EnableRbacAuthorization: to.Ptr(true), + // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/createVaultWithIdentity.json +func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateAVaultByFullyReplacingTheUserAssignedIdentitySet() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultCreateOrUpdateParameters{ + Location: to.Ptr("westus"), + Identity: &armkeyvault.ManagedServiceIdentity{ + Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armkeyvault.UserAssignedIdentity{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sample-identity": {}, + }, + }, + Properties: &armkeyvault.VaultProperties{ + AccessPolicies: []*armkeyvault.AccessPolicyEntry{}, + EnableRbacAuthorization: to.Ptr(true), + SKU: &armkeyvault.SKU{ + Name: to.Ptr(armkeyvault.SKUNameStandard), + Family: to.Ptr(armkeyvault.SKUFamilyA), + }, + TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientCreateOrUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Identity: &armkeyvault.ManagedServiceIdentity{ + // Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armkeyvault.UserAssignedIdentity{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sample-identity": &armkeyvault.UserAssignedIdentity{ + // PrincipalID: to.Ptr("11111111-1111-1111-1111-111111111111"), + // ClientID: to.Ptr("22222222-2222-2222-2222-222222222222"), + // }, + // }, + // }, + // Properties: &armkeyvault.VaultProperties{ + // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ + // }, + // EnableRbacAuthorization: to.Ptr(true), + // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/createVaultWithNetworkAcls.json func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateAVaultWithNetworkAcls() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -316,7 +442,138 @@ func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateAVaultWithNetworkAcls // } } -// Generated from example definition: 2026-05-15/purgeDeletedVault.json +// Generated from example definition: 2026-10-01-preview/createVaultWithProtectionKeyWrapping.json +func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateAVaultWithProtectionKeyWrapping() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultCreateOrUpdateParameters{ + Location: to.Ptr("westus"), + Properties: &armkeyvault.VaultProperties{ + AccessPolicies: []*armkeyvault.AccessPolicyEntry{}, + ProtectionKeysWrappingKey: &armkeyvault.WrappingKeyConfiguration{ + KeyValue: &armkeyvault.WrappingKeyValue{ + URL: to.Ptr("https://sample-hsm.managedhsm.azure.net/keys/wrapping-key"), + Kty: to.Ptr("oct"), + }, + KeyAuthenticationData: &armkeyvault.WrappingKeyAuthenticationData{ + AuthType: to.Ptr("ServiceIdentity"), + }, + }, + SKU: &armkeyvault.SKU{ + Name: to.Ptr(armkeyvault.SKUNameStandard), + Family: to.Ptr(armkeyvault.SKUFamilyA), + }, + TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientCreateOrUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Properties: &armkeyvault.VaultProperties{ + // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ + // }, + // ProtectionKeysWrappingKey: &armkeyvault.WrappingKeyConfiguration{ + // KeyValue: &armkeyvault.WrappingKeyValue{ + // URL: to.Ptr("https://sample-hsm.managedhsm.azure.net/keys/wrapping-key/0123456789abcdef0123456789abcdef"), + // Kty: to.Ptr("oct"), + // }, + // KeyAuthenticationData: &armkeyvault.WrappingKeyAuthenticationData{ + // AuthType: to.Ptr("ServiceIdentity"), + // }, + // }, + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/createVaultWithoutIdentity.json +func ExampleVaultsClient_BeginCreateOrUpdate_removeAllUserAssignedIdentitiesAndTheirCertificatesFromAVaultUsingPut() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultCreateOrUpdateParameters{ + Location: to.Ptr("westus"), + Identity: &armkeyvault.ManagedServiceIdentity{ + Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeNone), + }, + Properties: &armkeyvault.VaultProperties{ + AccessPolicies: []*armkeyvault.AccessPolicyEntry{}, + EnableRbacAuthorization: to.Ptr(true), + SKU: &armkeyvault.SKU{ + Name: to.Ptr(armkeyvault.SKUNameStandard), + Family: to.Ptr(armkeyvault.SKUFamilyA), + }, + TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientCreateOrUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Identity: &armkeyvault.ManagedServiceIdentity{ + // Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeNone), + // }, + // Properties: &armkeyvault.VaultProperties{ + // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ + // }, + // EnableRbacAuthorization: to.Ptr(true), + // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/purgeDeletedVault.json func ExampleVaultsClient_BeginPurgeDeleted() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -342,7 +599,7 @@ func ExampleVaultsClient_BeginPurgeDeleted() { // } } -// Generated from example definition: 2026-05-15/checkVaultNameAvailability.json +// Generated from example definition: 2026-10-01-preview/checkVaultNameAvailability.json func ExampleVaultsClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -370,7 +627,7 @@ func ExampleVaultsClient_CheckNameAvailability() { // } } -// Generated from example definition: 2026-05-15/deleteVault.json +// Generated from example definition: 2026-10-01-preview/deleteVault.json func ExampleVaultsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -392,7 +649,7 @@ func ExampleVaultsClient_Delete() { // } } -// Generated from example definition: 2026-05-15/getVault.json +// Generated from example definition: 2026-10-01-preview/getVault.json func ExampleVaultsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -496,7 +753,7 @@ func ExampleVaultsClient_Get() { // } } -// Generated from example definition: 2026-05-15/getDeletedVault.json +// Generated from example definition: 2026-10-01-preview/getDeletedVault.json func ExampleVaultsClient_GetDeleted() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -532,7 +789,7 @@ func ExampleVaultsClient_GetDeleted() { // } } -// Generated from example definition: 2026-05-15/listVaultByResourceGroup.json +// Generated from example definition: 2026-10-01-preview/listVaultByResourceGroup.json func ExampleVaultsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -647,7 +904,7 @@ func ExampleVaultsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: 2026-05-15/listVaultBySubscription.json +// Generated from example definition: 2026-10-01-preview/listVaultBySubscription.json func ExampleVaultsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -762,7 +1019,7 @@ func ExampleVaultsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: 2026-05-15/listDeletedVaults.json +// Generated from example definition: 2026-10-01-preview/listDeletedVaults.json func ExampleVaultsClient_NewListDeletedPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -808,7 +1065,7 @@ func ExampleVaultsClient_NewListDeletedPager() { } } -// Generated from example definition: 2026-05-15/listVault.json +// Generated from example definition: 2026-10-01-preview/listVault.json func ExampleVaultsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -849,8 +1106,55 @@ func ExampleVaultsClient_NewListPager() { } } -// Generated from example definition: 2026-05-15/updateVault.json -func ExampleVaultsClient_Update() { +// Generated from example definition: 2026-10-01-preview/removeVaultWithIdentity.json +func ExampleVaultsClient_Update_removeAllUserAssignedIdentitiesAndTheirCertificatesFromAVaultUsingPatch() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVaultsClient().Update(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultPatchParameters{ + Identity: &armkeyvault.ManagedServiceIdentity{ + Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeNone), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Identity: &armkeyvault.ManagedServiceIdentity{ + // Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeNone), + // }, + // Properties: &armkeyvault.VaultProperties{ + // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ + // }, + // EnableRbacAuthorization: to.Ptr(true), + // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/updateVault.json +func ExampleVaultsClient_Update_updateAnExistingVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1047,7 +1351,281 @@ func ExampleVaultsClient_Update() { // } } -// Generated from example definition: 2026-05-15/updateAccessPoliciesAdd.json +// Generated from example definition: 2026-10-01-preview/updateVaultPreservingIdentity.json +func ExampleVaultsClient_Update_preserveExistingUserAssignedIdentitiesByOmittingIdentityFromPatch() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVaultsClient().Update(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultPatchParameters{ + Tags: map[string]*string{ + "environment": to.Ptr("production"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Identity: &armkeyvault.ManagedServiceIdentity{ + // Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armkeyvault.UserAssignedIdentity{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sample-identity": &armkeyvault.UserAssignedIdentity{ + // PrincipalID: to.Ptr("11111111-1111-1111-1111-111111111111"), + // ClientID: to.Ptr("22222222-2222-2222-2222-222222222222"), + // }, + // }, + // }, + // Properties: &armkeyvault.VaultProperties{ + // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ + // }, + // EnableRbacAuthorization: to.Ptr(true), + // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // Tags: map[string]*string{ + // "environment": to.Ptr("production"), + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/updateVaultRemoveIdentity.json +func ExampleVaultsClient_Update_removeOnlyTheSpecifiedUserAssignedIdentityUsingANullPatchEntry() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVaultsClient().Update(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultPatchParameters{ + Identity: &armkeyvault.ManagedServiceIdentity{ + Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armkeyvault.UserAssignedIdentity{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-to-remove": nil, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Identity: &armkeyvault.ManagedServiceIdentity{ + // Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armkeyvault.UserAssignedIdentity{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sample-identity": &armkeyvault.UserAssignedIdentity{ + // PrincipalID: to.Ptr("11111111-1111-1111-1111-111111111111"), + // ClientID: to.Ptr("22222222-2222-2222-2222-222222222222"), + // }, + // }, + // }, + // Properties: &armkeyvault.VaultProperties{ + // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ + // }, + // EnableRbacAuthorization: to.Ptr(true), + // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/updateVaultWithCrossTenantAccessProtection.json +func ExampleVaultsClient_Update_enableCrossTenantAccessProtectionOnAnExistingVault() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVaultsClient().Update(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultPatchParameters{ + Properties: &armkeyvault.VaultPatchProperties{ + EnableCrossTenantAccessProtection: to.Ptr(true), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Properties: &armkeyvault.VaultProperties{ + // EnableCrossTenantAccessProtection: to.Ptr(true), + // EnableRbacAuthorization: to.Ptr(true), + // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/updateVaultWithIdentity.json +func ExampleVaultsClient_Update_addOrRetainAUserAssignedIdentityOnAVault() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVaultsClient().Update(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultPatchParameters{ + Identity: &armkeyvault.ManagedServiceIdentity{ + Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armkeyvault.UserAssignedIdentity{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sample-identity": {}, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Identity: &armkeyvault.ManagedServiceIdentity{ + // Type: to.Ptr(armkeyvault.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armkeyvault.UserAssignedIdentity{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sample-identity": &armkeyvault.UserAssignedIdentity{ + // PrincipalID: to.Ptr("11111111-1111-1111-1111-111111111111"), + // ClientID: to.Ptr("22222222-2222-2222-2222-222222222222"), + // }, + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/retained-identity": &armkeyvault.UserAssignedIdentity{ + // PrincipalID: to.Ptr("33333333-3333-3333-3333-333333333333"), + // ClientID: to.Ptr("44444444-4444-4444-4444-444444444444"), + // }, + // }, + // }, + // Properties: &armkeyvault.VaultProperties{ + // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ + // }, + // EnableRbacAuthorization: to.Ptr(true), + // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/updateVaultWithProtectionKeyWrapping.json +func ExampleVaultsClient_Update_configureProtectionKeyWrappingOnAnExistingVault() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armkeyvault.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVaultsClient().Update(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultPatchParameters{ + Properties: &armkeyvault.VaultPatchProperties{ + ProtectionKeysWrappingKey: &armkeyvault.WrappingKeyConfiguration{ + KeyValue: &armkeyvault.WrappingKeyValue{ + URL: to.Ptr("https://sample-hsm.managedhsm.azure.net/keys/wrapping-key"), + Kty: to.Ptr("oct"), + }, + KeyAuthenticationData: &armkeyvault.WrappingKeyAuthenticationData{ + AuthType: to.Ptr("ServiceIdentity"), + }, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armkeyvault.VaultsClientUpdateResponse{ + // Vault: armkeyvault.Vault{ + // Name: to.Ptr("sample-vault"), + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), + // Location: to.Ptr("westus"), + // Properties: &armkeyvault.VaultProperties{ + // ProtectionKeysWrappingKey: &armkeyvault.WrappingKeyConfiguration{ + // KeyValue: &armkeyvault.WrappingKeyValue{ + // URL: to.Ptr("https://sample-hsm.managedhsm.azure.net/keys/wrapping-key/0123456789abcdef0123456789abcdef"), + // Kty: to.Ptr("oct"), + // }, + // KeyAuthenticationData: &armkeyvault.WrappingKeyAuthenticationData{ + // AuthType: to.Ptr("ServiceIdentity"), + // }, + // }, + // SKU: &armkeyvault.SKU{ + // Name: to.Ptr(armkeyvault.SKUNameStandard), + // Family: to.Ptr(armkeyvault.SKUFamilyA), + // }, + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), + // }, + // }, + // } +} + +// Generated from example definition: 2026-10-01-preview/updateAccessPoliciesAdd.json func ExampleVaultsClient_UpdateAccessPolicy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/version.go b/sdk/resourcemanager/keyvault/armkeyvault/version.go index f6446b9440f5..c6231bddd92e 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/version.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/version.go @@ -6,5 +6,5 @@ package armkeyvault const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" - moduleVersion = "v2.1.0" + moduleVersion = "v2.2.0-beta.1" )