Skip to content

Commit d8bf63f

Browse files
authored
Regenerated blob based off 04-08 swagger (Azure#18477)
1 parent 92abffc commit d8bf63f

File tree

6 files changed

+128
-5
lines changed

6 files changed

+128
-5
lines changed

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.azure.core.util.Base64Util;
2626
import com.azure.core.util.Context;
2727
import com.azure.core.util.DateTimeRfc1123;
28+
import com.azure.storage.blob.implementation.models.BlobDeleteType;
2829
import com.azure.storage.blob.implementation.models.BlobExpiryOptions;
2930
import com.azure.storage.blob.implementation.models.BlobsAbortCopyFromURLResponse;
3031
import com.azure.storage.blob.implementation.models.BlobsAcquireLeaseResponse;
@@ -113,7 +114,7 @@ private interface BlobsService {
113114
@Delete("{containerName}/{blob}")
114115
@ExpectedResponses({202})
115116
@UnexpectedResponseExceptionType(BlobStorageException.class)
116-
Mono<BlobsDeleteResponse> delete(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, Context context);
117+
Mono<BlobsDeleteResponse> delete(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("deletetype") BlobDeleteType blobDeleteType, Context context);
117118

118119
@Patch("{filesystem}/{path}")
119120
@ExpectedResponses({200})
@@ -379,9 +380,10 @@ public Mono<BlobsDeleteResponse> deleteWithRestResponseAsync(String containerNam
379380
final String ifNoneMatch = null;
380381
final String ifTags = null;
381382
final String requestId = null;
383+
final BlobDeleteType blobDeleteType = null;
382384
DateTimeRfc1123 ifModifiedSinceConverted = null;
383385
DateTimeRfc1123 ifUnmodifiedSinceConverted = null;
384-
return service.delete(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, context);
386+
return service.delete(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobDeleteType, context);
385387
}
386388

387389
/**
@@ -400,15 +402,16 @@ public Mono<BlobsDeleteResponse> deleteWithRestResponseAsync(String containerNam
400402
* @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
401403
* @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
402404
* @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
405+
* @param blobDeleteType Optional. Only possible value is 'permanent', which specifies to permanently delete a blob if blob soft delete is enabled. Possible values include: 'Permanent'.
403406
* @param context The context to associate with this operation.
404407
* @throws IllegalArgumentException thrown if parameters fail the validation.
405408
* @return a Mono which performs the network request upon subscription.
406409
*/
407410
@ServiceMethod(returns = ReturnType.SINGLE)
408-
public Mono<BlobsDeleteResponse> deleteWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) {
411+
public Mono<BlobsDeleteResponse> deleteWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, BlobDeleteType blobDeleteType, Context context) {
409412
DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
410413
DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
411-
return service.delete(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, context);
414+
return service.delete(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobDeleteType, context);
412415
}
413416

414417
/**
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.storage.blob.implementation.models;
6+
7+
import com.fasterxml.jackson.annotation.JsonCreator;
8+
import com.fasterxml.jackson.annotation.JsonValue;
9+
10+
/**
11+
* Defines values for BlobDeleteType.
12+
*/
13+
public enum BlobDeleteType {
14+
/**
15+
* Enum value Permanent.
16+
*/
17+
PERMANENT("Permanent");
18+
19+
/**
20+
* The actual serialized value for a BlobDeleteType instance.
21+
*/
22+
private final String value;
23+
24+
BlobDeleteType(String value) {
25+
this.value = value;
26+
}
27+
28+
/**
29+
* Parses a serialized value to a BlobDeleteType instance.
30+
*
31+
* @param value the serialized value to parse.
32+
* @return the parsed BlobDeleteType object, or null if unable to parse.
33+
*/
34+
@JsonCreator
35+
public static BlobDeleteType fromString(String value) {
36+
BlobDeleteType[] items = BlobDeleteType.values();
37+
for (BlobDeleteType item : items) {
38+
if (item.toString().equalsIgnoreCase(value)) {
39+
return item;
40+
}
41+
}
42+
return null;
43+
}
44+
45+
@JsonValue
46+
@Override
47+
public String toString() {
48+
return this.value;
49+
}
50+
}

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobDownloadHeaders.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,13 @@ public final class BlobDownloadHeaders {
244244
@JsonProperty(value = "x-ms-version-id")
245245
private String versionId;
246246

247+
/*
248+
* The value of this header indicates whether version of this blob is a
249+
* current version, see also x-ms-version-id header.
250+
*/
251+
@JsonProperty(value = "x-ms-is-current-version")
252+
private Boolean isCurrentVersion;
253+
247254
/*
248255
* Indicates that the service supports requests for partial blob content.
249256
*/
@@ -1037,6 +1044,30 @@ public BlobDownloadHeaders setVersionId(String versionId) {
10371044
return this;
10381045
}
10391046

1047+
/**
1048+
* Get the isCurrentVersion property: The value of this header indicates
1049+
* whether version of this blob is a current version, see also
1050+
* x-ms-version-id header.
1051+
*
1052+
* @return the isCurrentVersion value.
1053+
*/
1054+
public Boolean isCurrentVersion() {
1055+
return this.isCurrentVersion;
1056+
}
1057+
1058+
/**
1059+
* Set the isCurrentVersion property: The value of this header indicates
1060+
* whether version of this blob is a current version, see also
1061+
* x-ms-version-id header.
1062+
*
1063+
* @param isCurrentVersion the isCurrentVersion value to set.
1064+
* @return the BlobDownloadHeaders object itself.
1065+
*/
1066+
public BlobDownloadHeaders setIsCurrentVersion(Boolean isCurrentVersion) {
1067+
this.isCurrentVersion = isCurrentVersion;
1068+
return this;
1069+
}
1070+
10401071
/**
10411072
* Get the acceptRanges property: Indicates that the service supports
10421073
* requests for partial blob content.

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServiceGetAccountInfoHeaders.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ public final class ServiceGetAccountInfoHeaders {
6262
@JsonProperty(value = "x-ms-account-kind")
6363
private AccountKind accountKind;
6464

65+
/*
66+
* Version 2019-07-07 and newer. Indicates if the account has a
67+
* hierarchical namespace enabled.
68+
*/
69+
@JsonProperty(value = "x-ms-is-hns-enabled")
70+
private Boolean isHierarchicalNamespaceEnabled;
71+
6572
/*
6673
* The errorCode property.
6774
*/
@@ -215,6 +222,29 @@ public ServiceGetAccountInfoHeaders setAccountKind(AccountKind accountKind) {
215222
return this;
216223
}
217224

225+
/**
226+
* Get the isHierarchicalNamespaceEnabled property: Version 2019-07-07 and
227+
* newer. Indicates if the account has a hierarchical namespace enabled.
228+
*
229+
* @return the isHierarchicalNamespaceEnabled value.
230+
*/
231+
public Boolean isHierarchicalNamespaceEnabled() {
232+
return this.isHierarchicalNamespaceEnabled;
233+
}
234+
235+
/**
236+
* Set the isHierarchicalNamespaceEnabled property: Version 2019-07-07 and
237+
* newer. Indicates if the account has a hierarchical namespace enabled.
238+
*
239+
* @param isHierarchicalNamespaceEnabled the isHierarchicalNamespaceEnabled
240+
* value to set.
241+
* @return the ServiceGetAccountInfoHeaders object itself.
242+
*/
243+
public ServiceGetAccountInfoHeaders setIsHierarchicalNamespaceEnabled(Boolean isHierarchicalNamespaceEnabled) {
244+
this.isHierarchicalNamespaceEnabled = isHierarchicalNamespaceEnabled;
245+
return this;
246+
}
247+
218248
/**
219249
* Get the errorCode property: The errorCode property.
220250
*

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ Mono<Response<Void>> deleteWithResponse(DeleteSnapshotsOptionType deleteBlobSnap
12211221
return this.azureBlobStorage.blobs().deleteWithRestResponseAsync(null, null, snapshot, versionId,
12221222
null, requestConditions.getLeaseId(), deleteBlobSnapshotOptions, requestConditions.getIfModifiedSince(),
12231223
requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(),
1224-
requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, context)
1224+
requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, null, context)
12251225
.map(response -> new SimpleResponse<>(response, null));
12261226
}
12271227

sdk/storage/azure-storage-blob/swagger/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,4 +1425,13 @@ directive:
14251425
delete $.FilterBlobItem.properties.TagValue;
14261426
```
14271427
1428+
### Hide AllowPermanentDelete in RetentionPolicy
1429+
``` yaml
1430+
directive:
1431+
- from: swagger-document
1432+
where: $.definitions.BlobRetentionPolicy
1433+
transform: >
1434+
delete $.properties.AllowPermanentDelete;
1435+
```
1436+
14281437
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob%2Fswagger%2FREADME.png)

0 commit comments

Comments
 (0)