diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java index 6746e5d14043..e112a9c30666 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java @@ -3,9 +3,6 @@ package com.azure.storage.blob; -import static com.azure.core.implementation.util.FluxUtil.withContext; -import static com.azure.storage.blob.implementation.PostProcessor.postProcessResponse; - import com.azure.core.annotation.ServiceClient; import com.azure.core.credentials.TokenCredential; import com.azure.core.http.HttpPipeline; @@ -19,22 +16,26 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.storage.blob.implementation.AzureBlobStorageBuilder; import com.azure.storage.blob.implementation.AzureBlobStorageImpl; -import com.azure.storage.blob.implementation.models.ServicesListContainersSegmentResponse; +import com.azure.storage.blob.implementation.models.ServicesListBlobContainersSegmentResponse; import com.azure.storage.blob.models.BlobContainerItem; +import com.azure.storage.blob.models.BlobServiceProperties; import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.KeyInfo; import com.azure.storage.blob.models.ListBlobContainersOptions; import com.azure.storage.blob.models.PublicAccessType; import com.azure.storage.blob.models.StorageAccountInfo; -import com.azure.storage.blob.models.StorageServiceProperties; import com.azure.storage.blob.models.StorageServiceStats; import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.common.Utility; +import reactor.core.publisher.Mono; + import java.time.Duration; import java.time.OffsetDateTime; import java.util.Map; import java.util.function.Function; -import reactor.core.publisher.Mono; + +import static com.azure.core.implementation.util.FluxUtil.withContext; +import static com.azure.storage.blob.implementation.PostProcessor.postProcessResponse; /** * Client to a storage account. It may only be instantiated through a {@link BlobServiceClientBuilder}. This class does @@ -234,19 +235,19 @@ PagedFlux listBlobContainersWithOptionalTimeout(ListBlobConta response.getRequest(), response.getStatusCode(), response.getHeaders(), - response.getValue().getContainerItems(), + response.getValue().getBlobContainerItems(), response.getValue().getNextMarker(), response.getDeserializedHeaders())); return new PagedFlux<>(() -> func.apply(null), func); } - private Mono listBlobContainersSegment(String marker, + private Mono listBlobContainersSegment(String marker, ListBlobContainersOptions options, Duration timeout) { options = options == null ? new ListBlobContainersOptions() : options; return postProcessResponse(Utility.applyOptionalTimeout( - this.azureBlobStorage.services().listContainersSegmentWithRestResponseAsync( + this.azureBlobStorage.services().listBlobContainersSegmentWithRestResponseAsync( options.getPrefix(), marker, options.getMaxResults(), options.getDetails().toIncludeType(), null, null, Context.NONE), timeout)); } @@ -261,7 +262,7 @@ private Mono listBlobContainersSegment(St * * @return A reactive response containing the storage account properties. */ - public Mono getProperties() { + public Mono getProperties() { return getPropertiesWithResponse().flatMap(FluxUtil::toMono); } @@ -276,11 +277,11 @@ public Mono getProperties() { * @return A {@link Mono} containing a {@link Response} whose {@link Response#getValue() value} contains the storage * account properties. */ - public Mono> getPropertiesWithResponse() { + public Mono> getPropertiesWithResponse() { return withContext(this::getPropertiesWithResponse); } - Mono> getPropertiesWithResponse(Context context) { + Mono> getPropertiesWithResponse(Context context) { return postProcessResponse( this.azureBlobStorage.services().getPropertiesWithRestResponseAsync(null, null, context)) .map(rb -> new SimpleResponse<>(rb, rb.getValue())); @@ -294,12 +295,12 @@ Mono> getPropertiesWithResponse(Context conte * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.BlobServiceAsyncClient.setProperties#StorageServiceProperties} + * {@codesnippet com.azure.storage.blob.BlobServiceAsyncClient.setProperties#BlobServiceProperties} * * @param properties Configures the service. * @return A {@link Mono} containing the storage account properties. */ - public Mono setProperties(StorageServiceProperties properties) { + public Mono setProperties(BlobServiceProperties properties) { return setPropertiesWithResponse(properties).flatMap(FluxUtil::toMono); } @@ -310,16 +311,16 @@ public Mono setProperties(StorageServiceProperties properties) { * sets the version header on each request, overriding the default. *

Code Samples

* - * {@codesnippet com.azure.storage.blob.BlobServiceAsyncClient.setPropertiesWithResponse#StorageServiceProperties} + * {@codesnippet com.azure.storage.blob.BlobServiceAsyncClient.setPropertiesWithResponse#BlobServiceProperties} * * @param properties Configures the service. * @return A {@link Mono} containing the storage account properties. */ - public Mono> setPropertiesWithResponse(StorageServiceProperties properties) { + public Mono> setPropertiesWithResponse(BlobServiceProperties properties) { return withContext(context -> setPropertiesWithResponse(properties, context)); } - Mono> setPropertiesWithResponse(StorageServiceProperties properties, Context context) { + Mono> setPropertiesWithResponse(BlobServiceProperties properties, Context context) { return postProcessResponse( this.azureBlobStorage.services().setPropertiesWithRestResponseAsync(properties, null, null, context)) .map(response -> new SimpleResponse<>(response, null)); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java index 761f2691a8cc..e1521dc1b0a7 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java @@ -11,17 +11,18 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.storage.blob.models.BlobContainerItem; +import com.azure.storage.blob.models.BlobServiceProperties; import com.azure.storage.blob.models.ListBlobContainersOptions; import com.azure.storage.blob.models.PublicAccessType; import com.azure.storage.blob.models.StorageAccountInfo; -import com.azure.storage.blob.models.StorageServiceProperties; import com.azure.storage.blob.models.StorageServiceStats; import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.common.Utility; +import reactor.core.publisher.Mono; + import java.time.Duration; import java.time.OffsetDateTime; import java.util.Map; -import reactor.core.publisher.Mono; /** * Client to a storage account. It may only be instantiated through a {@link BlobServiceClientBuilder}. This class does @@ -191,7 +192,7 @@ public PagedIterable listBlobContainers(ListBlobContainersOpt * * @return The storage account properties. */ - public StorageServiceProperties getProperties() { + public BlobServiceProperties getProperties() { return getPropertiesWithResponse(null, Context.NONE).getValue(); } @@ -207,9 +208,9 @@ public StorageServiceProperties getProperties() { * @param context Additional context that is passed through the Http pipeline during the service call. * @return A {@link Response} whose {@link Response#getValue() value} contains the storage account properties. */ - public Response getPropertiesWithResponse(Duration timeout, Context context) { + public Response getPropertiesWithResponse(Duration timeout, Context context) { - Mono> response = blobServiceAsyncClient.getPropertiesWithResponse(context); + Mono> response = blobServiceAsyncClient.getPropertiesWithResponse(context); return Utility.blockWithOptionalTimeout(response, timeout); } @@ -222,11 +223,11 @@ public Response getPropertiesWithResponse(Duration tim * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.BlobServiceClient.setProperties#StorageServiceProperties} + * {@codesnippet com.azure.storage.blob.BlobServiceClient.setProperties#BlobServiceProperties} * * @param properties Configures the service. */ - public void setProperties(StorageServiceProperties properties) { + public void setProperties(BlobServiceProperties properties) { setPropertiesWithResponse(properties, null, Context.NONE); } @@ -238,14 +239,14 @@ public void setProperties(StorageServiceProperties properties) { * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.BlobServiceClient.setPropertiesWithResponse#StorageServiceProperties-Duration-Context} + * {@codesnippet com.azure.storage.blob.BlobServiceClient.setPropertiesWithResponse#BlobServiceProperties-Duration-Context} * * @param properties Configures the service. * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @param context Additional context that is passed through the Http pipeline during the service call. * @return The storage account properties. */ - public Response setPropertiesWithResponse(StorageServiceProperties properties, Duration timeout, + public Response setPropertiesWithResponse(BlobServiceProperties properties, Duration timeout, Context context) { Mono> response = blobServiceAsyncClient.setPropertiesWithResponse(properties, context); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java index 5626195f0321..391fd548e2b9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java @@ -43,11 +43,11 @@ import com.azure.storage.blob.implementation.models.BlobsSetTierResponse; import com.azure.storage.blob.implementation.models.BlobsStartCopyFromURLResponse; import com.azure.storage.blob.implementation.models.BlobsUndeleteResponse; +import com.azure.storage.blob.implementation.models.DataLakeStorageErrorException; import com.azure.storage.blob.implementation.models.DirectoryHttpHeaders; import com.azure.storage.blob.models.AccessTier; import com.azure.storage.blob.models.BlobHTTPHeaders; import com.azure.storage.blob.models.CpkInfo; -import com.azure.storage.blob.implementation.models.DataLakeStorageErrorException; import com.azure.storage.blob.models.DeleteSnapshotsOptionType; import com.azure.storage.blob.models.EncryptionAlgorithmType; import com.azure.storage.blob.models.LeaseAccessConditions; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/DirectorysImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/DirectorysImpl.java index e26340bd8079..f50c46ed2342 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/DirectorysImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/DirectorysImpl.java @@ -21,13 +21,13 @@ import com.azure.core.implementation.DateTimeRfc1123; import com.azure.core.implementation.RestProxy; import com.azure.core.util.Context; +import com.azure.storage.blob.implementation.models.DataLakeStorageErrorException; import com.azure.storage.blob.implementation.models.DirectoryHttpHeaders; import com.azure.storage.blob.implementation.models.DirectorysCreateResponse; import com.azure.storage.blob.implementation.models.DirectorysDeleteResponse; import com.azure.storage.blob.implementation.models.DirectorysGetAccessControlResponse; import com.azure.storage.blob.implementation.models.DirectorysRenameResponse; import com.azure.storage.blob.implementation.models.DirectorysSetAccessControlResponse; -import com.azure.storage.blob.implementation.models.DataLakeStorageErrorException; import com.azure.storage.blob.models.LeaseAccessConditions; import com.azure.storage.blob.models.ModifiedAccessConditions; import com.azure.storage.blob.models.PathRenameMode; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java index ce6e74808c29..c2b7614087fd 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java @@ -23,13 +23,13 @@ import com.azure.storage.blob.implementation.models.ServicesGetPropertiesResponse; import com.azure.storage.blob.implementation.models.ServicesGetStatisticsResponse; import com.azure.storage.blob.implementation.models.ServicesGetUserDelegationKeyResponse; -import com.azure.storage.blob.implementation.models.ServicesListContainersSegmentResponse; +import com.azure.storage.blob.implementation.models.ServicesListBlobContainersSegmentResponse; import com.azure.storage.blob.implementation.models.ServicesSetPropertiesResponse; import com.azure.storage.blob.implementation.models.ServicesSubmitBatchResponse; +import com.azure.storage.blob.models.BlobServiceProperties; import com.azure.storage.blob.models.KeyInfo; import com.azure.storage.blob.models.ListBlobContainersIncludeType; import com.azure.storage.blob.models.StorageErrorException; -import com.azure.storage.blob.models.StorageServiceProperties; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -70,7 +70,7 @@ private interface ServicesService { @Put("") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono setProperties(@HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") StorageServiceProperties storageServiceProperties, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context); + Mono setProperties(@HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") BlobServiceProperties blobServiceProperties, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context); @Get("") @ExpectedResponses({200}) @@ -85,7 +85,7 @@ private interface ServicesService { @Get("") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono listContainersSegment(@HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker1, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") ListBlobContainersIncludeType include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, Context context); + Mono listBlobContainersSegment(@HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker1, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") ListBlobContainersIncludeType include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, Context context); @Post("") @ExpectedResponses({200}) @@ -106,24 +106,24 @@ private interface ServicesService { /** * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. * - * @param storageServiceProperties The StorageService properties. + * @param blobServiceProperties The StorageService properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesWithRestResponseAsync(StorageServiceProperties storageServiceProperties, Context context) { + public Mono setPropertiesWithRestResponseAsync(BlobServiceProperties blobServiceProperties, Context context) { final Integer timeout = null; final String requestId = null; final String restype = "service"; final String comp = "properties"; - return service.setProperties(this.client.getUrl(), storageServiceProperties, timeout, this.client.getVersion(), requestId, restype, comp, context); + return service.setProperties(this.client.getUrl(), blobServiceProperties, timeout, this.client.getVersion(), requestId, restype, comp, context); } /** * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. * - * @param storageServiceProperties The StorageService properties. + * @param blobServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @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. * @param context The context to associate with this operation. @@ -131,10 +131,10 @@ public Mono setPropertiesWithRestResponseAsync(St * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesWithRestResponseAsync(StorageServiceProperties storageServiceProperties, Integer timeout, String requestId, Context context) { + public Mono setPropertiesWithRestResponseAsync(BlobServiceProperties blobServiceProperties, Integer timeout, String requestId, Context context) { final String restype = "service"; final String comp = "properties"; - return service.setProperties(this.client.getUrl(), storageServiceProperties, timeout, this.client.getVersion(), requestId, restype, comp, context); + return service.setProperties(this.client.getUrl(), blobServiceProperties, timeout, this.client.getVersion(), requestId, restype, comp, context); } /** @@ -209,7 +209,7 @@ public Mono getStatisticsWithRestResponseAsync(In * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listContainersSegmentWithRestResponseAsync(Context context) { + public Mono listBlobContainersSegmentWithRestResponseAsync(Context context) { final String prefix = null; final String marker = null; final Integer maxresults = null; @@ -217,7 +217,7 @@ public Mono listContainersSegmentWithRest final Integer timeout = null; final String requestId = null; final String comp = "list"; - return service.listContainersSegment(this.client.getUrl(), prefix, marker, maxresults, include, timeout, this.client.getVersion(), requestId, comp, context); + return service.listBlobContainersSegment(this.client.getUrl(), prefix, marker, maxresults, include, timeout, this.client.getVersion(), requestId, comp, context); } /** @@ -234,9 +234,9 @@ public Mono listContainersSegmentWithRest * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listContainersSegmentWithRestResponseAsync(String prefix, String marker, Integer maxresults, ListBlobContainersIncludeType include, Integer timeout, String requestId, Context context) { + public Mono listBlobContainersSegmentWithRestResponseAsync(String prefix, String marker, Integer maxresults, ListBlobContainersIncludeType include, Integer timeout, String requestId, Context context) { final String comp = "list"; - return service.listContainersSegment(this.client.getUrl(), prefix, marker, maxresults, include, timeout, this.client.getVersion(), requestId, comp, context); + return service.listBlobContainersSegment(this.client.getUrl(), prefix, marker, maxresults, include, timeout, this.client.getVersion(), requestId, comp, context); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ListContainersSegmentResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobContainersSegment.java similarity index 67% rename from sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ListContainersSegmentResponse.java rename to sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobContainersSegment.java index 21c76df8dde3..6c3e9d25558b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ListContainersSegmentResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobContainersSegment.java @@ -18,7 +18,7 @@ */ @JacksonXmlRootElement(localName = "EnumerationResults") @Fluent -public final class ListContainersSegmentResponse { +public final class BlobContainersSegment { /* * The serviceEndpoint property. */ @@ -28,7 +28,7 @@ public final class ListContainersSegmentResponse { /* * The prefix property. */ - @JsonProperty(value = "Prefix", required = true) + @JsonProperty(value = "Prefix") private String prefix; /* @@ -40,8 +40,14 @@ public final class ListContainersSegmentResponse { /* * The maxResults property. */ - @JsonProperty(value = "MaxResults", required = true) - private int maxResults; + @JsonProperty(value = "MaxResults") + private Integer maxResults; + + /* + * The nextMarker property. + */ + @JsonProperty(value = "NextMarker", required = true) + private String nextMarker; private static final class ContainersWrapper { @JacksonXmlProperty(localName = "Container") @@ -54,16 +60,10 @@ private ContainersWrapper(@JacksonXmlProperty(localName = "Container") List getContainerItems() { - if (this.containerItems == null) { - this.containerItems = new ContainersWrapper(new ArrayList()); - } - return this.containerItems.items; + public String getNextMarker() { + return this.nextMarker; } /** - * Set the containerItems property: The containerItems property. + * Set the nextMarker property: The nextMarker property. * - * @param blobContainerItems the containerItems value to set. - * @return the ListContainersSegmentResponse object itself. + * @param nextMarker the nextMarker value to set. + * @return the BlobContainersSegment object itself. */ - public ListContainersSegmentResponse setContainerItems(List blobContainerItems) { - this.containerItems = new ContainersWrapper(blobContainerItems); + public BlobContainersSegment setNextMarker(String nextMarker) { + this.nextMarker = nextMarker; return this; } /** - * Get the nextMarker property: The nextMarker property. + * Get the blobContainerItems property: The blobContainerItems property. * - * @return the nextMarker value. + * @return the blobContainerItems value. */ - public String getNextMarker() { - return this.nextMarker; + public List getBlobContainerItems() { + if (this.blobContainerItems == null) { + this.blobContainerItems = new ContainersWrapper(new ArrayList()); + } + return this.blobContainerItems.items; } /** - * Set the nextMarker property: The nextMarker property. + * Set the blobContainerItems property: The blobContainerItems property. * - * @param nextMarker the nextMarker value to set. - * @return the ListContainersSegmentResponse object itself. + * @param blobContainerItems the blobContainerItems value to set. + * @return the BlobContainersSegment object itself. */ - public ListContainersSegmentResponse setNextMarker(String nextMarker) { - this.nextMarker = nextMarker; + public BlobContainersSegment setBlobContainerItems(List blobContainerItems) { + this.blobContainerItems = new ContainersWrapper(blobContainerItems); return this; } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ListBlobsFlatSegmentResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ListBlobsFlatSegmentResponse.java index 3991764e4670..09a93450c0e4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ListBlobsFlatSegmentResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ListBlobsFlatSegmentResponse.java @@ -45,12 +45,6 @@ public final class ListBlobsFlatSegmentResponse { @JsonProperty(value = "MaxResults", required = true) private int maxResults; - /* - * The delimiter property. - */ - @JsonProperty(value = "Delimiter", required = true) - private String delimiter; - /* * The segment property. */ @@ -163,26 +157,6 @@ public ListBlobsFlatSegmentResponse setMaxResults(int maxResults) { return this; } - /** - * Get the delimiter property: The delimiter property. - * - * @return the delimiter value. - */ - public String getDelimiter() { - return this.delimiter; - } - - /** - * Set the delimiter property: The delimiter property. - * - * @param delimiter the delimiter value to set. - * @return the ListBlobsFlatSegmentResponse object itself. - */ - public ListBlobsFlatSegmentResponse setDelimiter(String delimiter) { - this.delimiter = delimiter; - return this; - } - /** * Get the segment property: The segment property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServiceListContainersSegmentHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServiceListBlobContainersSegmentHeaders.java similarity index 80% rename from sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServiceListContainersSegmentHeaders.java rename to sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServiceListBlobContainersSegmentHeaders.java index 9f73b4639d2e..6d402b18510f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServiceListContainersSegmentHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServiceListBlobContainersSegmentHeaders.java @@ -9,11 +9,11 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; /** - * Defines headers for ListContainersSegment operation. + * Defines headers for ListBlobContainersSegment operation. */ -@JacksonXmlRootElement(localName = "Service-ListContainersSegment-Headers") +@JacksonXmlRootElement(localName = "Service-ListBlobContainersSegment-Headers") @Fluent -public final class ServiceListContainersSegmentHeaders { +public final class ServiceListBlobContainersSegmentHeaders { /* * If a client request id header is sent in the request, this header will * be present in the response with the same value. @@ -59,9 +59,9 @@ public String getClientRequestId() { * same value. * * @param clientRequestId the clientRequestId value to set. - * @return the ServiceListContainersSegmentHeaders object itself. + * @return the ServiceListBlobContainersSegmentHeaders object itself. */ - public ServiceListContainersSegmentHeaders setClientRequestId(String clientRequestId) { + public ServiceListBlobContainersSegmentHeaders setClientRequestId(String clientRequestId) { this.clientRequestId = clientRequestId; return this; } @@ -81,9 +81,9 @@ public String getRequestId() { * that was made and can be used for troubleshooting the request. * * @param requestId the requestId value to set. - * @return the ServiceListContainersSegmentHeaders object itself. + * @return the ServiceListBlobContainersSegmentHeaders object itself. */ - public ServiceListContainersSegmentHeaders setRequestId(String requestId) { + public ServiceListBlobContainersSegmentHeaders setRequestId(String requestId) { this.requestId = requestId; return this; } @@ -105,9 +105,9 @@ public String getVersion() { * against version 2009-09-19 and above. * * @param version the version value to set. - * @return the ServiceListContainersSegmentHeaders object itself. + * @return the ServiceListBlobContainersSegmentHeaders object itself. */ - public ServiceListContainersSegmentHeaders setVersion(String version) { + public ServiceListBlobContainersSegmentHeaders setVersion(String version) { this.version = version; return this; } @@ -125,9 +125,9 @@ public String getErrorCode() { * Set the errorCode property: The errorCode property. * * @param errorCode the errorCode value to set. - * @return the ServiceListContainersSegmentHeaders object itself. + * @return the ServiceListBlobContainersSegmentHeaders object itself. */ - public ServiceListContainersSegmentHeaders setErrorCode(String errorCode) { + public ServiceListBlobContainersSegmentHeaders setErrorCode(String errorCode) { this.errorCode = errorCode; return this; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetPropertiesResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetPropertiesResponse.java index 8259f6c7629b..33d406d5ae58 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetPropertiesResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetPropertiesResponse.java @@ -7,12 +7,12 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpRequest; import com.azure.core.http.rest.ResponseBase; -import com.azure.storage.blob.models.StorageServiceProperties; +import com.azure.storage.blob.models.BlobServiceProperties; /** * Contains all response data for the getProperties operation. */ -public final class ServicesGetPropertiesResponse extends ResponseBase { +public final class ServicesGetPropertiesResponse extends ResponseBase { /** * Creates an instance of ServicesGetPropertiesResponse. * @@ -22,7 +22,7 @@ public final class ServicesGetPropertiesResponse extends ResponseBase { +public final class ServicesListBlobContainersSegmentResponse extends ResponseBase { /** - * Creates an instance of ServicesListContainersSegmentResponse. + * Creates an instance of ServicesListBlobContainersSegmentResponse. * - * @param request the request which resulted in this ServicesListContainersSegmentResponse. + * @param request the request which resulted in this ServicesListBlobContainersSegmentResponse. * @param statusCode the status code of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param value the deserialized value of the HTTP response. * @param headers the deserialized headers of the HTTP response. */ - public ServicesListContainersSegmentResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, ListContainersSegmentResponse value, ServiceListContainersSegmentHeaders headers) { + public ServicesListBlobContainersSegmentResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, BlobContainersSegment value, ServiceListBlobContainersSegmentHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } @@ -29,7 +29,7 @@ public ServicesListContainersSegmentResponse(HttpRequest request, int statusCode * @return the deserialized response body. */ @Override - public ListContainersSegmentResponse getValue() { + public BlobContainersSegment getValue() { return super.getValue(); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItem.java index 075fe680dec7..28e75f1e2aa0 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItem.java @@ -46,7 +46,7 @@ public String getName() { * Set the name property: The name property. * * @param name the name value to set. - * @return the ContainerItem object itself. + * @return the BlobContainerItem object itself. */ public BlobContainerItem setName(String name) { this.name = name; @@ -66,7 +66,7 @@ public BlobContainerProperties getProperties() { * Set the properties property: The properties property. * * @param properties the properties value to set. - * @return the ContainerItem object itself. + * @return the BlobContainerItem object itself. */ public BlobContainerItem setProperties(BlobContainerProperties properties) { this.properties = properties; @@ -86,7 +86,7 @@ public Map getMetadata() { * Set the metadata property: The metadata property. * * @param metadata the metadata value to set. - * @return the ContainerItem object itself. + * @return the BlobContainerItem object itself. */ public BlobContainerItem setMetadata(Map metadata) { this.metadata = metadata; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerProperties.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerProperties.java index 9ce79fb00916..64160c276cc2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerProperties.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerProperties.java @@ -13,7 +13,7 @@ /** * Properties of a container. */ -@JacksonXmlRootElement(localName = "ContainerProperties") +@JacksonXmlRootElement(localName = "BlobContainerProperties") @Fluent public final class BlobContainerProperties { /* @@ -81,7 +81,7 @@ public OffsetDateTime getLastModified() { * Set the lastModified property: The lastModified property. * * @param lastModified the lastModified value to set. - * @return the ContainerProperties object itself. + * @return the BlobContainerProperties object itself. */ public BlobContainerProperties setLastModified(OffsetDateTime lastModified) { if (lastModified == null) { @@ -105,7 +105,7 @@ public String getEtag() { * Set the etag property: The etag property. * * @param etag the etag value to set. - * @return the ContainerProperties object itself. + * @return the BlobContainerProperties object itself. */ public BlobContainerProperties setEtag(String etag) { this.etag = etag; @@ -127,7 +127,7 @@ public LeaseStatusType getLeaseStatus() { * 'unlocked'. * * @param leaseStatus the leaseStatus value to set. - * @return the ContainerProperties object itself. + * @return the BlobContainerProperties object itself. */ public BlobContainerProperties setLeaseStatus(LeaseStatusType leaseStatus) { this.leaseStatus = leaseStatus; @@ -149,7 +149,7 @@ public LeaseStateType getLeaseState() { * 'leased', 'expired', 'breaking', 'broken'. * * @param leaseState the leaseState value to set. - * @return the ContainerProperties object itself. + * @return the BlobContainerProperties object itself. */ public BlobContainerProperties setLeaseState(LeaseStateType leaseState) { this.leaseState = leaseState; @@ -171,7 +171,7 @@ public LeaseDurationType getLeaseDuration() { * 'fixed'. * * @param leaseDuration the leaseDuration value to set. - * @return the ContainerProperties object itself. + * @return the BlobContainerProperties object itself. */ public BlobContainerProperties setLeaseDuration(LeaseDurationType leaseDuration) { this.leaseDuration = leaseDuration; @@ -193,7 +193,7 @@ public PublicAccessType getPublicAccess() { * 'blob'. * * @param publicAccess the publicAccess value to set. - * @return the ContainerProperties object itself. + * @return the BlobContainerProperties object itself. */ public BlobContainerProperties setPublicAccess(PublicAccessType publicAccess) { this.publicAccess = publicAccess; @@ -215,7 +215,7 @@ public Boolean isHasImmutabilityPolicy() { * property. * * @param hasImmutabilityPolicy the hasImmutabilityPolicy value to set. - * @return the ContainerProperties object itself. + * @return the BlobContainerProperties object itself. */ public BlobContainerProperties setHasImmutabilityPolicy(Boolean hasImmutabilityPolicy) { this.hasImmutabilityPolicy = hasImmutabilityPolicy; @@ -235,7 +235,7 @@ public Boolean isHasLegalHold() { * Set the hasLegalHold property: The hasLegalHold property. * * @param hasLegalHold the hasLegalHold value to set. - * @return the ContainerProperties object itself. + * @return the BlobContainerProperties object itself. */ public BlobContainerProperties setHasLegalHold(Boolean hasLegalHold) { this.hasLegalHold = hasLegalHold; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageServiceProperties.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobServiceProperties.java similarity index 84% rename from sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageServiceProperties.java rename to sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobServiceProperties.java index 6cf9ea619c36..254b6ea685be 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageServiceProperties.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobServiceProperties.java @@ -17,7 +17,7 @@ */ @JacksonXmlRootElement(localName = "StorageServiceProperties") @Fluent -public final class StorageServiceProperties { +public final class BlobServiceProperties { /* * The logging property. */ @@ -85,9 +85,9 @@ public Logging getLogging() { * Set the logging property: The logging property. * * @param logging the logging value to set. - * @return the StorageServiceProperties object itself. + * @return the BlobServiceProperties object itself. */ - public StorageServiceProperties setLogging(Logging logging) { + public BlobServiceProperties setLogging(Logging logging) { this.logging = logging; return this; } @@ -105,9 +105,9 @@ public Metrics getHourMetrics() { * Set the hourMetrics property: The hourMetrics property. * * @param hourMetrics the hourMetrics value to set. - * @return the StorageServiceProperties object itself. + * @return the BlobServiceProperties object itself. */ - public StorageServiceProperties setHourMetrics(Metrics hourMetrics) { + public BlobServiceProperties setHourMetrics(Metrics hourMetrics) { this.hourMetrics = hourMetrics; return this; } @@ -125,9 +125,9 @@ public Metrics getMinuteMetrics() { * Set the minuteMetrics property: The minuteMetrics property. * * @param minuteMetrics the minuteMetrics value to set. - * @return the StorageServiceProperties object itself. + * @return the BlobServiceProperties object itself. */ - public StorageServiceProperties setMinuteMetrics(Metrics minuteMetrics) { + public BlobServiceProperties setMinuteMetrics(Metrics minuteMetrics) { this.minuteMetrics = minuteMetrics; return this; } @@ -148,9 +148,9 @@ public List getCors() { * Set the cors property: The set of CORS rules. * * @param cors the cors value to set. - * @return the StorageServiceProperties object itself. + * @return the BlobServiceProperties object itself. */ - public StorageServiceProperties setCors(List cors) { + public BlobServiceProperties setCors(List cors) { this.cors = new CorsWrapper(cors); return this; } @@ -174,9 +174,9 @@ public String getDefaultServiceVersion() { * recent versions. * * @param defaultServiceVersion the defaultServiceVersion value to set. - * @return the StorageServiceProperties object itself. + * @return the BlobServiceProperties object itself. */ - public StorageServiceProperties setDefaultServiceVersion(String defaultServiceVersion) { + public BlobServiceProperties setDefaultServiceVersion(String defaultServiceVersion) { this.defaultServiceVersion = defaultServiceVersion; return this; } @@ -196,9 +196,9 @@ public RetentionPolicy getDeleteRetentionPolicy() { * property. * * @param deleteRetentionPolicy the deleteRetentionPolicy value to set. - * @return the StorageServiceProperties object itself. + * @return the BlobServiceProperties object itself. */ - public StorageServiceProperties setDeleteRetentionPolicy(RetentionPolicy deleteRetentionPolicy) { + public BlobServiceProperties setDeleteRetentionPolicy(RetentionPolicy deleteRetentionPolicy) { this.deleteRetentionPolicy = deleteRetentionPolicy; return this; } @@ -216,9 +216,9 @@ public StaticWebsite getStaticWebsite() { * Set the staticWebsite property: The staticWebsite property. * * @param staticWebsite the staticWebsite value to set. - * @return the StorageServiceProperties object itself. + * @return the BlobServiceProperties object itself. */ - public StorageServiceProperties setStaticWebsite(StaticWebsite staticWebsite) { + public BlobServiceProperties setStaticWebsite(StaticWebsite staticWebsite) { this.staticWebsite = staticWebsite; return this; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobContainersIncludeType.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobContainersIncludeType.java index dc7200e8b79b..03601bdcd962 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobContainersIncludeType.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobContainersIncludeType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Defines values for ListContainersIncludeType. + * Defines values for ListBlobContainersIncludeType. */ public enum ListBlobContainersIncludeType { /** @@ -17,7 +17,7 @@ public enum ListBlobContainersIncludeType { METADATA("metadata"); /** - * The actual serialized value for a ListContainersIncludeType instance. + * The actual serialized value for a ListBlobContainersIncludeType instance. */ private final String value; @@ -26,10 +26,10 @@ public enum ListBlobContainersIncludeType { } /** - * Parses a serialized value to a ListContainersIncludeType instance. + * Parses a serialized value to a ListBlobContainersIncludeType instance. * * @param value the serialized value to parse. - * @return the parsed ListContainersIncludeType object, or null if unable to parse. + * @return the parsed ListBlobContainersIncludeType object, or null if unable to parse. */ @JsonCreator public static ListBlobContainersIncludeType fromString(String value) { diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java index b5b7a22ead5b..417b87e53abd 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java @@ -5,12 +5,13 @@ import com.azure.core.util.Context; import com.azure.storage.blob.models.BlobContainerListDetails; +import com.azure.storage.blob.models.BlobServiceProperties; import com.azure.storage.blob.models.ListBlobContainersOptions; import com.azure.storage.blob.models.Logging; import com.azure.storage.blob.models.Metrics; import com.azure.storage.blob.models.PublicAccessType; import com.azure.storage.blob.models.RetentionPolicy; -import com.azure.storage.blob.models.StorageServiceProperties; + import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -119,14 +120,14 @@ public void getPropertiesWithResponse() { } /** - * Code snippet for {@link BlobServiceAsyncClient#setProperties(StorageServiceProperties)} + * Code snippet for {@link BlobServiceAsyncClient#setProperties(BlobServiceProperties)} */ public void setProperties() { - // BEGIN: com.azure.storage.blob.BlobServiceAsyncClient.setProperties#StorageServiceProperties + // BEGIN: com.azure.storage.blob.BlobServiceAsyncClient.setProperties#BlobServiceProperties RetentionPolicy loggingRetentionPolicy = new RetentionPolicy().setEnabled(true).setDays(3); RetentionPolicy metricsRetentionPolicy = new RetentionPolicy().setEnabled(true).setDays(1); - StorageServiceProperties properties = new StorageServiceProperties() + BlobServiceProperties properties = new BlobServiceProperties() .setLogging(new Logging() .setWrite(true) .setDelete(true) @@ -141,18 +142,18 @@ public void setProperties() { client.setProperties(properties).subscribe( response -> System.out.printf("Setting properties completed%n"), error -> System.out.printf("Setting properties failed: %s%n", error)); - // END: com.azure.storage.blob.BlobServiceAsyncClient.setProperties#StorageServiceProperties + // END: com.azure.storage.blob.BlobServiceAsyncClient.setProperties#BlobServiceProperties } /** - * Code snippet for {@link BlobServiceAsyncClient#setPropertiesWithResponse(StorageServiceProperties)} + * Code snippet for {@link BlobServiceAsyncClient#setPropertiesWithResponse(BlobServiceProperties)} */ public void setPropertiesWithResponse() { - // BEGIN: com.azure.storage.blob.BlobServiceAsyncClient.setPropertiesWithResponse#StorageServiceProperties + // BEGIN: com.azure.storage.blob.BlobServiceAsyncClient.setPropertiesWithResponse#BlobServiceProperties RetentionPolicy loggingRetentionPolicy = new RetentionPolicy().setEnabled(true).setDays(3); RetentionPolicy metricsRetentionPolicy = new RetentionPolicy().setEnabled(true).setDays(1); - StorageServiceProperties properties = new StorageServiceProperties() + BlobServiceProperties properties = new BlobServiceProperties() .setLogging(new Logging() .setWrite(true) .setDelete(true) @@ -166,7 +167,7 @@ public void setPropertiesWithResponse() { client.setPropertiesWithResponse(properties).subscribe(response -> System.out.printf("Setting properties completed with status %d%n", response.getStatusCode())); - // END: com.azure.storage.blob.BlobServiceAsyncClient.setPropertiesWithResponse#StorageServiceProperties + // END: com.azure.storage.blob.BlobServiceAsyncClient.setPropertiesWithResponse#BlobServiceProperties } /** diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java index 6c499f745c80..9c247a895441 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java @@ -5,13 +5,14 @@ import com.azure.core.util.Context; import com.azure.storage.blob.models.BlobContainerListDetails; +import com.azure.storage.blob.models.BlobServiceProperties; import com.azure.storage.blob.models.ListBlobContainersOptions; import com.azure.storage.blob.models.Logging; import com.azure.storage.blob.models.Metrics; import com.azure.storage.blob.models.PublicAccessType; import com.azure.storage.blob.models.RetentionPolicy; import com.azure.storage.blob.models.StorageAccountInfo; -import com.azure.storage.blob.models.StorageServiceProperties; + import java.time.Duration; import java.time.OffsetDateTime; import java.util.Collections; @@ -107,7 +108,7 @@ public void listContainers() { */ public void getProperties() { // BEGIN: com.azure.storage.blob.BlobServiceClient.getProperties - StorageServiceProperties properties = client.getProperties(); + BlobServiceProperties properties = client.getProperties(); System.out.printf("Hour metrics enabled: %b, Minute metrics enabled: %b%n", properties.getHourMetrics().isEnabled(), @@ -121,7 +122,7 @@ public void getProperties() { public void getPropertiesWithResponse() { // BEGIN: com.azure.storage.blob.BlobServiceClient.getPropertiesWithResponse#Duration-Context Context context = new Context("Key", "Value"); - StorageServiceProperties properties = client.getPropertiesWithResponse(timeout, context).getValue(); + BlobServiceProperties properties = client.getPropertiesWithResponse(timeout, context).getValue(); System.out.printf("Hour metrics enabled: %b, Minute metrics enabled: %b%n", properties.getHourMetrics().isEnabled(), @@ -130,14 +131,14 @@ public void getPropertiesWithResponse() { } /** - * Code snippet for {@link BlobServiceClient#setProperties(StorageServiceProperties)} + * Code snippet for {@link BlobServiceClient#setProperties(BlobServiceProperties)} */ public void setProperties() { - // BEGIN: com.azure.storage.blob.BlobServiceClient.setProperties#StorageServiceProperties + // BEGIN: com.azure.storage.blob.BlobServiceClient.setProperties#BlobServiceProperties RetentionPolicy loggingRetentionPolicy = new RetentionPolicy().setEnabled(true).setDays(3); RetentionPolicy metricsRetentionPolicy = new RetentionPolicy().setEnabled(true).setDays(1); - StorageServiceProperties properties = new StorageServiceProperties() + BlobServiceProperties properties = new BlobServiceProperties() .setLogging(new Logging() .setWrite(true) .setDelete(true) @@ -155,18 +156,18 @@ public void setProperties() { } catch (UnsupportedOperationException error) { System.out.printf("Setting properties failed: %s%n", error); } - // END: com.azure.storage.blob.BlobServiceClient.setProperties#StorageServiceProperties + // END: com.azure.storage.blob.BlobServiceClient.setProperties#BlobServiceProperties } /** - * Code snippet for {@link BlobServiceClient#setPropertiesWithResponse(StorageServiceProperties, Duration, Context)} + * Code snippet for {@link BlobServiceClient#setPropertiesWithResponse(BlobServiceProperties, Duration, Context)} */ public void setPropertiesWithResponse() { - // BEGIN: com.azure.storage.blob.BlobServiceClient.setPropertiesWithResponse#StorageServiceProperties-Duration-Context + // BEGIN: com.azure.storage.blob.BlobServiceClient.setPropertiesWithResponse#BlobServiceProperties-Duration-Context RetentionPolicy loggingRetentionPolicy = new RetentionPolicy().setEnabled(true).setDays(3); RetentionPolicy metricsRetentionPolicy = new RetentionPolicy().setEnabled(true).setDays(1); - StorageServiceProperties properties = new StorageServiceProperties() + BlobServiceProperties properties = new BlobServiceProperties() .setLogging(new Logging() .setWrite(true) .setDelete(true) @@ -182,7 +183,7 @@ public void setPropertiesWithResponse() { System.out.printf("Setting properties completed with status %d%n", client.setPropertiesWithResponse(properties, timeout, context).getStatusCode()); - // END: com.azure.storage.blob.BlobServiceClient.setPropertiesWithResponse#StorageServiceProperties-Duration-Context + // END: com.azure.storage.blob.BlobServiceClient.setPropertiesWithResponse#BlobServiceProperties-Duration-Context } /** diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/APISpec.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/APISpec.groovy index b3e68437b3bc..898a72a38b97 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/APISpec.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/APISpec.groovy @@ -25,11 +25,11 @@ import com.azure.core.util.Configuration import com.azure.core.util.logging.ClientLogger import com.azure.identity.credential.EnvironmentCredentialBuilder import com.azure.storage.blob.models.BlobContainerItem +import com.azure.storage.blob.models.BlobServiceProperties import com.azure.storage.blob.models.CopyStatusType import com.azure.storage.blob.models.LeaseStateType import com.azure.storage.blob.models.ListBlobContainersOptions import com.azure.storage.blob.models.RetentionPolicy -import com.azure.storage.blob.models.StorageServiceProperties import com.azure.storage.blob.specialized.BlobAsyncClientBase import com.azure.storage.blob.specialized.BlobClientBase import com.azure.storage.blob.specialized.LeaseClient @@ -657,14 +657,14 @@ class APISpec extends Specification { } def enableSoftDelete() { - primaryBlobServiceClient.setProperties(new StorageServiceProperties() + primaryBlobServiceClient.setProperties(new BlobServiceProperties() .setDeleteRetentionPolicy(new RetentionPolicy().setEnabled(true).setDays(2))) sleepIfRecord(30000) } def disableSoftDelete() { - primaryBlobServiceClient.setProperties(new StorageServiceProperties() + primaryBlobServiceClient.setProperties(new BlobServiceProperties() .setDeleteRetentionPolicy(new RetentionPolicy().setEnabled(false))) sleepIfRecord(30000) diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ServiceAPITest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ServiceAPITest.groovy index bf77476d5d4d..815c663c2014 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ServiceAPITest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ServiceAPITest.groovy @@ -7,6 +7,7 @@ import com.azure.core.http.HttpHeaders import com.azure.core.http.rest.Response import com.azure.storage.blob.models.BlobContainerItem import com.azure.storage.blob.models.BlobContainerListDetails +import com.azure.storage.blob.models.BlobServiceProperties import com.azure.storage.blob.models.CorsRule import com.azure.storage.blob.models.ListBlobContainersOptions import com.azure.storage.blob.models.Logging @@ -16,7 +17,6 @@ import com.azure.storage.blob.models.RetentionPolicy import com.azure.storage.blob.models.StaticWebsite import com.azure.storage.blob.models.StorageAccountInfo import com.azure.storage.blob.models.StorageException -import com.azure.storage.blob.models.StorageServiceProperties import com.azure.storage.blob.models.StorageServiceStats import com.azure.storage.blob.models.UserDelegationKey import com.azure.storage.common.credentials.SharedKeyCredential @@ -29,7 +29,7 @@ import java.time.OffsetDateTime class ServiceAPITest extends APISpec { def setup() { RetentionPolicy disabled = new RetentionPolicy().setEnabled(false) - primaryBlobServiceClient.setProperties(new StorageServiceProperties() + primaryBlobServiceClient.setProperties(new BlobServiceProperties() .setStaticWebsite(new StaticWebsite().setEnabled(false)) .setDeleteRetentionPolicy(disabled) .setCors(null) @@ -44,7 +44,7 @@ class ServiceAPITest extends APISpec { def cleanup() { RetentionPolicy disabled = new RetentionPolicy().setEnabled(false) - primaryBlobServiceClient.setProperties(new StorageServiceProperties() + primaryBlobServiceClient.setProperties(new BlobServiceProperties() .setStaticWebsite(new StaticWebsite().setEnabled(false)) .setDeleteRetentionPolicy(disabled) .setCors(null) @@ -160,7 +160,7 @@ class ServiceAPITest extends APISpec { containers.each { container -> container.delete() } } - def validatePropsSet(StorageServiceProperties sent, StorageServiceProperties received) { + def validatePropsSet(BlobServiceProperties sent, BlobServiceProperties received) { return received.getLogging().isRead() == sent.getLogging().isRead() && received.getLogging().isDelete() == sent.getLogging().isDelete() && received.getLogging().isWrite() == sent.getLogging().isWrite() && @@ -217,7 +217,7 @@ class ServiceAPITest extends APISpec { .setIndexDocument("myIndex.html") .setErrorDocument404Path("custom/error/path.html") - StorageServiceProperties sentProperties = new StorageServiceProperties() + BlobServiceProperties sentProperties = new BlobServiceProperties() .setLogging(logging).setCors(corsRules).setDefaultServiceVersion(defaultServiceVersion) .setMinuteMetrics(minuteMetrics).setHourMetrics(hourMetrics) .setDeleteRetentionPolicy(retentionPolicy) @@ -228,7 +228,7 @@ class ServiceAPITest extends APISpec { // Service properties may take up to 30s to take effect. If they weren't already in place, wait. sleepIfRecord(30 * 1000) - StorageServiceProperties receivedProperties = primaryBlobServiceClient.getProperties() + BlobServiceProperties receivedProperties = primaryBlobServiceClient.getProperties() then: headers.getValue("x-ms-request-id") != null @@ -258,7 +258,7 @@ class ServiceAPITest extends APISpec { .setIndexDocument("myIndex.html") .setErrorDocument404Path("custom/error/path.html") - StorageServiceProperties sentProperties = new StorageServiceProperties() + BlobServiceProperties sentProperties = new BlobServiceProperties() .setLogging(logging).setCors(corsRules).setDefaultServiceVersion(defaultServiceVersion) .setMinuteMetrics(minuteMetrics).setHourMetrics(hourMetrics) .setDeleteRetentionPolicy(retentionPolicy) @@ -271,7 +271,7 @@ class ServiceAPITest extends APISpec { def "Set props error"() { when: getServiceClient(primaryCredential, "https://error.blob.core.windows.net") - .setProperties(new StorageServiceProperties()) + .setProperties(new BlobServiceProperties()) then: thrown(StorageException) diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 74946d46356e..f4b3c334abc7 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -34,7 +34,7 @@ sync-methods: none license-header: MICROSOFT_MIT_SMALL add-context-parameter: true models-subpackage: implementation.models -custom-types: AccessPolicy,AccessTier,AccountKind,AppendPositionAccessConditions,ArchiveStatus,BlobDownloadHeaders,BlobHTTPHeaders,BlobItem,BlobProperties,BlobType,Block,BlockList,BlockListType,BlockLookupList,BlobPrefix,ClearRange,ContainerItem,ContainerProperties,CopyStatusType,CorsRule,CpkInfo,CustomerProvidedKeyInfo,DataLakeStorageError,DataLakeStorageErrorError,DataLakeStorageErrorException,DeleteSnapshotsOptionType,EncryptionAlgorithmType,FilterBlobsItem,GeoReplication,GeoReplicationStatusType,KeyInfo,LeaseAccessConditions,LeaseDurationType,LeaseStateType,LeaseStatusType,ListBlobsIncludeItem,ListContainersIncludeType,Logging,Metrics,ModifiedAccessConditions,PageList,PageRange,PathRenameMode,PublicAccessType,RehydratePriority,RetentionPolicy,SequenceNumberAccessConditions,SequenceNumberActionType,SignedIdentifier,SkuName,SourceModifiedAccessConditions,StaticWebsite,StorageError,StorageErrorCode,StorageErrorException,StorageServiceProperties,StorageServiceStats,SyncCopyStatusType,UserDelegationKey +custom-types: AccessPolicy,AccessTier,AccountKind,AppendPositionAccessConditions,ArchiveStatus,BlobDownloadHeaders,BlobHTTPHeaders,BlobContainerItem,BlobItem,BlobContainerProperties,BlobProperties,BlobServiceProperties,BlobType,Block,BlockList,BlockListType,BlockLookupList,BlobPrefix,ClearRange,CopyStatusType,CorsRule,CpkInfo,CustomerProvidedKeyInfo,DeleteSnapshotsOptionType,EncryptionAlgorithmType,FilterBlobsItem,GeoReplication,GeoReplicationStatusType,KeyInfo,LeaseAccessConditions,LeaseDurationType,LeaseStateType,LeaseStatusType,ListBlobContainersIncludeType,ListBlobsIncludeItem,Logging,Metrics,ModifiedAccessConditions,PageList,PageRange,PathRenameMode,PublicAccessType,RehydratePriority,RetentionPolicy,SequenceNumberAccessConditions,SequenceNumberActionType,SignedIdentifier,SkuName,SourceModifiedAccessConditions,StaticWebsite,StorageError,StorageErrorCode,StorageErrorException,StorageServiceStats,SyncCopyStatusType,UserDelegationKey custom-types-subpackage: models ``` @@ -726,19 +726,6 @@ directive: } ``` -### ListContainersSegmentResponse -``` yaml -directive: -- from: swagger-document - where: $.definitions.ListContainersSegmentResponse - transform: > - if (!$.required.includes("Prefix")) { - $.required.push("Prefix"); - $.required.push("MaxResults"); - $.required.push("NextMarker"); - } -``` - ### SignedIdentifier ``` yaml directive: @@ -935,3 +922,84 @@ directive: $["202"] = response; } ``` + +### Rename ListContainersIncludeType to ListBlobContainersIncludeType +``` yaml +directive: +- from: swagger-document + where: $.parameters.ListContainersInclude + transform: > + $["x-ms-enum"].name = "ListBlobContainersIncludeType"; +``` + +### /?restype=service&comp=properties +``` yaml +directive: +- from: swagger-document + where: $.definitions + transform: > + if (!$.BlobServiceProperties) { + $.BlobServiceProperties = $.StorageServiceProperties; + delete $.StorageServiceProperties; + $.BlobServiceProperties.xml = { "name": "StorageServiceProperties" }; + } + if (!$.BlobContainerProperties) { + $.BlobContainerProperties = $.ContainerProperties; + delete $.ContainerProperties; + } + if (!$.BlobContainerItem) { + $.BlobContainerItem = $.ContainerItem; + const path = $.BlobContainerItem.properties.Properties.$ref.replace(/[#].*$/, "#/definitions/BlobContainerProperties"); + $.BlobContainerItem.properties.Properties.$ref = path; + delete $.ContainerItem; + } +- from: swagger-document + where: $.parameters + transform: > + if (!$.BlobServiceProperties) { + const props = $.BlobServiceProperties = $.StorageServiceProperties; + props.name = "BlobServiceProperties"; + props.schema = { "$ref": props.schema.$ref.replace(/[#].*$/, "#/definitions/BlobServiceProperties") }; + delete $.StorageServiceProperties; + } +- from: swagger-document + where: $["x-ms-paths"]["/?restype=service&comp=properties"] + transform: > + const param = $.put.parameters[0]; + if (param && param["$ref"] && param["$ref"].endsWith("StorageServiceProperties")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/BlobServiceProperties"); + $.put.parameters[0] = { "$ref": path }; + } + const def = $.get.responses["200"].schema; + if (def && def["$ref"] && def["$ref"].endsWith("StorageServiceProperties")) { + const path = def["$ref"].replace(/[#].*$/, "#/definitions/BlobServiceProperties"); + $.get.responses["200"].schema = { "$ref": path }; + } +``` + +### /?comp=list +``` yaml +directive: +- from: swagger-document + where: $.definitions + transform: > + if (!$.BlobContainersSegment) { + $.BlobContainersSegment = $.ListContainersSegmentResponse; + delete $.ListContainersSegmentResponse; + $.BlobContainersSegment["x-az-public"] = false; + $.BlobContainersSegment.required.push("NextMarker"); + $.BlobContainersSegment.properties.BlobContainerItems = $.BlobContainersSegment.properties.ContainerItems; + delete $.BlobContainersSegment.properties.ContainerItems; + const path = $.BlobContainersSegment.properties.BlobContainerItems.items.$ref.replace(/[#].*$/, "#/definitions/BlobContainerItem"); + $.BlobContainersSegment.properties.BlobContainerItems.items.$ref = path; + } +- from: swagger-document + where: $["x-ms-paths"]["/?comp=list"] + transform: > + const def = $.get.responses["200"].schema; + if (def && def["$ref"] && !def["$ref"].endsWith("BlobContainersSegment")) { + const path = def["$ref"].replace(/[#].*$/, "#/definitions/BlobContainersSegment"); + $.get.responses["200"].schema = { "$ref": path }; + } + $.get.operationId = "Service_ListBlobContainersSegment"; +```