diff --git a/sdk/storage/azure-storage-file-share/CHANGELOG.md b/sdk/storage/azure-storage-file-share/CHANGELOG.md index c23a0628c041b..7d314d9e8466b 100644 --- a/sdk/storage/azure-storage-file-share/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-share/CHANGELOG.md @@ -3,6 +3,11 @@ ## 12.33.0-beta.1 (Unreleased) ### Features Added +- Added support for change feed on premium file shares. Added `ShareCreateOptions.setChangeFeedEnabled`, + `setChangeFeedRetentionInDays` and `ShareSetPropertiesOptions.setChangeFeedEnabled`, + `setChangeFeedRetentionInDays` to enable and configure change feed. +- Added `ShareProperties.isChangeFeedEnabled()`, `getChangeFeedRetentionInDays()` and + `getChangeFeedBlobContainerName()`. - Added `ShareProperties.getCreationTime()` and `ShareProperties.setCreationTime(OffsetDateTime)` to expose the share creation time returned in list and get properties responses. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java index 4f9c29bc7d9ca..1900beac97b1b 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java @@ -371,7 +371,8 @@ Mono> createWithResponse(ShareCreateOptions options, Context options.getAccessTier(), enabledProtocol, options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, context) + options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, + options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), context) .map(ModelHelper::mapToShareInfoResponse); } @@ -940,7 +941,8 @@ Mono> setPropertiesWithResponse(ShareSetPropertiesOptions op options.getAccessTier(), requestConditions.getLeaseId(), options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, context) + options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, + options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), context) .map(ModelHelper::mapToShareInfoResponse); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java index 5eddfa88edf7b..ad7b672c3d7b5 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java @@ -369,7 +369,7 @@ public Response createWithResponse(ShareCreateOptions options, Durati finalOptions.isSnapshotVirtualDirectoryAccessEnabled(), finalOptions.isPaidBurstingEnabled(), finalOptions.getPaidBurstingMaxBandwidthMibps(), finalOptions.getPaidBurstingMaxIops(), finalOptions.getProvisionedMaxIops(), finalOptions.getProvisionedMaxBandwidthMibps(), null, - finalContext); + finalOptions.isChangeFeedEnabled(), finalOptions.getChangeFeedRetentionInDays(), finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -899,7 +899,8 @@ public Response setPropertiesWithResponse(ShareSetPropertiesOptions o requestConditions.getLeaseId(), options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, finalContext); + options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, + options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java index 1ce207620adcf..bfe9dda7e96b0 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java @@ -104,6 +104,8 @@ Mono> create(@HostParam("url") String ur @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -123,6 +125,8 @@ Mono> createNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -142,6 +146,8 @@ ResponseBase createSync(@HostParam("url") String url, @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -161,6 +167,8 @@ Response createNoCustomHeadersSync(@HostParam("url") String url, @PathPara @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Get("/{shareName}") @@ -635,6 +643,8 @@ Mono> setProperties(@HostParam("u @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -654,6 +664,8 @@ Mono> setPropertiesNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -673,6 +685,8 @@ ResponseBase setPropertiesSync(@HostParam("url @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -692,6 +706,8 @@ Response setPropertiesNoCustomHeadersSync(@HostParam("url") String url, @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -943,6 +959,10 @@ Response restoreNoCustomHeadersSync(@HostParam("url") String url, * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -953,12 +973,12 @@ public Mono> createWithResponseAsync(Str Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { - return FluxUtil - .withContext(context -> createWithResponseAsync(shareName, timeout, metadata, quota, accessTier, - enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context)) + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays) { + return FluxUtil.withContext(context -> createWithResponseAsync(shareName, timeout, metadata, quota, accessTier, + enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, + paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -992,6 +1012,10 @@ public Mono> createWithResponseAsync(Str * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1003,13 +1027,16 @@ public Mono> createWithResponseAsync(Str Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.create(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, - this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) + return service + .create(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, + this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -1043,6 +1070,10 @@ public Mono> createWithResponseAsync(Str * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1053,10 +1084,11 @@ public Mono createAsync(String shareName, Integer timeout, Map Mono.empty()); } @@ -1091,6 +1123,10 @@ public Mono createAsync(String shareName, Integer timeout, Map createAsync(String shareName, Integer timeout, Map Mono.empty()); } @@ -1140,6 +1178,10 @@ public Mono createAsync(String shareName, Integer timeout, Map> createNoCustomHeadersWithResponseAsync(String shareN Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { - return FluxUtil - .withContext(context -> createNoCustomHeadersWithResponseAsync(shareName, timeout, metadata, quota, - accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context)) + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays) { + return FluxUtil.withContext(context -> createNoCustomHeadersWithResponseAsync(shareName, timeout, metadata, + quota, accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, + paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -1189,6 +1231,10 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1200,13 +1246,16 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.createNoCustomHeaders(this.client.getUrl(), shareName, restype, timeout, metadata, quota, - accessTier, this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) + return service + .createNoCustomHeaders(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, + this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -1240,6 +1289,10 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1251,7 +1304,8 @@ public ResponseBase createWithResponse(String shareNa Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays, Context context) { try { final String restype = "share"; final String accept = "application/xml"; @@ -1259,7 +1313,7 @@ public ResponseBase createWithResponse(String shareNa this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, accept, context); + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -1295,6 +1349,10 @@ public ResponseBase createWithResponse(String shareNa * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1304,11 +1362,11 @@ public void create(String shareName, Integer timeout, Map metada ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { createWithResponse(shareName, timeout, metadata, quota, accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, - Context.NONE); + fileEnableChangeFeed, fileChangeFeedRetentionInDays, Context.NONE); } /** @@ -1341,6 +1399,10 @@ public void create(String shareName, Integer timeout, Map metada * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1352,7 +1414,8 @@ public Response createNoCustomHeadersWithResponse(String shareName, Intege Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays, Context context) { try { final String restype = "share"; final String accept = "application/xml"; @@ -1360,7 +1423,8 @@ public Response createNoCustomHeadersWithResponse(String shareName, Intege accessTier, this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context); + shareProvisionedBandwidthMibps, enableSmbDirectoryLease, fileEnableChangeFeed, + fileChangeFeedRetentionInDays, accept, context); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -4012,6 +4076,10 @@ public Response getPermissionNoCustomHeadersWithResponse(String * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4022,11 +4090,12 @@ public Mono> setPropertiesWithRes Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { - return FluxUtil.withContext(context -> setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, - leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, context)) + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { + return FluxUtil + .withContext(context -> setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, + rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, + paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, + fileEnableChangeFeed, fileChangeFeedRetentionInDays, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -4058,6 +4127,10 @@ public Mono> setPropertiesWithRes * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4069,7 +4142,8 @@ public Mono> setPropertiesWithRes Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, + Context context) { final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; @@ -4077,7 +4151,8 @@ public Mono> setPropertiesWithRes .setProperties(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) + shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, fileEnableChangeFeed, + fileChangeFeedRetentionInDays, accept, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -4109,6 +4184,10 @@ public Mono> setPropertiesWithRes * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4118,10 +4197,12 @@ public Mono> setPropertiesWithRes public Mono setPropertiesAsync(String shareName, Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, - Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { + Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, + Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { return setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease) + paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, + fileEnableChangeFeed, fileChangeFeedRetentionInDays) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } @@ -4154,6 +4235,10 @@ public Mono setPropertiesAsync(String shareName, Integer timeout, Integer * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4165,10 +4250,11 @@ public Mono setPropertiesAsync(String shareName, Integer timeout, Integer String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, - Context context) { + Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, Context context) { return setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context) + paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, + fileEnableChangeFeed, fileChangeFeedRetentionInDays, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } @@ -4201,6 +4287,10 @@ public Mono setPropertiesAsync(String shareName, Integer timeout, Integer * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4211,12 +4301,11 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { - return FluxUtil - .withContext(context -> setPropertiesNoCustomHeadersWithResponseAsync(shareName, timeout, quota, accessTier, - leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context)) + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { + return FluxUtil.withContext(context -> setPropertiesNoCustomHeadersWithResponseAsync(shareName, timeout, quota, + accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, + paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -4248,6 +4337,10 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4259,14 +4352,17 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, + Context context) { final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) + return service + .setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -4298,6 +4394,10 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4309,7 +4409,8 @@ public ResponseBase setPropertiesWithResponse( Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, + Context context) { try { final String restype = "share"; final String comp = "properties"; @@ -4318,7 +4419,7 @@ public ResponseBase setPropertiesWithResponse( this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, accept, context); + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -4352,6 +4453,10 @@ public ResponseBase setPropertiesWithResponse( * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4360,11 +4465,12 @@ public ResponseBase setPropertiesWithResponse( public void setProperties(String shareName, Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, - Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { + Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, + Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { setPropertiesWithResponse(shareName, timeout, quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, - Context.NONE); + fileEnableChangeFeed, fileChangeFeedRetentionInDays, Context.NONE); } /** @@ -4395,6 +4501,10 @@ public void setProperties(String shareName, Integer timeout, Integer quota, Shar * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be * blocked. + * @param fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4406,7 +4516,8 @@ public Response setPropertiesNoCustomHeadersWithResponse(String shareName, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, + Context context) { try { final String restype = "share"; final String comp = "properties"; @@ -4415,7 +4526,7 @@ public Response setPropertiesNoCustomHeadersWithResponse(String shareName, this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, accept, context); + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java index 170908e40472c..d3a125b15c07b 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java @@ -202,6 +202,24 @@ public final class SharesGetPropertiesHeaders { @Generated private Boolean xMsEnableSmbDirectoryLease; + /* + * The x-ms-file-blob-container-for-xfiles-change-feed property. + */ + @Generated + private String xMsFileBlobContainerForXfilesChangeFeed; + + /* + * The x-ms-file-change-feed-retention-in-days property. + */ + @Generated + private Integer xMsFileChangeFeedRetentionInDays; + + /* + * The x-ms-file-enable-change-feed property. + */ + @Generated + private Boolean xMsFileEnableChangeFeed; + private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); private static final HttpHeaderName X_MS_SHARE_QUOTA = HttpHeaderName.fromString("x-ms-share-quota"); @@ -269,6 +287,15 @@ public final class SharesGetPropertiesHeaders { private static final HttpHeaderName X_MS_ENABLE_SMB_DIRECTORY_LEASE = HttpHeaderName.fromString("x-ms-enable-smb-directory-lease"); + private static final HttpHeaderName X_MS_FILE_BLOB_CONTAINER_FOR_XFILES_CHANGE_FEED + = HttpHeaderName.fromString("x-ms-file-blob-container-for-xfiles-change-feed"); + + private static final HttpHeaderName X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS + = HttpHeaderName.fromString("x-ms-file-change-feed-retention-in-days"); + + private static final HttpHeaderName X_MS_FILE_ENABLE_CHANGE_FEED + = HttpHeaderName.fromString("x-ms-file-enable-change-feed"); + // HttpHeaders containing the raw property values. /** * Creates an instance of SharesGetPropertiesHeaders class. @@ -428,6 +455,20 @@ public SharesGetPropertiesHeaders(HttpHeaders rawHeaders) { } else { this.xMsEnableSmbDirectoryLease = null; } + this.xMsFileBlobContainerForXfilesChangeFeed + = rawHeaders.getValue(X_MS_FILE_BLOB_CONTAINER_FOR_XFILES_CHANGE_FEED); + String xMsFileChangeFeedRetentionInDays = rawHeaders.getValue(X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS); + if (xMsFileChangeFeedRetentionInDays != null) { + this.xMsFileChangeFeedRetentionInDays = Integer.parseInt(xMsFileChangeFeedRetentionInDays); + } else { + this.xMsFileChangeFeedRetentionInDays = null; + } + String xMsFileEnableChangeFeed = rawHeaders.getValue(X_MS_FILE_ENABLE_CHANGE_FEED); + if (xMsFileEnableChangeFeed != null) { + this.xMsFileEnableChangeFeed = Boolean.parseBoolean(xMsFileEnableChangeFeed); + } else { + this.xMsFileEnableChangeFeed = null; + } Map xMsMetaHeaderCollection = new LinkedHashMap<>(); rawHeaders.stream().forEach(header -> { @@ -1166,4 +1207,73 @@ public SharesGetPropertiesHeaders setXMsEnableSmbDirectoryLease(Boolean xMsEnabl this.xMsEnableSmbDirectoryLease = xMsEnableSmbDirectoryLease; return this; } + + /** + * Get the xMsFileBlobContainerForXfilesChangeFeed property: The x-ms-file-blob-container-for-xfiles-change-feed + * property. + * + * @return the xMsFileBlobContainerForXfilesChangeFeed value. + */ + @Generated + public String getXMsFileBlobContainerForXfilesChangeFeed() { + return this.xMsFileBlobContainerForXfilesChangeFeed; + } + + /** + * Set the xMsFileBlobContainerForXfilesChangeFeed property: The x-ms-file-blob-container-for-xfiles-change-feed + * property. + * + * @param xMsFileBlobContainerForXfilesChangeFeed the xMsFileBlobContainerForXfilesChangeFeed value to set. + * @return the SharesGetPropertiesHeaders object itself. + */ + @Generated + public SharesGetPropertiesHeaders + setXMsFileBlobContainerForXfilesChangeFeed(String xMsFileBlobContainerForXfilesChangeFeed) { + this.xMsFileBlobContainerForXfilesChangeFeed = xMsFileBlobContainerForXfilesChangeFeed; + return this; + } + + /** + * Get the xMsFileChangeFeedRetentionInDays property: The x-ms-file-change-feed-retention-in-days property. + * + * @return the xMsFileChangeFeedRetentionInDays value. + */ + @Generated + public Integer getXMsFileChangeFeedRetentionInDays() { + return this.xMsFileChangeFeedRetentionInDays; + } + + /** + * Set the xMsFileChangeFeedRetentionInDays property: The x-ms-file-change-feed-retention-in-days property. + * + * @param xMsFileChangeFeedRetentionInDays the xMsFileChangeFeedRetentionInDays value to set. + * @return the SharesGetPropertiesHeaders object itself. + */ + @Generated + public SharesGetPropertiesHeaders setXMsFileChangeFeedRetentionInDays(Integer xMsFileChangeFeedRetentionInDays) { + this.xMsFileChangeFeedRetentionInDays = xMsFileChangeFeedRetentionInDays; + return this; + } + + /** + * Get the xMsFileEnableChangeFeed property: The x-ms-file-enable-change-feed property. + * + * @return the xMsFileEnableChangeFeed value. + */ + @Generated + public Boolean isXMsFileEnableChangeFeed() { + return this.xMsFileEnableChangeFeed; + } + + /** + * Set the xMsFileEnableChangeFeed property: The x-ms-file-enable-change-feed property. + * + * @param xMsFileEnableChangeFeed the xMsFileEnableChangeFeed value to set. + * @return the SharesGetPropertiesHeaders object itself. + */ + @Generated + public SharesGetPropertiesHeaders setXMsFileEnableChangeFeed(Boolean xMsFileEnableChangeFeed) { + this.xMsFileEnableChangeFeed = xMsFileEnableChangeFeed; + return this; + } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java index 0daba31f4fcb0..c3ba69c26fe5d 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java @@ -524,7 +524,10 @@ public static Response mapToShareInfoResponse(Response response) { .setMaxBurstCreditsForIops(headers.getXMsShareMaxBurstCreditsForIops()) .setNextAllowedProvisionedIopsDowngradeTime(headers.getXMsShareNextAllowedProvisionedIopsDowngradeTime()) .setNextAllowedProvisionedBandwidthDowngradeTime( - headers.getXMsShareNextAllowedProvisionedBandwidthDowngradeTime()); + headers.getXMsShareNextAllowedProvisionedBandwidthDowngradeTime()) + .setChangeFeedEnabled(headers.isXMsFileEnableChangeFeed()) + .setChangeFeedBlobContainerName(headers.getXMsFileBlobContainerForXfilesChangeFeed()) + .setChangeFeedRetentionInDays(headers.getXMsFileChangeFeedRetentionInDays()); return new SimpleResponse<>(response, shareProperties); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java index 3d55ab16a53c0..0d9a2eeee8f00 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java @@ -172,6 +172,25 @@ public final class ShareProperties implements XmlSerializable { */ private Boolean enableSmbDirectoryLease; + /* + * Optional. Supported in version 2026-06-06 and above. + * Specifies whether change feed is enabled on the share. + */ + private Boolean enableChangeFeed; + + /* + * Optional. Supported in version 2026-06-06 and above. + * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 + * inclusive. Default if not specified is 7 days. + */ + private Integer changeFeedRetentionInDays; + + /* + * Optional. Supported in version 2026-06-06 and above. The name of the blob container where the change feed + * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. + */ + private String changeFeedBlobContainerName; + /** * Creates a new instance of {@link ShareProperties}. */ @@ -857,6 +876,68 @@ public ShareProperties setSmbDirectoryLeaseEnabled(Boolean enableSmbDirectoryLea return this; } + /** + * Optional. Supported in version 2026-06-06 and above. + * Specifies whether change feed is enabled on the share. + * @return the enableChangeFeed value, or {@code null} if not returned by the service. + */ + public Boolean isChangeFeedEnabled() { + return enableChangeFeed; + } + + /** + * Optional. Supported in version 2026-06-06 and above. + * Specifies whether change feed is enabled on the share. + * @param enableChangeFeed the enableChangeFeed value to set, or {@code null} if unavailable. + * @return the ShareProperties object itself. + */ + public ShareProperties setChangeFeedEnabled(Boolean enableChangeFeed) { + this.enableChangeFeed = enableChangeFeed; + return this; + } + + /** + * Optional. Supported in version 2026-06-06 and above. + * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 + * inclusive. Default if not specified is 7 days. + * @return the changeFeedRetentionInDays value, or {@code null} if not returned by the service. + */ + public Integer getChangeFeedRetentionInDays() { + return changeFeedRetentionInDays; + } + + /** + * Optional. Supported in version 2026-06-06 and above. + * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 + * inclusive. Default if not specified is 7 days. + * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set, or {@code null} if unavailable. + * @return the ShareProperties object itself. + */ + public ShareProperties setChangeFeedRetentionInDays(Integer changeFeedRetentionInDays) { + this.changeFeedRetentionInDays = changeFeedRetentionInDays; + return this; + } + + /** + * Optional. Supported in version 2026-06-06 and above. The name of the blob container where the change feed + * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. + * @return the blobContainerForChangeFeed value. + */ + public String getChangeFeedBlobContainerName() { + return changeFeedBlobContainerName; + } + + /** + * Optional. Supported in version 2026-06-06 and above. The name of the blob container where the change feed + * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. + * @param changeFeedBlobContainerName the blobContainerForChangeFeed value to set. + * @return the ShareProperties object itself. + */ + public ShareProperties setChangeFeedBlobContainerName(String changeFeedBlobContainerName) { + this.changeFeedBlobContainerName = changeFeedBlobContainerName; + return this; + } + @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { return toXml(xmlWriter, null); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java index 8c07e9870bd08..a13468bbd4d59 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java @@ -26,6 +26,8 @@ public class ShareCreateOptions { private Long paidBurstingMaxBandwidthMibps; private Long provisionedMaxIops; private Long provisionedMaxBandwidthMibps; + private Boolean enableChangeFeed; + private Integer changeFeedRetentionInDays; /** * Creates a new instance of {@link ShareCreateOptions}. @@ -277,4 +279,50 @@ public ShareCreateOptions setProvisionedMaxBandwidthMibps(Long provisionedMaxBan this.provisionedMaxBandwidthMibps = provisionedMaxBandwidthMibps; return this; } + + /** + * Get the enableChangeFeed property: + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. + * This property enables change feed on the share. + * @return the enableChangeFeed value. + */ + public Boolean isChangeFeedEnabled() { + return enableChangeFeed; + } + + /** + * Set the enableChangeFeed property: + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. + * This property enables change feed on the share. + * @param enableChangeFeed the enableChangeFeed value to set. + * @return the ShareCreateOptions object itself. + */ + public ShareCreateOptions setChangeFeedEnabled(Boolean enableChangeFeed) { + this.enableChangeFeed = enableChangeFeed; + return this; + } + + /** + * Get the changeFeedRetentionInDays property: + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. + * The number of days that change feed records are retained. Valid values are between 1 and 365 inclusive. + * Default if not specified is 7 days. + * @return the changeFeedRetentionInDays value. + */ + public Integer getChangeFeedRetentionInDays() { + return changeFeedRetentionInDays; + } + + /** + * Set the changeFeedRetentionInDays property: + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. + * The number of days that change feed records are retained. Valid values are between 1 and 365 inclusive. + * Default if not specified is 7 days. + * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. + * @return the ShareCreateOptions object itself. + */ + public ShareCreateOptions setChangeFeedRetentionInDays(Integer changeFeedRetentionInDays) { + this.changeFeedRetentionInDays = changeFeedRetentionInDays; + return this; + } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java index 1e398ee52872d..b034a6e2fa42a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java @@ -23,6 +23,8 @@ public class ShareSetPropertiesOptions { private Long paidBurstingMaxBandwidthMibps; private Long provisionedMaxIops; private Long provisionedMaxBandwidthMibps; + private Boolean enableChangeFeed; + private Integer changeFeedRetentionInDays; /** * Creates a new instance of {@link ShareSetPropertiesOptions}. @@ -256,4 +258,51 @@ public ShareSetPropertiesOptions setProvisionedMaxBandwidthMibps(Long provisione this.provisionedMaxBandwidthMibps = provisionedMaxBandwidthMibps; return this; } + + /** + * Get the enableChangeFeed property: + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. + * This property enables change feed on the share. + * @return the enableChangeFeed value. + */ + public Boolean isChangeFeedEnabled() { + return enableChangeFeed; + } + + /** + * Set the enableChangeFeed property: + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. + * This property enables change feed on the share. + * @param enableChangeFeed the enableChangeFeed value to set. + * @return the ShareSetPropertiesOptions object itself. + */ + public ShareSetPropertiesOptions setChangeFeedEnabled(Boolean enableChangeFeed) { + this.enableChangeFeed = enableChangeFeed; + return this; + } + + /** + * Get the changeFeedRetentionInDays property: + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. + * The number of days that change feed records are retained. Valid values are between 1 and 365 inclusive. + * Default if not specified is 7 days. + * @return the changeFeedRetentionInDays value. + */ + public Integer getChangeFeedRetentionInDays() { + return changeFeedRetentionInDays; + } + + /** + * Set the changeFeedRetentionInDays property: + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. + * The number of days that change feed records are retained. Valid values are between 1 and 365 inclusive. + * Default if not specified is 7 days. + * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. + * @return the ShareSetPropertiesOptions object itself. + */ + public ShareSetPropertiesOptions setChangeFeedRetentionInDays(Integer changeFeedRetentionInDays) { + this.changeFeedRetentionInDays = changeFeedRetentionInDays; + return this; + } + } diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java index bd329ede2ed54..c27d9a68a1812 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java @@ -3,6 +3,8 @@ package com.azure.storage.file.share; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.azure.core.http.rest.Response; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.implementation.Constants; @@ -18,6 +20,7 @@ import com.azure.storage.file.share.models.ShareFileRangeItem; import com.azure.storage.file.share.models.ShareItem; import com.azure.storage.file.share.models.ShareMetrics; +import com.azure.storage.file.share.models.ShareProperties; import com.azure.storage.file.share.models.ShareRetentionPolicy; import com.azure.storage.file.share.models.ShareRootSquash; import com.azure.storage.file.share.models.ShareServiceProperties; @@ -47,11 +50,18 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; public class FileShareTestHelper { private static final ClientLogger LOGGER = new ClientLogger(FileShareTestHelper.class); + private static final HttpHeaderName X_MS_FILE_ENABLE_CHANGE_FEED + = HttpHeaderName.fromString("x-ms-file-enable-change-feed"); + private static final HttpHeaderName X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS + = HttpHeaderName.fromString("x-ms-file-change-feed-retention-in-days"); + private static final HttpHeaderName X_MS_FILE_BLOB_CONTAINER_FOR_XFILES_CHANGE_FEED + = HttpHeaderName.fromString("x-ms-file-blob-container-for-xfiles-change-feed"); static String getRandomString(int size) { byte[] array = new byte[size]; @@ -72,6 +82,52 @@ protected static Response assertResponseStatusCode(Response response, return response; } + static Stream createShareChangeFeedSupplier() { + return Stream.of(Arguments.of(true, 7), Arguments.of(true, null), Arguments.of(false, null), + Arguments.of(null, null)); + } + + static Stream setPropertiesShareChangeFeedSupplier() { + return Stream.of(Arguments.of(true, 14), Arguments.of(true, null), Arguments.of(false, null), + Arguments.of(null, 14), Arguments.of(null, null)); + } + + static void assertShareChangeFeedRequestHeaders(Response response, Boolean enabled, Integer retentionInDays) { + HttpHeaders headers = response.getRequest().getHeaders(); + assertEquals(enabled == null ? null : enabled.toString(), headers.getValue(X_MS_FILE_ENABLE_CHANGE_FEED)); + assertEquals(retentionInDays == null ? null : retentionInDays.toString(), + headers.getValue(X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS)); + } + + static void assertShareChangeFeedProperties(Response response, Boolean enabled, + Integer retentionInDays) { + assertEquals(200, response.getStatusCode()); + HttpHeaders headers = response.getHeaders(); + ShareProperties properties = response.getValue(); + String enabledHeader = headers.getValue(X_MS_FILE_ENABLE_CHANGE_FEED); + String retentionHeader = headers.getValue(X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS); + String containerHeader = headers.getValue(X_MS_FILE_BLOB_CONTAINER_FOR_XFILES_CHANGE_FEED); + + // Omitted options may be defaulted by the service; their raw headers must still map to the public properties. + assertEquals(enabledHeader == null ? null : Boolean.valueOf(enabledHeader), properties.isChangeFeedEnabled()); + assertEquals(retentionHeader == null ? null : Integer.valueOf(retentionHeader), + properties.getChangeFeedRetentionInDays()); + assertEquals(containerHeader, properties.getChangeFeedBlobContainerName()); + if (enabled != null) { + assertNotNull(enabledHeader); + assertEquals(enabled, Boolean.valueOf(enabledHeader)); + assertEquals(enabled, properties.isChangeFeedEnabled()); + } + if (retentionInDays != null) { + assertEquals(retentionInDays.toString(), retentionHeader); + assertEquals(retentionInDays, properties.getChangeFeedRetentionInDays()); + } + if (Boolean.TRUE.equals(enabled)) { + assertNotNull(containerHeader); + assertFalse(containerHeader.isEmpty()); + } + } + /** * Compares the two timestamps to the minute * @param expectedTime expected time diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java index dad2c5c179224..a65538bfe4d23 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java @@ -23,6 +23,18 @@ public class ModelTests { + @Test + void sharePropertiesChangeFeedDefaultsAndClearing() { + ShareProperties properties = new ShareProperties(); + assertNull(properties.isChangeFeedEnabled()); + assertNull(properties.getChangeFeedRetentionInDays()); + + properties.setChangeFeedEnabled(true).setChangeFeedRetentionInDays(7); + properties.setChangeFeedEnabled(null).setChangeFeedRetentionInDays(null); + assertNull(properties.isChangeFeedEnabled()); + assertNull(properties.getChangeFeedRetentionInDays()); + } + @Test void ntfsToAttributes() { assertEquals(EnumSet.of(NtfsFileAttributes.READ_ONLY), NtfsFileAttributes.toAttributes("ReadOnly")); diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java index 4f83bfc51cd26..7f37c0ea0c5d6 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java @@ -1534,6 +1534,48 @@ public void setPropertiesSharePaidBursting() { premiumFileServiceClient.getShareClient(shareName).delete(); } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-06-06") + @ParameterizedTest + @MethodSource("com.azure.storage.file.share.FileShareTestHelper#createShareChangeFeedSupplier") + public void createShareChangeFeed(Boolean enabled, Integer retentionInDays) { + ShareClient client = premiumFileServiceClient.getShareClient(shareName); + ShareCreateOptions options + = new ShareCreateOptions().setChangeFeedEnabled(enabled).setChangeFeedRetentionInDays(retentionInDays); + + Response response = client.createWithResponse(options, null, null); + try { + assertEquals(201, response.getStatusCode()); + FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); + FileShareTestHelper.assertShareChangeFeedProperties(client.getPropertiesWithResponse(null, null), enabled, + retentionInDays); + } finally { + client.delete(); + } + } + + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-06-06") + @ParameterizedTest + @MethodSource("com.azure.storage.file.share.FileShareTestHelper#setPropertiesShareChangeFeedSupplier") + public void setPropertiesShareChangeFeed(Boolean enabled, Integer retentionInDays) { + ShareClient client = premiumFileServiceClient.getShareClient(shareName); + client.createWithResponse(new ShareCreateOptions().setChangeFeedEnabled(true).setChangeFeedRetentionInDays(7), + null, null); + try { + ShareSetPropertiesOptions options = new ShareSetPropertiesOptions().setChangeFeedEnabled(enabled) + .setChangeFeedRetentionInDays(retentionInDays); + Response response = client.setPropertiesWithResponse(options, null, null); + assertEquals(200, response.getStatusCode()); + FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); + FileShareTestHelper.assertShareChangeFeedProperties(client.getPropertiesWithResponse(null, null), + enabled == null ? true : enabled, + Boolean.FALSE.equals(enabled) + ? retentionInDays + : retentionInDays == null ? Integer.valueOf(7) : retentionInDays); + } finally { + client.delete(); + } + } + @PlaybackOnly @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2025-01-05") @Test diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java index f79c2f6a51df5..c6108e0097788 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java @@ -1170,6 +1170,52 @@ public void setPropertiesSharePaidBursting() { premiumFileServiceAsyncClient.getShareAsyncClient(shareName).delete().block(); } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-06-06") + @ParameterizedTest + @MethodSource("com.azure.storage.file.share.FileShareTestHelper#createShareChangeFeedSupplier") + public void createShareChangeFeed(Boolean enabled, Integer retentionInDays) { + ShareAsyncClient client = premiumFileServiceAsyncClient.getShareAsyncClient(shareName); + ShareCreateOptions options + = new ShareCreateOptions().setChangeFeedEnabled(enabled).setChangeFeedRetentionInDays(retentionInDays); + + Response response = client.createWithResponse(options).block(); + try { + assertEquals(201, response.getStatusCode()); + FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); + StepVerifier.create(client.getPropertiesWithResponse()) + .assertNext(r -> FileShareTestHelper.assertShareChangeFeedProperties(r, enabled, retentionInDays)) + .verifyComplete(); + } finally { + client.delete().block(); + } + } + + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-06-06") + @ParameterizedTest + @MethodSource("com.azure.storage.file.share.FileShareTestHelper#setPropertiesShareChangeFeedSupplier") + public void setPropertiesShareChangeFeed(Boolean enabled, Integer retentionInDays) { + ShareAsyncClient client = premiumFileServiceAsyncClient.getShareAsyncClient(shareName); + client.createWithResponse(new ShareCreateOptions().setChangeFeedEnabled(true).setChangeFeedRetentionInDays(7)) + .block(); + try { + ShareSetPropertiesOptions options = new ShareSetPropertiesOptions().setChangeFeedEnabled(enabled) + .setChangeFeedRetentionInDays(retentionInDays); + StepVerifier.create(client.setPropertiesWithResponse(options).flatMap(response -> { + assertEquals(200, response.getStatusCode()); + FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); + return client.getPropertiesWithResponse(); + })) + .assertNext( + r -> FileShareTestHelper.assertShareChangeFeedProperties(r, enabled == null ? true : enabled, + Boolean.FALSE.equals(enabled) + ? retentionInDays + : retentionInDays == null ? Integer.valueOf(7) : retentionInDays)) + .verifyComplete(); + } finally { + client.delete().block(); + } + } + @PlaybackOnly @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2025-01-05") @Test