diff --git a/BreakingChanges.txt b/BreakingChanges.txt index 5dff86487..2f414f11e 100644 --- a/BreakingChanges.txt +++ b/BreakingChanges.txt @@ -1,4 +1,9 @@ -2018.07.03 Version 10.0.1-Preview +2018.08.07 Version 10.0.2-Preview +* Changed BlobListingDetails constructor to take a flag to include deleted blobs. +* Restructured the blob and container listing responses. +* BlockBlobURL.MAX_PUT_BLOCK_BYTES renamed to BlockBlobURL.MAX_STAGE_BLOCK_BYTES. + +2018.07.03 Version 10.0.1-Preview * Created the StorageException type, which deserializes the XML payload in an error response if present and gives access to the ErrorCode header as a property. * Changed the AppendBlobAccessConditions field types to be Long instead of Int. * Changed RequestRetryOptions maxTries and tryTimeout fields to be Integer instead of int. 0 is no longer allowed. diff --git a/ChangeLog.txt b/ChangeLog.txt index fa8937fe3..83b6af3ab 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +2018.08.07 Version 10.0.2-Preview +* Support for 2017-07-29 REST version. Please see our REST api documentation and blogs for information about the related added features. +* Support for setting a block blob's tier. +* Added support for soft delete feature. If a delete retention policy is enabled through the set service properties API, then blobs or snapshots can be deleted softly and retained for a specified number of days, before being permanently removed by garbage collection. +* Changed BlobListingDetails constructor to take a flag to include deleted blobs. +* Restructured the blob and container listing responses. +* BlockBlobURL.MAX_PUT_BLOCK_BYTES renamed to BlockBlobURL.MAX_STAGE_BLOCK_BYTES. + 2018.07.03 Version 10.0.1-Preview * Added the RetryReader class to allow for more reliable streaming on large downloads. This is now the return type of blobURL.download * Fixed a bug that caused generation of signatures to fail at high levels of parallelism. diff --git a/README.md b/README.md index 5b6814eb7..05b3cbff1 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ To get the binaries of this library as distributed by Microsoft, ready for use w com.microsoft.azure azure-storage-blob - 10.0.1-Preview + 10.0.2-Preview ``` diff --git a/docs/com/microsoft/azure/storage/blob/BlockBlobURL.html b/docs/com/microsoft/azure/storage/blob/BlockBlobURL.html index f67ad097b..95e67b506 100644 --- a/docs/com/microsoft/azure/storage/blob/BlockBlobURL.html +++ b/docs/com/microsoft/azure/storage/blob/BlockBlobURL.html @@ -311,7 +311,7 @@

MAX_PUT_BLOCK_BYTES

Indicates the maximum number of bytes that can be sent in a call to stageBlock.
See Also:
-
Constant Field Values
+
Constant Field Values
diff --git a/pom.xml b/pom.xml index 6dc6f8256..515b44190 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.microsoft.azure azure-storage-blob - 10.0.1-Preview + 10.0.2-Preview Azure Storage Blob The Azure Storage Java Blob library. @@ -65,7 +65,7 @@ com.microsoft.rest.v2 client-runtime - 2.0.0-beta3 + 2.0.0-beta4 junit @@ -128,6 +128,32 @@ + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.1 + + + + + api_1.8 + https://docs.oracle.com/javase/8/docs/api/ + + + + + + + + + apiNote + m + API Note: + + + + org.apache.maven.plugins maven-release-plugin diff --git a/src/main/java/com/microsoft/azure/storage/GeneratedAppendBlobs.java b/src/main/java/com/microsoft/azure/storage/GeneratedAppendBlobs.java index 0510211b8..05b7b2a91 100644 --- a/src/main/java/com/microsoft/azure/storage/GeneratedAppendBlobs.java +++ b/src/main/java/com/microsoft/azure/storage/GeneratedAppendBlobs.java @@ -10,8 +10,8 @@ package com.microsoft.azure.storage; -import com.microsoft.azure.storage.blob.models.AppendBlobsAppendBlockResponse; -import com.microsoft.azure.storage.blob.models.AppendBlobsCreateResponse; +import com.microsoft.azure.storage.blob.models.AppendBlobAppendBlockResponse; +import com.microsoft.azure.storage.blob.models.AppendBlobCreateResponse; import com.microsoft.azure.storage.blob.models.StorageErrorException; import com.microsoft.rest.v2.DateTimeRfc1123; import com.microsoft.rest.v2.RestProxy; @@ -70,12 +70,12 @@ private interface AppendBlobsService { @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single create(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType); + Single create(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType); @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single appendBlock(@HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") Flowable body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single appendBlock(@HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") Flowable body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); } /** @@ -151,7 +151,7 @@ public ServiceFuture createAsync(@NonNull long contentLength, Integer time * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single createWithRestResponseAsync(@NonNull long contentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single createWithRestResponseAsync(@NonNull long contentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -259,7 +259,7 @@ public ServiceFuture appendBlockAsync(@NonNull Flowable body, * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single appendBlockWithRestResponseAsync(@NonNull Flowable body, @NonNull long contentLength, Integer timeout, String leaseId, Long maxSize, Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single appendBlockWithRestResponseAsync(@NonNull Flowable body, @NonNull long contentLength, Integer timeout, String leaseId, Long maxSize, Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } diff --git a/src/main/java/com/microsoft/azure/storage/GeneratedBlobs.java b/src/main/java/com/microsoft/azure/storage/GeneratedBlobs.java index 7fbd92614..866595062 100644 --- a/src/main/java/com/microsoft/azure/storage/GeneratedBlobs.java +++ b/src/main/java/com/microsoft/azure/storage/GeneratedBlobs.java @@ -11,21 +11,22 @@ package com.microsoft.azure.storage; import com.microsoft.azure.storage.blob.models.AccessTier; -import com.microsoft.azure.storage.blob.models.BlobsAbortCopyFromURLResponse; -import com.microsoft.azure.storage.blob.models.BlobsAcquireLeaseResponse; -import com.microsoft.azure.storage.blob.models.BlobsBreakLeaseResponse; -import com.microsoft.azure.storage.blob.models.BlobsChangeLeaseResponse; -import com.microsoft.azure.storage.blob.models.BlobsCreateSnapshotResponse; -import com.microsoft.azure.storage.blob.models.BlobsDeleteResponse; -import com.microsoft.azure.storage.blob.models.BlobsDownloadResponse; -import com.microsoft.azure.storage.blob.models.BlobsGetPropertiesResponse; -import com.microsoft.azure.storage.blob.models.BlobsReleaseLeaseResponse; -import com.microsoft.azure.storage.blob.models.BlobsRenewLeaseResponse; -import com.microsoft.azure.storage.blob.models.BlobsSetHTTPHeadersResponse; -import com.microsoft.azure.storage.blob.models.BlobsSetMetadataResponse; -import com.microsoft.azure.storage.blob.models.BlobsSetTierResponse; -import com.microsoft.azure.storage.blob.models.BlobsStartCopyFromURLResponse; -import com.microsoft.azure.storage.blob.models.BlobsUndeleteResponse; +import com.microsoft.azure.storage.blob.models.BlobAbortCopyFromURLResponse; +import com.microsoft.azure.storage.blob.models.BlobAcquireLeaseResponse; +import com.microsoft.azure.storage.blob.models.BlobBreakLeaseResponse; +import com.microsoft.azure.storage.blob.models.BlobChangeLeaseResponse; +import com.microsoft.azure.storage.blob.models.BlobCreateSnapshotResponse; +import com.microsoft.azure.storage.blob.models.BlobDeleteResponse; +import com.microsoft.azure.storage.blob.models.BlobDownloadResponse; +import com.microsoft.azure.storage.blob.models.BlobGetAccountInfoResponse; +import com.microsoft.azure.storage.blob.models.BlobGetPropertiesResponse; +import com.microsoft.azure.storage.blob.models.BlobReleaseLeaseResponse; +import com.microsoft.azure.storage.blob.models.BlobRenewLeaseResponse; +import com.microsoft.azure.storage.blob.models.BlobSetHTTPHeadersResponse; +import com.microsoft.azure.storage.blob.models.BlobSetMetadataResponse; +import com.microsoft.azure.storage.blob.models.BlobSetTierResponse; +import com.microsoft.azure.storage.blob.models.BlobStartCopyFromURLResponse; +import com.microsoft.azure.storage.blob.models.BlobUndeleteResponse; import com.microsoft.azure.storage.blob.models.DeleteSnapshotsOptionType; import com.microsoft.azure.storage.blob.models.StorageErrorException; import com.microsoft.rest.v2.DateTimeRfc1123; @@ -89,77 +90,82 @@ private interface BlobsService { @GET("{containerName}/{blob}") @ExpectedResponses({200, 206}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single download(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId); + Single download(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId); @HEAD("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single getProperties(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId); + Single getProperties(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId); @DELETE("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single delete(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @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 ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId); + Single delete(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @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 ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId); @PUT("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single undelete(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single undelete(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @PUT("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single setHTTPHeaders(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single setHTTPHeaders(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @PUT("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single setMetadata(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single setMetadata(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single acquireLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); + Single acquireLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); @PUT("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single releaseLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); + Single releaseLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); @PUT("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single renewLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); + Single renewLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); @PUT("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single changeLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); + Single changeLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); @PUT("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single breakLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); + Single breakLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action); @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single createSnapshot(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single createSnapshot(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @PUT("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single startCopyFromURL(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatches, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId); + Single startCopyFromURL(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatches, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId); @PUT("{containerName}/{blob}") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single abortCopyFromURL(@HostParam("url") String url, @QueryParam("copyid") String copyId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant); + Single abortCopyFromURL(@HostParam("url") String url, @QueryParam("copyid") String copyId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant); @PUT("{containerName}/{blob}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single setTier(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-access-tier") AccessTier tier, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single setTier(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-access-tier") AccessTier tier, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + + @GET("{containerName}/{blobName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageErrorException.class) + Single getAccountInfo(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp); } /** @@ -221,7 +227,7 @@ public ServiceFuture> downloadAsync(String snapshot, Intege * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single downloadWithRestResponseAsync(String snapshot, Integer timeout, String range, String leaseId, Boolean rangeGetContentMD5, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single downloadWithRestResponseAsync(String snapshot, Integer timeout, String range, String leaseId, Boolean rangeGetContentMD5, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -257,7 +263,7 @@ public Single downloadWithRestResponseAsync(String snapsh */ public Maybe> downloadAsync(String snapshot, Integer timeout, String range, String leaseId, Boolean rangeGetContentMD5, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { return downloadWithRestResponseAsync(snapshot, timeout, range, leaseId, rangeGetContentMD5, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, requestId) - .flatMapMaybe((BlobsDownloadResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BlobDownloadResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -312,7 +318,7 @@ public ServiceFuture getPropertiesAsync(String snapshot, Integer timeout, * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single getPropertiesWithRestResponseAsync(String snapshot, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single getPropertiesWithRestResponseAsync(String snapshot, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -404,7 +410,7 @@ public ServiceFuture deleteAsync(String snapshot, Integer timeout, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single deleteWithRestResponseAsync(String snapshot, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single deleteWithRestResponseAsync(String snapshot, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -476,7 +482,7 @@ public ServiceFuture undeleteAsync(Integer timeout, String requestId, Serv * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single undeleteWithRestResponseAsync(Integer timeout, String requestId) { + public Single undeleteWithRestResponseAsync(Integer timeout, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -567,7 +573,7 @@ public ServiceFuture setHTTPHeadersAsync(Integer timeout, String blobCache * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single setHTTPHeadersWithRestResponseAsync(Integer timeout, String blobCacheControl, String blobContentType, byte[] blobContentMD5, String blobContentEncoding, String blobContentLanguage, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String blobContentDisposition, String requestId) { + public Single setHTTPHeadersWithRestResponseAsync(Integer timeout, String blobCacheControl, String blobContentType, byte[] blobContentMD5, String blobContentEncoding, String blobContentLanguage, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String blobContentDisposition, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -663,7 +669,7 @@ public ServiceFuture setMetadataAsync(Integer timeout, Map * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single setMetadataWithRestResponseAsync(Integer timeout, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single setMetadataWithRestResponseAsync(Integer timeout, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -754,7 +760,7 @@ public ServiceFuture acquireLeaseAsync(Integer timeout, Integer duration, * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single acquireLeaseWithRestResponseAsync(Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single acquireLeaseWithRestResponseAsync(Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -842,7 +848,7 @@ public ServiceFuture releaseLeaseAsync(@NonNull String leaseId, Integer ti * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single releaseLeaseWithRestResponseAsync(@NonNull String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single releaseLeaseWithRestResponseAsync(@NonNull String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -932,7 +938,7 @@ public ServiceFuture renewLeaseAsync(@NonNull String leaseId, Integer time * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single renewLeaseWithRestResponseAsync(@NonNull String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single renewLeaseWithRestResponseAsync(@NonNull String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1025,7 +1031,7 @@ public ServiceFuture changeLeaseAsync(@NonNull String leaseId, @NonNull St * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single changeLeaseWithRestResponseAsync(@NonNull String leaseId, @NonNull String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single changeLeaseWithRestResponseAsync(@NonNull String leaseId, @NonNull String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1119,7 +1125,7 @@ public ServiceFuture breakLeaseAsync(Integer timeout, Integer breakPeriod, * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single breakLeaseWithRestResponseAsync(Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single breakLeaseWithRestResponseAsync(Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1209,7 +1215,7 @@ public ServiceFuture createSnapshotAsync(Integer timeout, Map createSnapshotWithRestResponseAsync(Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId) { + public Single createSnapshotWithRestResponseAsync(Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1263,14 +1269,13 @@ public Completable createSnapshotAsync(Integer timeout, Map meta * @param ifMatches Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID. - * @param sourceLeaseId Specify this header to perform the operation only if the lease ID given matches the active lease ID of the source blob. * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws StorageErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void startCopyFromURL(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String sourceLeaseId, String requestId) { - startCopyFromURLAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, sourceLeaseId, requestId).blockingAwait(); + public void startCopyFromURL(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId) { + startCopyFromURLAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, requestId).blockingAwait(); } /** @@ -1288,14 +1293,13 @@ public void startCopyFromURL(@NonNull URL copySource, Integer timeout, Map startCopyFromURLAsync(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String sourceLeaseId, String requestId, ServiceCallback serviceCallback) { - return ServiceFuture.fromBody(startCopyFromURLAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, sourceLeaseId, requestId), serviceCallback); + public ServiceFuture startCopyFromURLAsync(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId, ServiceCallback serviceCallback) { + return ServiceFuture.fromBody(startCopyFromURLAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, requestId), serviceCallback); } /** @@ -1313,12 +1317,11 @@ public ServiceFuture startCopyFromURLAsync(@NonNull URL copySource, Intege * @param ifMatches Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID. - * @param sourceLeaseId Specify this header to perform the operation only if the lease ID given matches the active lease ID of the source blob. * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single startCopyFromURLWithRestResponseAsync(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String sourceLeaseId, String requestId) { + public Single startCopyFromURLWithRestResponseAsync(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1346,7 +1349,7 @@ public Single startCopyFromURLWithRestResponseAsy if (ifUnmodifiedSince != null) { ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince); } - return service.startCopyFromURL(this.client.url(), timeout, metadata, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatches, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatches, ifNoneMatch, copySource, leaseId, sourceLeaseId, this.client.version(), requestId); + return service.startCopyFromURL(this.client.url(), timeout, metadata, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatches, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatches, ifNoneMatch, copySource, leaseId, this.client.version(), requestId); } /** @@ -1364,13 +1367,12 @@ public Single startCopyFromURLWithRestResponseAsy * @param ifMatches Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID. - * @param sourceLeaseId Specify this header to perform the operation only if the lease ID given matches the active lease ID of the source blob. * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable startCopyFromURLAsync(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String sourceLeaseId, String requestId) { - return startCopyFromURLWithRestResponseAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, sourceLeaseId, requestId) + public Completable startCopyFromURLAsync(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId) { + return startCopyFromURLWithRestResponseAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, requestId) .toCompletable(); } @@ -1414,7 +1416,7 @@ public ServiceFuture abortCopyFromURLAsync(@NonNull String copyId, Integer * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single abortCopyFromURLWithRestResponseAsync(@NonNull String copyId, Integer timeout, String leaseId, String requestId) { + public Single abortCopyFromURLWithRestResponseAsync(@NonNull String copyId, Integer timeout, String leaseId, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1481,7 +1483,7 @@ public ServiceFuture setTierAsync(@NonNull AccessTier tier, Integer timeou * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single setTierWithRestResponseAsync(@NonNull AccessTier tier, Integer timeout, String requestId) { + public Single setTierWithRestResponseAsync(@NonNull AccessTier tier, Integer timeout, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1508,4 +1510,52 @@ public Completable setTierAsync(@NonNull AccessTier tier, Integer timeout, Strin return setTierWithRestResponseAsync(tier, timeout, requestId) .toCompletable(); } + + /** + * Returns the sku name and account kind. + * + * @throws StorageErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + public void getAccountInfo() { + getAccountInfoAsync().blockingAwait(); + } + + /** + * Returns the sku name and account kind. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a ServiceFuture which will be completed with the result of the network request. + */ + public ServiceFuture getAccountInfoAsync(ServiceCallback serviceCallback) { + return ServiceFuture.fromBody(getAccountInfoAsync(), serviceCallback); + } + + /** + * Returns the sku name and account kind. + * + * @return a Single which performs the network request upon subscription. + */ + public Single getAccountInfoWithRestResponseAsync() { + if (this.client.url() == null) { + throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); + } + if (this.client.version() == null) { + throw new IllegalArgumentException("Parameter this.client.version() is required and cannot be null."); + } + final String restype = "account"; + final String comp = "properties"; + return service.getAccountInfo(this.client.url(), this.client.version(), restype, comp); + } + + /** + * Returns the sku name and account kind. + * + * @return a Single which performs the network request upon subscription. + */ + public Completable getAccountInfoAsync() { + return getAccountInfoWithRestResponseAsync() + .toCompletable(); + } } diff --git a/src/main/java/com/microsoft/azure/storage/GeneratedBlockBlobs.java b/src/main/java/com/microsoft/azure/storage/GeneratedBlockBlobs.java index 928698d2d..88f33e6e3 100644 --- a/src/main/java/com/microsoft/azure/storage/GeneratedBlockBlobs.java +++ b/src/main/java/com/microsoft/azure/storage/GeneratedBlockBlobs.java @@ -10,10 +10,11 @@ package com.microsoft.azure.storage; -import com.microsoft.azure.storage.blob.models.BlockBlobsCommitBlockListResponse; -import com.microsoft.azure.storage.blob.models.BlockBlobsGetBlockListResponse; -import com.microsoft.azure.storage.blob.models.BlockBlobsStageBlockResponse; -import com.microsoft.azure.storage.blob.models.BlockBlobsUploadResponse; +import com.microsoft.azure.storage.blob.models.BlockBlobCommitBlockListResponse; +import com.microsoft.azure.storage.blob.models.BlockBlobGetBlockListResponse; +import com.microsoft.azure.storage.blob.models.BlockBlobStageBlockFromURLResponse; +import com.microsoft.azure.storage.blob.models.BlockBlobStageBlockResponse; +import com.microsoft.azure.storage.blob.models.BlockBlobUploadResponse; import com.microsoft.azure.storage.blob.models.BlockList; import com.microsoft.azure.storage.blob.models.BlockListType; import com.microsoft.azure.storage.blob.models.BlockLookupList; @@ -38,6 +39,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; +import java.net.URL; import java.nio.ByteBuffer; import java.time.OffsetDateTime; import java.util.HashMap; @@ -77,22 +79,27 @@ private interface BlockBlobsService { @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single upload(@HostParam("url") String url, @BodyParam("application/octet-stream") Flowable body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType); + Single upload(@HostParam("url") String url, @BodyParam("application/octet-stream") Flowable body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType); @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single stageBlock(@HostParam("url") String url, @QueryParam("blockid") String blockId, @HeaderParam("Content-Length") long contentLength, @BodyParam("application/octet-stream") Flowable body, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single stageBlock(@HostParam("url") String url, @QueryParam("blockid") String blockId, @HeaderParam("Content-Length") long contentLength, @BodyParam("application/octet-stream") Flowable body, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single commitBlockList(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @BodyParam("application/xml; charset=utf-8") BlockLookupList blocks, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single stageBlockFromURL(@HostParam("url") String url, @QueryParam("blockid") String blockId, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-source-range") String sourceRange, @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + + @PUT("{containerName}/{blob}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(StorageErrorException.class) + Single commitBlockList(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @BodyParam("application/xml; charset=utf-8") BlockLookupList blocks, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @GET("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single getBlockList(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("blocklisttype") BlockListType listType, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single getBlockList(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("blocklisttype") BlockListType listType, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); } /** @@ -171,7 +178,7 @@ public ServiceFuture uploadAsync(@NonNull Flowable body, @NonN * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single uploadWithRestResponseAsync(@NonNull Flowable body, @NonNull long contentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single uploadWithRestResponseAsync(@NonNull Flowable body, @NonNull long contentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -268,7 +275,7 @@ public ServiceFuture stageBlockAsync(@NonNull String blockId, @NonNull lon * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single stageBlockWithRestResponseAsync(@NonNull String blockId, @NonNull long contentLength, @NonNull Flowable body, Integer timeout, String leaseId, String requestId) { + public Single stageBlockWithRestResponseAsync(@NonNull String blockId, @NonNull long contentLength, @NonNull Flowable body, Integer timeout, String leaseId, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -302,6 +309,96 @@ public Completable stageBlockAsync(@NonNull String blockId, @NonNull long conten .toCompletable(); } + /** + * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL. + * + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param sourceUrl Specifiy an URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @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 leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + public void stageBlockFromURL(@NonNull String blockId, @NonNull long contentLength, @NonNull URL sourceUrl, String sourceRange, byte[] sourceContentMD5, Integer timeout, String leaseId, String requestId) { + stageBlockFromURLAsync(blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5, timeout, leaseId, requestId).blockingAwait(); + } + + /** + * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL. + * + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param sourceUrl Specifiy an URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @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 leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID. + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a ServiceFuture which will be completed with the result of the network request. + */ + public ServiceFuture stageBlockFromURLAsync(@NonNull String blockId, @NonNull long contentLength, @NonNull URL sourceUrl, String sourceRange, byte[] sourceContentMD5, Integer timeout, String leaseId, String requestId, ServiceCallback serviceCallback) { + return ServiceFuture.fromBody(stageBlockFromURLAsync(blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5, timeout, leaseId, requestId), serviceCallback); + } + + /** + * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL. + * + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param sourceUrl Specifiy an URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @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 leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Single which performs the network request upon subscription. + */ + public Single stageBlockFromURLWithRestResponseAsync(@NonNull String blockId, @NonNull long contentLength, @NonNull URL sourceUrl, String sourceRange, byte[] sourceContentMD5, Integer timeout, String leaseId, String requestId) { + if (this.client.url() == null) { + throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); + } + if (blockId == null) { + throw new IllegalArgumentException("Parameter blockId is required and cannot be null."); + } + if (sourceUrl == null) { + throw new IllegalArgumentException("Parameter sourceUrl is required and cannot be null."); + } + if (this.client.version() == null) { + throw new IllegalArgumentException("Parameter this.client.version() is required and cannot be null."); + } + Validator.validate(sourceUrl); + final String comp = "block"; + String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + return service.stageBlockFromURL(this.client.url(), blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, timeout, leaseId, this.client.version(), requestId, comp); + } + + /** + * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL. + * + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param sourceUrl Specifiy an URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @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 leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Single which performs the network request upon subscription. + */ + public Completable stageBlockFromURLAsync(@NonNull String blockId, @NonNull long contentLength, @NonNull URL sourceUrl, String sourceRange, byte[] sourceContentMD5, Integer timeout, String leaseId, String requestId) { + return stageBlockFromURLWithRestResponseAsync(blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5, timeout, leaseId, requestId) + .toCompletable(); + } + /** * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. You can do this by specifying whether to commit a block from the committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong to. * @@ -375,7 +472,7 @@ public ServiceFuture commitBlockListAsync(@NonNull BlockLookupList blocks, * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single commitBlockListWithRestResponseAsync(@NonNull BlockLookupList blocks, Integer timeout, String blobCacheControl, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single commitBlockListWithRestResponseAsync(@NonNull BlockLookupList blocks, Integer timeout, String blobCacheControl, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -470,7 +567,7 @@ public ServiceFuture getBlockListAsync(@NonNull BlockListType listTyp * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single getBlockListWithRestResponseAsync(@NonNull BlockListType listType, String snapshot, Integer timeout, String leaseId, String requestId) { + public Single getBlockListWithRestResponseAsync(@NonNull BlockListType listType, String snapshot, Integer timeout, String leaseId, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -497,6 +594,6 @@ public Single getBlockListWithRestResponseAsync( */ public Maybe getBlockListAsync(@NonNull BlockListType listType, String snapshot, Integer timeout, String leaseId, String requestId) { return getBlockListWithRestResponseAsync(listType, snapshot, timeout, leaseId, requestId) - .flatMapMaybe((BlockBlobsGetBlockListResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BlockBlobGetBlockListResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } } diff --git a/src/main/java/com/microsoft/azure/storage/GeneratedContainers.java b/src/main/java/com/microsoft/azure/storage/GeneratedContainers.java index 64d0d2cde..e996745c7 100644 --- a/src/main/java/com/microsoft/azure/storage/GeneratedContainers.java +++ b/src/main/java/com/microsoft/azure/storage/GeneratedContainers.java @@ -11,21 +11,22 @@ package com.microsoft.azure.storage; import com.microsoft.azure.storage.blob.implementation.SignedIdentifiersWrapper; -import com.microsoft.azure.storage.blob.models.ContainersAcquireLeaseResponse; -import com.microsoft.azure.storage.blob.models.ContainersBreakLeaseResponse; -import com.microsoft.azure.storage.blob.models.ContainersChangeLeaseResponse; -import com.microsoft.azure.storage.blob.models.ContainersCreateResponse; -import com.microsoft.azure.storage.blob.models.ContainersDeleteResponse; -import com.microsoft.azure.storage.blob.models.ContainersGetAccessPolicyResponse; -import com.microsoft.azure.storage.blob.models.ContainersGetPropertiesResponse; -import com.microsoft.azure.storage.blob.models.ContainersListBlobFlatSegmentResponse; -import com.microsoft.azure.storage.blob.models.ContainersListBlobHierarchySegmentResponse; -import com.microsoft.azure.storage.blob.models.ContainersReleaseLeaseResponse; -import com.microsoft.azure.storage.blob.models.ContainersRenewLeaseResponse; -import com.microsoft.azure.storage.blob.models.ContainersSetAccessPolicyResponse; -import com.microsoft.azure.storage.blob.models.ContainersSetMetadataResponse; -import com.microsoft.azure.storage.blob.models.ListBlobsFlatResponse; -import com.microsoft.azure.storage.blob.models.ListBlobsHierarchyResponse; +import com.microsoft.azure.storage.blob.models.ContainerAcquireLeaseResponse; +import com.microsoft.azure.storage.blob.models.ContainerBreakLeaseResponse; +import com.microsoft.azure.storage.blob.models.ContainerChangeLeaseResponse; +import com.microsoft.azure.storage.blob.models.ContainerCreateResponse; +import com.microsoft.azure.storage.blob.models.ContainerDeleteResponse; +import com.microsoft.azure.storage.blob.models.ContainerGetAccessPolicyResponse; +import com.microsoft.azure.storage.blob.models.ContainerGetAccountInfoResponse; +import com.microsoft.azure.storage.blob.models.ContainerGetPropertiesResponse; +import com.microsoft.azure.storage.blob.models.ContainerListBlobFlatSegmentResponse; +import com.microsoft.azure.storage.blob.models.ContainerListBlobHierarchySegmentResponse; +import com.microsoft.azure.storage.blob.models.ContainerReleaseLeaseResponse; +import com.microsoft.azure.storage.blob.models.ContainerRenewLeaseResponse; +import com.microsoft.azure.storage.blob.models.ContainerSetAccessPolicyResponse; +import com.microsoft.azure.storage.blob.models.ContainerSetMetadataResponse; +import com.microsoft.azure.storage.blob.models.ListBlobsFlatSegmentResponse; +import com.microsoft.azure.storage.blob.models.ListBlobsHierarchySegmentResponse; import com.microsoft.azure.storage.blob.models.ListBlobsIncludeItem; import com.microsoft.azure.storage.blob.models.PublicAccessType; import com.microsoft.azure.storage.blob.models.SignedIdentifier; @@ -90,67 +91,72 @@ private interface ContainersService { @PUT("{containerName}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single create(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-blob-public-access") PublicAccessType access, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype); + Single create(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-blob-public-access") PublicAccessType access, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype); @GET("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single getProperties(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype); + Single getProperties(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype); @DELETE("{containerName}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single delete(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype); + Single delete(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype); @PUT("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single setMetadata(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp); + Single setMetadata(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp); @GET("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single getAccessPolicy(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp); + Single getAccessPolicy(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp); @PUT("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single setAccessPolicy(@HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") SignedIdentifiersWrapper containerAcl, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-public-access") PublicAccessType access, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp); + Single setAccessPolicy(@HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") SignedIdentifiersWrapper containerAcl, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-public-access") PublicAccessType access, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp); @PUT("{containerName}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single acquireLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); + Single acquireLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); @PUT("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single releaseLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); + Single releaseLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); @PUT("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single renewLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); + Single renewLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); @PUT("{containerName}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single breakLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); + Single breakLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); @PUT("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single changeLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); + Single changeLease(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action); @GET("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single listBlobFlatSegment(@HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @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); + Single listBlobFlatSegment(@HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @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); @GET("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single listBlobHierarchySegment(@HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("delimiter") String delimiter, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @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); + Single listBlobHierarchySegment(@HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("delimiter") String delimiter, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @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); + + @GET("{containerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageErrorException.class) + Single getAccountInfo(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp); } /** @@ -193,7 +199,7 @@ public ServiceFuture createAsync(Integer timeout, Map meta * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single createWithRestResponseAsync(Integer timeout, Map metadata, PublicAccessType access, String requestId) { + public Single createWithRestResponseAsync(Integer timeout, Map metadata, PublicAccessType access, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -257,7 +263,7 @@ public ServiceFuture getPropertiesAsync(Integer timeout, String leaseId, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single getPropertiesWithRestResponseAsync(Integer timeout, String leaseId, String requestId) { + public Single getPropertiesWithRestResponseAsync(Integer timeout, String leaseId, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -325,7 +331,7 @@ public ServiceFuture deleteAsync(Integer timeout, String leaseId, OffsetDa * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single deleteWithRestResponseAsync(Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + public Single deleteWithRestResponseAsync(Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -403,7 +409,7 @@ public ServiceFuture setMetadataAsync(Integer timeout, String leaseId, Map * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single setMetadataWithRestResponseAsync(Integer timeout, String leaseId, Map metadata, OffsetDateTime ifModifiedSince, String requestId) { + public Single setMetadataWithRestResponseAsync(Integer timeout, String leaseId, Map metadata, OffsetDateTime ifModifiedSince, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -474,7 +480,7 @@ public ServiceFuture> getAccessPolicyAsync(Integer timeou * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single getAccessPolicyWithRestResponseAsync(Integer timeout, String leaseId, String requestId) { + public Single getAccessPolicyWithRestResponseAsync(Integer timeout, String leaseId, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -497,7 +503,7 @@ public Single getAccessPolicyWithRestResponse */ public Maybe> getAccessPolicyAsync(Integer timeout, String leaseId, String requestId) { return getAccessPolicyWithRestResponseAsync(timeout, leaseId, requestId) - .flatMapMaybe((ContainersGetAccessPolicyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((ContainerGetAccessPolicyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -549,7 +555,7 @@ public ServiceFuture setAccessPolicyAsync(List container * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single setAccessPolicyWithRestResponseAsync(List containerAcl, Integer timeout, String leaseId, PublicAccessType access, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + public Single setAccessPolicyWithRestResponseAsync(List containerAcl, Integer timeout, String leaseId, PublicAccessType access, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -634,7 +640,7 @@ public ServiceFuture acquireLeaseAsync(Integer timeout, Integer duration, * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single acquireLeaseWithRestResponseAsync(Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + public Single acquireLeaseWithRestResponseAsync(Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -715,7 +721,7 @@ public ServiceFuture releaseLeaseAsync(@NonNull String leaseId, Integer ti * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single releaseLeaseWithRestResponseAsync(@NonNull String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + public Single releaseLeaseWithRestResponseAsync(@NonNull String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -798,7 +804,7 @@ public ServiceFuture renewLeaseAsync(@NonNull String leaseId, Integer time * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single renewLeaseWithRestResponseAsync(@NonNull String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + public Single renewLeaseWithRestResponseAsync(@NonNull String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -881,7 +887,7 @@ public ServiceFuture breakLeaseAsync(Integer timeout, Integer breakPeriod, * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single breakLeaseWithRestResponseAsync(Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + public Single breakLeaseWithRestResponseAsync(Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -964,7 +970,7 @@ public ServiceFuture changeLeaseAsync(@NonNull String leaseId, @NonNull St * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single changeLeaseWithRestResponseAsync(@NonNull String leaseId, @NonNull String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + public Single changeLeaseWithRestResponseAsync(@NonNull String leaseId, @NonNull String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1020,9 +1026,9 @@ public Completable changeLeaseAsync(@NonNull String leaseId, @NonNull String pro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws StorageErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ListBlobsFlatResponse object if successful. + * @return the ListBlobsFlatSegmentResponse object if successful. */ - public ListBlobsFlatResponse listBlobFlatSegment(String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { + public ListBlobsFlatSegmentResponse listBlobFlatSegment(String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { return listBlobFlatSegmentAsync(prefix, marker, maxresults, include, timeout, requestId).blockingGet(); } @@ -1039,7 +1045,7 @@ public ListBlobsFlatResponse listBlobFlatSegment(String prefix, String marker, I * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture listBlobFlatSegmentAsync(String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId, ServiceCallback serviceCallback) { + public ServiceFuture listBlobFlatSegmentAsync(String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(listBlobFlatSegmentAsync(prefix, marker, maxresults, include, timeout, requestId), serviceCallback); } @@ -1055,7 +1061,7 @@ public ServiceFuture listBlobFlatSegmentAsync(String pref * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single listBlobFlatSegmentWithRestResponseAsync(String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { + public Single listBlobFlatSegmentWithRestResponseAsync(String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1081,9 +1087,9 @@ public Single listBlobFlatSegmentWithRest * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Maybe listBlobFlatSegmentAsync(String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { + public Maybe listBlobFlatSegmentAsync(String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { return listBlobFlatSegmentWithRestResponseAsync(prefix, marker, maxresults, include, timeout, requestId) - .flatMapMaybe((ContainersListBlobFlatSegmentResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((ContainerListBlobFlatSegmentResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -1099,9 +1105,9 @@ public Maybe listBlobFlatSegmentAsync(String prefix, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws StorageErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ListBlobsHierarchyResponse object if successful. + * @return the ListBlobsHierarchySegmentResponse object if successful. */ - public ListBlobsHierarchyResponse listBlobHierarchySegment(@NonNull String delimiter, String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { + public ListBlobsHierarchySegmentResponse listBlobHierarchySegment(@NonNull String delimiter, String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { return listBlobHierarchySegmentAsync(delimiter, prefix, marker, maxresults, include, timeout, requestId).blockingGet(); } @@ -1119,7 +1125,7 @@ public ListBlobsHierarchyResponse listBlobHierarchySegment(@NonNull String delim * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture listBlobHierarchySegmentAsync(@NonNull String delimiter, String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId, ServiceCallback serviceCallback) { + public ServiceFuture listBlobHierarchySegmentAsync(@NonNull String delimiter, String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(listBlobHierarchySegmentAsync(delimiter, prefix, marker, maxresults, include, timeout, requestId), serviceCallback); } @@ -1136,7 +1142,7 @@ public ServiceFuture listBlobHierarchySegmentAsync(@ * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single listBlobHierarchySegmentWithRestResponseAsync(@NonNull String delimiter, String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { + public Single listBlobHierarchySegmentWithRestResponseAsync(@NonNull String delimiter, String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -1166,8 +1172,56 @@ public Single listBlobHierarchySegme * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Maybe listBlobHierarchySegmentAsync(@NonNull String delimiter, String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { + public Maybe listBlobHierarchySegmentAsync(@NonNull String delimiter, String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { return listBlobHierarchySegmentWithRestResponseAsync(delimiter, prefix, marker, maxresults, include, timeout, requestId) - .flatMapMaybe((ContainersListBlobHierarchySegmentResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((ContainerListBlobHierarchySegmentResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + } + + /** + * Returns the sku name and account kind. + * + * @throws StorageErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + public void getAccountInfo() { + getAccountInfoAsync().blockingAwait(); + } + + /** + * Returns the sku name and account kind. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a ServiceFuture which will be completed with the result of the network request. + */ + public ServiceFuture getAccountInfoAsync(ServiceCallback serviceCallback) { + return ServiceFuture.fromBody(getAccountInfoAsync(), serviceCallback); + } + + /** + * Returns the sku name and account kind. + * + * @return a Single which performs the network request upon subscription. + */ + public Single getAccountInfoWithRestResponseAsync() { + if (this.client.url() == null) { + throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); + } + if (this.client.version() == null) { + throw new IllegalArgumentException("Parameter this.client.version() is required and cannot be null."); + } + final String restype = "account"; + final String comp = "properties"; + return service.getAccountInfo(this.client.url(), this.client.version(), restype, comp); + } + + /** + * Returns the sku name and account kind. + * + * @return a Single which performs the network request upon subscription. + */ + public Completable getAccountInfoAsync() { + return getAccountInfoWithRestResponseAsync() + .toCompletable(); } } diff --git a/src/main/java/com/microsoft/azure/storage/GeneratedPageBlobs.java b/src/main/java/com/microsoft/azure/storage/GeneratedPageBlobs.java index 6795c98cb..2e4eb4940 100644 --- a/src/main/java/com/microsoft/azure/storage/GeneratedPageBlobs.java +++ b/src/main/java/com/microsoft/azure/storage/GeneratedPageBlobs.java @@ -10,14 +10,14 @@ package com.microsoft.azure.storage; -import com.microsoft.azure.storage.blob.models.PageBlobsClearPagesResponse; -import com.microsoft.azure.storage.blob.models.PageBlobsCopyIncrementalResponse; -import com.microsoft.azure.storage.blob.models.PageBlobsCreateResponse; -import com.microsoft.azure.storage.blob.models.PageBlobsGetPageRangesDiffResponse; -import com.microsoft.azure.storage.blob.models.PageBlobsGetPageRangesResponse; -import com.microsoft.azure.storage.blob.models.PageBlobsResizeResponse; -import com.microsoft.azure.storage.blob.models.PageBlobsUpdateSequenceNumberResponse; -import com.microsoft.azure.storage.blob.models.PageBlobsUploadPagesResponse; +import com.microsoft.azure.storage.blob.models.PageBlobClearPagesResponse; +import com.microsoft.azure.storage.blob.models.PageBlobCopyIncrementalResponse; +import com.microsoft.azure.storage.blob.models.PageBlobCreateResponse; +import com.microsoft.azure.storage.blob.models.PageBlobGetPageRangesDiffResponse; +import com.microsoft.azure.storage.blob.models.PageBlobGetPageRangesResponse; +import com.microsoft.azure.storage.blob.models.PageBlobResizeResponse; +import com.microsoft.azure.storage.blob.models.PageBlobUpdateSequenceNumberResponse; +import com.microsoft.azure.storage.blob.models.PageBlobUploadPagesResponse; import com.microsoft.azure.storage.blob.models.PageList; import com.microsoft.azure.storage.blob.models.SequenceNumberActionType; import com.microsoft.azure.storage.blob.models.StorageErrorException; @@ -81,48 +81,49 @@ private interface PageBlobsService { @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single create(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-blob-content-length") Long blobContentLength, @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType); + Single create(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-blob-content-length") long blobContentLength, @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType); @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single uploadPages(@HostParam("url") String url, @BodyParam("application/octet-stream") Flowable body, @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite); + Single uploadPages(@HostParam("url") String url, @BodyParam("application/octet-stream") Flowable body, @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite); @PUT("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single clearPages(@HostParam("url") String url, @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite); + Single clearPages(@HostParam("url") String url, @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite); @GET("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single getPageRanges(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single getPageRanges(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @GET("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single getPageRangesDiff(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @QueryParam("prevsnapshot") String prevsnapshot, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single getPageRangesDiff(@HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @QueryParam("prevsnapshot") String prevsnapshot, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @PUT("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single resize(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-blob-content-length") long blobContentLength, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single resize(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-blob-content-length") long blobContentLength, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @PUT("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single updateSequenceNumber(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-sequence-number-action") SequenceNumberActionType sequenceNumberAction, @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single updateSequenceNumber(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-sequence-number-action") SequenceNumberActionType sequenceNumberAction, @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); @PUT("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Single copyIncremental(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + Single copyIncremental(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); } /** * The Create operation creates a new page blob. * * @param contentLength The length of the request. + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary. * @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 blobContentType Optional. Sets the blob's content type. If specified, this property is stored with the blob and returned with a read request. * @param blobContentEncoding Optional. Sets the blob's content encoding. If specified, this property is stored with the blob and returned with a read request. @@ -136,21 +137,21 @@ private interface PageBlobsService { * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since the specified date/time. * @param ifMatches Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary. * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws StorageErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void create(@NonNull long contentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobContentLength, Long blobSequenceNumber, String requestId) { - createAsync(contentLength, timeout, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, blobContentLength, blobSequenceNumber, requestId).blockingAwait(); + public void create(@NonNull long contentLength, @NonNull long blobContentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobSequenceNumber, String requestId) { + createAsync(contentLength, blobContentLength, timeout, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, blobSequenceNumber, requestId).blockingAwait(); } /** * The Create operation creates a new page blob. * * @param contentLength The length of the request. + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary. * @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 blobContentType Optional. Sets the blob's content type. If specified, this property is stored with the blob and returned with a read request. * @param blobContentEncoding Optional. Sets the blob's content encoding. If specified, this property is stored with the blob and returned with a read request. @@ -164,21 +165,21 @@ public void create(@NonNull long contentLength, Integer timeout, String blobCont * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since the specified date/time. * @param ifMatches Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary. * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture createAsync(@NonNull long contentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobContentLength, Long blobSequenceNumber, String requestId, ServiceCallback serviceCallback) { - return ServiceFuture.fromBody(createAsync(contentLength, timeout, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, blobContentLength, blobSequenceNumber, requestId), serviceCallback); + public ServiceFuture createAsync(@NonNull long contentLength, @NonNull long blobContentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobSequenceNumber, String requestId, ServiceCallback serviceCallback) { + return ServiceFuture.fromBody(createAsync(contentLength, blobContentLength, timeout, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, blobSequenceNumber, requestId), serviceCallback); } /** * The Create operation creates a new page blob. * * @param contentLength The length of the request. + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary. * @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 blobContentType Optional. Sets the blob's content type. If specified, this property is stored with the blob and returned with a read request. * @param blobContentEncoding Optional. Sets the blob's content encoding. If specified, this property is stored with the blob and returned with a read request. @@ -192,13 +193,12 @@ public ServiceFuture createAsync(@NonNull long contentLength, Integer time * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since the specified date/time. * @param ifMatches Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary. * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single createWithRestResponseAsync(@NonNull long contentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobContentLength, Long blobSequenceNumber, String requestId) { + public Single createWithRestResponseAsync(@NonNull long contentLength, @NonNull long blobContentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobSequenceNumber, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -223,6 +223,7 @@ public Single createWithRestResponseAsync(@NonNull long * The Create operation creates a new page blob. * * @param contentLength The length of the request. + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary. * @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 blobContentType Optional. Sets the blob's content type. If specified, this property is stored with the blob and returned with a read request. * @param blobContentEncoding Optional. Sets the blob's content encoding. If specified, this property is stored with the blob and returned with a read request. @@ -236,14 +237,13 @@ public Single createWithRestResponseAsync(@NonNull long * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since the specified date/time. * @param ifMatches Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary. * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable createAsync(@NonNull long contentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobContentLength, Long blobSequenceNumber, String requestId) { - return createWithRestResponseAsync(contentLength, timeout, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, blobContentLength, blobSequenceNumber, requestId) + public Completable createAsync(@NonNull long contentLength, @NonNull long blobContentLength, Integer timeout, String blobContentType, String blobContentEncoding, String blobContentLanguage, byte[] blobContentMD5, String blobCacheControl, Map metadata, String leaseId, String blobContentDisposition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobSequenceNumber, String requestId) { + return createWithRestResponseAsync(contentLength, blobContentLength, timeout, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, blobSequenceNumber, requestId) .toCompletable(); } @@ -314,7 +314,7 @@ public ServiceFuture uploadPagesAsync(@NonNull Flowable body, * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single uploadPagesWithRestResponseAsync(@NonNull Flowable body, @NonNull long contentLength, Integer timeout, String range, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single uploadPagesWithRestResponseAsync(@NonNull Flowable body, @NonNull long contentLength, Integer timeout, String range, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -425,7 +425,7 @@ public ServiceFuture clearPagesAsync(@NonNull long contentLength, Integer * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single clearPagesWithRestResponseAsync(@NonNull long contentLength, Integer timeout, String range, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single clearPagesWithRestResponseAsync(@NonNull long contentLength, Integer timeout, String range, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -524,7 +524,7 @@ public ServiceFuture getPageRangesAsync(String snapshot, Integer timeo * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single getPageRangesWithRestResponseAsync(String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single getPageRangesWithRestResponseAsync(String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -560,7 +560,7 @@ public Single getPageRangesWithRestResponseAsync */ public Maybe getPageRangesAsync(String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { return getPageRangesWithRestResponseAsync(snapshot, timeout, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, requestId) - .flatMapMaybe((PageBlobsGetPageRangesResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((PageBlobGetPageRangesResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -622,7 +622,7 @@ public ServiceFuture getPageRangesDiffAsync(String snapshot, Integer t * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single getPageRangesDiffWithRestResponseAsync(String snapshot, Integer timeout, String prevsnapshot, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single getPageRangesDiffWithRestResponseAsync(String snapshot, Integer timeout, String prevsnapshot, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -659,7 +659,7 @@ public Single getPageRangesDiffWithRestRespo */ public Maybe getPageRangesDiffAsync(String snapshot, Integer timeout, String prevsnapshot, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { return getPageRangesDiffWithRestResponseAsync(snapshot, timeout, prevsnapshot, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, requestId) - .flatMapMaybe((PageBlobsGetPageRangesDiffResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((PageBlobGetPageRangesDiffResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -714,7 +714,7 @@ public ServiceFuture resizeAsync(@NonNull long blobContentLength, Integer * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single resizeWithRestResponseAsync(@NonNull long blobContentLength, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single resizeWithRestResponseAsync(@NonNull long blobContentLength, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -807,7 +807,7 @@ public ServiceFuture updateSequenceNumberAsync(@NonNull SequenceNumberActi * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single updateSequenceNumberWithRestResponseAsync(@NonNull SequenceNumberActionType sequenceNumberAction, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobSequenceNumber, String requestId) { + public Single updateSequenceNumberWithRestResponseAsync(@NonNull SequenceNumberActionType sequenceNumberAction, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, Long blobSequenceNumber, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } @@ -901,7 +901,7 @@ public ServiceFuture copyIncrementalAsync(@NonNull URL copySource, Integer * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single copyIncrementalWithRestResponseAsync(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { + public Single copyIncrementalWithRestResponseAsync(@NonNull URL copySource, Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String requestId) { if (this.client.url() == null) { throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); } diff --git a/src/main/java/com/microsoft/azure/storage/GeneratedServices.java b/src/main/java/com/microsoft/azure/storage/GeneratedServices.java index 72656f171..4f56d6267 100644 --- a/src/main/java/com/microsoft/azure/storage/GeneratedServices.java +++ b/src/main/java/com/microsoft/azure/storage/GeneratedServices.java @@ -11,7 +11,8 @@ package com.microsoft.azure.storage; import com.microsoft.azure.storage.blob.models.ListContainersIncludeType; -import com.microsoft.azure.storage.blob.models.ListContainersResponse; +import com.microsoft.azure.storage.blob.models.ListContainersSegmentResponse; +import com.microsoft.azure.storage.blob.models.ServiceGetAccountInfoResponse; import com.microsoft.azure.storage.blob.models.ServiceGetPropertiesResponse; import com.microsoft.azure.storage.blob.models.ServiceGetStatisticsResponse; import com.microsoft.azure.storage.blob.models.ServiceListContainersSegmentResponse; @@ -87,6 +88,11 @@ private interface ServicesService { @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) Single listContainersSegment(@HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") ListContainersIncludeType include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp); + + @GET("") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageErrorException.class) + Single getAccountInfo(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp); } /** @@ -288,9 +294,9 @@ public Maybe getStatisticsAsync(Integer timeout, String req * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws StorageErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ListContainersResponse object if successful. + * @return the ListContainersSegmentResponse object if successful. */ - public ListContainersResponse listContainersSegment(String prefix, String marker, Integer maxresults, ListContainersIncludeType include, Integer timeout, String requestId) { + public ListContainersSegmentResponse listContainersSegment(String prefix, String marker, Integer maxresults, ListContainersIncludeType include, Integer timeout, String requestId) { return listContainersSegmentAsync(prefix, marker, maxresults, include, timeout, requestId).blockingGet(); } @@ -307,7 +313,7 @@ public ListContainersResponse listContainersSegment(String prefix, String marker * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture listContainersSegmentAsync(String prefix, String marker, Integer maxresults, ListContainersIncludeType include, Integer timeout, String requestId, ServiceCallback serviceCallback) { + public ServiceFuture listContainersSegmentAsync(String prefix, String marker, Integer maxresults, ListContainersIncludeType include, Integer timeout, String requestId, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(listContainersSegmentAsync(prefix, marker, maxresults, include, timeout, requestId), serviceCallback); } @@ -346,8 +352,56 @@ public Single listContainersSegmentWithRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Maybe listContainersSegmentAsync(String prefix, String marker, Integer maxresults, ListContainersIncludeType include, Integer timeout, String requestId) { + public Maybe listContainersSegmentAsync(String prefix, String marker, Integer maxresults, ListContainersIncludeType include, Integer timeout, String requestId) { return listContainersSegmentWithRestResponseAsync(prefix, marker, maxresults, include, timeout, requestId) .flatMapMaybe((ServiceListContainersSegmentResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } + + /** + * Returns the sku name and account kind. + * + * @throws StorageErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + public void getAccountInfo() { + getAccountInfoAsync().blockingAwait(); + } + + /** + * Returns the sku name and account kind. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a ServiceFuture which will be completed with the result of the network request. + */ + public ServiceFuture getAccountInfoAsync(ServiceCallback serviceCallback) { + return ServiceFuture.fromBody(getAccountInfoAsync(), serviceCallback); + } + + /** + * Returns the sku name and account kind. + * + * @return a Single which performs the network request upon subscription. + */ + public Single getAccountInfoWithRestResponseAsync() { + if (this.client.url() == null) { + throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); + } + if (this.client.version() == null) { + throw new IllegalArgumentException("Parameter this.client.version() is required and cannot be null."); + } + final String restype = "account"; + final String comp = "properties"; + return service.getAccountInfo(this.client.url(), this.client.version(), restype, comp); + } + + /** + * Returns the sku name and account kind. + * + * @return a Single which performs the network request upon subscription. + */ + public Completable getAccountInfoAsync() { + return getAccountInfoWithRestResponseAsync() + .toCompletable(); + } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/AccountSASSignatureValues.java b/src/main/java/com/microsoft/azure/storage/blob/AccountSASSignatureValues.java index cb7909463..7364d47ea 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/AccountSASSignatureValues.java +++ b/src/main/java/com/microsoft/azure/storage/blob/AccountSASSignatureValues.java @@ -33,6 +33,10 @@ * here for further * descriptions of the parameters, including which are required: * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=account_sas "Sample code for AccountSASSignatureValues")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) */ public final class AccountSASSignatureValues { diff --git a/src/main/java/com/microsoft/azure/storage/blob/AppendBlobURL.java b/src/main/java/com/microsoft/azure/storage/blob/AppendBlobURL.java index 45fe1ce98..a459cd8fa 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/AppendBlobURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/AppendBlobURL.java @@ -94,6 +94,11 @@ public AppendBlobURL withSnapshot(String snapshot) throws MalformedURLException, * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. For more information, see * the Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=append_blob "Sample code for AppendBlobURL.create")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param headers * {@link BlobHTTPHeaders} * @param metadata @@ -103,7 +108,7 @@ public AppendBlobURL withSnapshot(String snapshot) throws MalformedURLException, * @return * Emits the successful response. */ - public Single create( + public Single create( BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions) { headers = headers == null ? BlobHTTPHeaders.NONE : headers; metadata = metadata == null ? Metadata.NONE : metadata; @@ -130,6 +135,11 @@ public Single create( * Commits a new block of data to the end of the existing append blob. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=append_blob "Sample code for AppendBlobURL.appendBlock")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param data * The data to write to the blob. * @param length @@ -140,7 +150,7 @@ public Single create( * @return * Emits the successful response. */ - public Single appendBlock( + public Single appendBlock( Flowable data, long length, BlobAccessConditions accessConditions) { accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; diff --git a/src/main/java/com/microsoft/azure/storage/blob/BlobListingDetails.java b/src/main/java/com/microsoft/azure/storage/blob/BlobListingDetails.java index 563d5ef71..06a3c7205 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/BlobListingDetails.java +++ b/src/main/java/com/microsoft/azure/storage/blob/BlobListingDetails.java @@ -30,7 +30,7 @@ public final class BlobListingDetails { * An object representing no listing details. */ public static final BlobListingDetails NONE = new BlobListingDetails(false, false, false, - false); + false, false); private final boolean copy; @@ -40,6 +40,8 @@ public final class BlobListingDetails { private final boolean uncommittedBlobs; + private final boolean deletedBlobs; + /** * A {@link BlobListingDetails} object. * @@ -53,12 +55,16 @@ public final class BlobListingDetails { * @param uncommittedBlobs * Whether blobs for which blocks have been uploaded, but which have not been committed using Put Block List, * should be included in the response. + * @param deletedBlobs + * Whether blobs which have been soft deleted should be returned. */ - public BlobListingDetails(boolean copy, boolean metadata, boolean snapshots, boolean uncommittedBlobs) { + public BlobListingDetails(boolean copy, boolean metadata, boolean snapshots, boolean uncommittedBlobs, + boolean deletedBlobs) { this.copy = copy; this.metadata = metadata; this.snapshots = snapshots; this.uncommittedBlobs = uncommittedBlobs; + this.deletedBlobs = deletedBlobs; } /** @@ -66,7 +72,7 @@ public BlobListingDetails(boolean copy, boolean metadata, boolean snapshots, boo * Whether blob copies should be returned. */ public boolean getCopy() { - return copy; + return this.copy; } /** @@ -74,7 +80,7 @@ public boolean getCopy() { * Whether metadata should be returned. */ public boolean getMetadata() { - return metadata; + return this.metadata; } /** @@ -82,7 +88,7 @@ public boolean getMetadata() { * Whether snapshots should be returned. */ public boolean getSnapshots() { - return snapshots; + return this.snapshots; } /** @@ -90,7 +96,15 @@ public boolean getSnapshots() { * Whether uncommitted blobs should be returned. */ public boolean getUncommittedBlobs() { - return uncommittedBlobs; + return this.uncommittedBlobs; + } + + /** + * @return + * Whether soft-deleted blobs should be returned. + */ + public boolean getDeletedBlobs() { + return this.deletedBlobs; } /* @@ -102,6 +116,9 @@ ArrayList toList() { if(this.copy) { details.add(ListBlobsIncludeItem.COPY); } + if(this.deletedBlobs) { + details.add(ListBlobsIncludeItem.DELETED); + } if(this.metadata) { details.add(ListBlobsIncludeItem.METADATA); } diff --git a/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java b/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java index f04850e38..6ea6ace57 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java @@ -134,6 +134,11 @@ public PageBlobURL toPageBlobURL() { * Copies the data at the source URL to a blob. For more information, see the * Azure Docs * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=start_copy "Sample code for BlobURL.startCopyFromURL")] \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=start_copy_helper "Helper for start_copy sample.")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) * * @param sourceURL * The source URL to copy from. URLs outside of Azure may only be copied to block blobs. @@ -146,7 +151,7 @@ public PageBlobURL toPageBlobURL() { * @return * Emits the successful response. */ - public Single startCopyFromURL( + public Single startCopyFromURL( URL sourceURL, Metadata metadata, BlobAccessConditions sourceAccessConditions, BlobAccessConditions destAccessConditions) { metadata = metadata == null ? Metadata.NONE : metadata; @@ -164,7 +169,6 @@ public Single startCopyFromURL( destAccessConditions.getHttpAccessConditions().getIfMatch().toString(), destAccessConditions.getHttpAccessConditions().getIfNoneMatch().toString(), destAccessConditions.getLeaseAccessConditions().getLeaseId(), - sourceAccessConditions.getLeaseAccessConditions().getLeaseId(), null)); } @@ -173,15 +177,20 @@ public Single startCopyFromURL( * more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=abort_copy "Sample code for BlobURL.abortCopyFromURL")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param copyId * The id of the copy operation to abort. Returned as the {@code copyId} field on the - * {@link BlobsStartCopyFromURLHeaders} object. + * {@link BlobStartCopyFromURLHeaders} object. * @param leaseAccessConditions * {@link LeaseAccessConditions} * @return * Emits the successful response. */ - public Single abortCopyFromURL( + public Single abortCopyFromURL( String copyId, LeaseAccessConditions leaseAccessConditions) { leaseAccessConditions = leaseAccessConditions == null ? LeaseAccessConditions.NONE : leaseAccessConditions; @@ -195,7 +204,14 @@ public Single abortCopyFromURL( * Azure Docs. * * Please consider using the {@link RetryReader} in conjunction with this method to achieve more reliable downloads - * that are resilient to transient network failures. + * that are resilient to transient network failures. A convenient way to do this is to simply pass non-null options + * to {@link DownloadResponse#body(RetryReaderOptions)}, and a RetryReader will be applied to the body + * automatically. + * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=upload_download "Sample code for BlobURL.download")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) * * @param range * {@link BlobRange} @@ -223,7 +239,7 @@ public Single download( accessConditions.getHttpAccessConditions().getIfNoneMatch().toString(), null)) .map(response -> - new DownloadResponse(response.statusCode(), response.headers(), + new DownloadResponse(response.request(), response.statusCode(), response.headers(), response.rawHeaders(), response.body())); } @@ -233,6 +249,11 @@ public Single download( * information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_delete "Sample code for BlobURL.delete")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param deleteBlobSnapshotOptions * Specifies the behavior for deleting the snapshots on this blob. {@code Include} will delete the base blob * and all snapshots. {@code Only} will delete only the snapshots. If a snapshot is being deleted, you must @@ -242,7 +263,7 @@ public Single download( * @return * Emits the successful response. */ - public Single delete( + public Single delete( DeleteSnapshotsOptionType deleteBlobSnapshotOptions, BlobAccessConditions accessConditions) { accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; @@ -261,12 +282,17 @@ public Single delete( * Returns the blob's metadata and properties. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=properties_metadata "Sample code for BlobURL.getProperties")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param accessConditions * {@link BlobAccessConditions} * @return * Emits the successful response. */ - public Single getProperties( + public Single getProperties( BlobAccessConditions accessConditions) { accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; @@ -284,6 +310,11 @@ public Single getProperties( * Changes a blob's HTTP header properties. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=properties_metadata "Sample code for BlobURL.setHTTPHeaders")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param headers * {@link BlobHTTPHeaders} * @param accessConditions @@ -291,7 +322,7 @@ public Single getProperties( * @return * Emits the successful response. */ - public Single setHTTPHeaders( + public Single setHTTPHeaders( BlobHTTPHeaders headers, BlobAccessConditions accessConditions) { headers = headers == null ? BlobHTTPHeaders.NONE : headers; accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; @@ -316,6 +347,11 @@ public Single setHTTPHeaders( * Changes a blob's metadata. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=properties_metadata "Sample code for BlobURL.setMetadata")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param metadata * {@link Metadata} * @param accessConditions @@ -323,7 +359,7 @@ public Single setHTTPHeaders( * @return * Emits the successful response. */ - public Single setMetadata( + public Single setMetadata( Metadata metadata, BlobAccessConditions accessConditions) { metadata = metadata == null ? Metadata.NONE : metadata; accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; @@ -342,6 +378,11 @@ public Single setMetadata( * Creates a read-only snapshot of a blob. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=snapshot "Sample code for BlobURL.createSnapshot")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param metadata * {@link Metadata} * @param accessConditions @@ -349,7 +390,7 @@ public Single setMetadata( * @return * Emits the successful response. */ - public Single createSnapshot( + public Single createSnapshot( Metadata metadata, BlobAccessConditions accessConditions) { metadata = metadata == null ? Metadata.NONE : metadata; accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; @@ -364,11 +405,53 @@ public Single createSnapshot( null)); } + /** + * Sets the tier on a blob. The operation is allowed on a page blob in a premium storage account or a block blob in + * a blob storage or GPV2 account. A premium page blob's tier determines the allowed size, IOPS, and bandwidth of + * the blob. A block blob's tier determines the Hot/Cool/Archive storage type. This does not update the blob's etag. + * For detailed information about block blob level tiering see the Azure Docs. + * + * @apiNote + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=tier "Sample code for BlobURL.setTier")] + * + * @param tier + * The new tier for the blob. + * @return + * Emits the successful response. + */ + public Single setTier(AccessTier tier) { + Utility.assertNotNull("tier", tier); + + return addErrorWrappingToSingle(this.storageClient.generatedBlobs().setTierWithRestResponseAsync(tier, + null,null)); + } + + + /** + * Undelete restores the content and metadata of a soft-deleted blob and/or any associated soft-deleted snapshots. + * For more information, see the Azure Docs. + * + * @apiNote + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=undelete "Sample code for BlobURL.undelete")] + * + * @return + * Emits the successful response. + */ + public Single undelete() { + return addErrorWrappingToSingle(this.storageClient.generatedBlobs().undeleteWithRestResponseAsync(null, + null)); + } + /** * Acquires a lease on the blob for write and delete operations. The lease duration must be between * 15 to 60 seconds, or infinite (-1). For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.acquireLease")]\n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param proposedID * A {@code String} in any valid GUID format. May be null. * @param duration @@ -379,7 +462,7 @@ public Single createSnapshot( * @return * Emits the successful response. */ - public Single acquireLease( + public Single acquireLease( String proposedID, int duration, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; if (!(duration == -1 || (duration >= 15 && duration <=60))) { @@ -401,6 +484,11 @@ public Single acquireLease( * Renews the blob's previously-acquired lease. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.renewLease")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param leaseID * The leaseId of the active lease on the blob. * @param httpAccessConditions @@ -408,7 +496,7 @@ public Single acquireLease( * @return * Emits the successful response. */ - public Single renewLease( + public Single renewLease( String leaseID, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; @@ -425,6 +513,11 @@ public Single renewLease( * Releases the blob's previously-acquired lease. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.releaseLease")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param leaseID * The leaseId of the active lease on the blob. * @param httpAccessConditions @@ -432,7 +525,7 @@ public Single renewLease( * @return * Emits the successful response. */ - public Single releaseLease( + public Single releaseLease( String leaseID, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; @@ -450,6 +543,11 @@ public Single releaseLease( * to break a fixed-duration lease when it expires or an infinite lease immediately. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.breakLease")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param breakPeriodInSeconds * An optional {@code Integer} representing the proposed duration of seconds that the lease should continue * before it is broken, between 0 and 60 seconds. This break period is only used if it is shorter than the time @@ -460,7 +558,7 @@ public Single releaseLease( * @return * Emits the successful response. */ - public Single breakLease( + public Single breakLease( Integer breakPeriodInSeconds, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; @@ -477,6 +575,11 @@ public Single breakLease( * ChangeLease changes the blob's lease ID. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.changeLease")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param leaseId * The leaseId of the active lease on the blob. * @param proposedID @@ -486,7 +589,7 @@ public Single breakLease( * @return * Emits the successful response. */ - public Single changeLease( + public Single changeLease( String leaseId, String proposedID, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; @@ -498,7 +601,5 @@ public Single changeLease( null)); } - //TODO: Set Tier - //TODO: Undelete // TODO: Update links } diff --git a/src/main/java/com/microsoft/azure/storage/blob/BlobURLParts.java b/src/main/java/com/microsoft/azure/storage/blob/BlobURLParts.java index 669527a1e..4481e240c 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/BlobURLParts.java +++ b/src/main/java/com/microsoft/azure/storage/blob/BlobURLParts.java @@ -26,6 +26,11 @@ * existing URL into its parts with the {@link URLParser} class. You may construct a URL from parts by calling toURL(). * It is also possible to use the empty constructor to build a blobURL from scratch. * NOTE: Changing any SAS-related field requires computing a new SAS signature. + * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=url_parts "Sample code for BlobURLParts")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) */ public final class BlobURLParts { diff --git a/src/main/java/com/microsoft/azure/storage/blob/BlockBlobURL.java b/src/main/java/com/microsoft/azure/storage/blob/BlockBlobURL.java index 0ce5dce71..d8a910654 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/BlockBlobURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/BlockBlobURL.java @@ -45,7 +45,7 @@ public final class BlockBlobURL extends BlobURL { /** * Indicates the maximum number of bytes that can be sent in a call to stageBlock. */ - public static final int MAX_PUT_BLOCK_BYTES = 100 * Constants.MB; + public static final int MAX_STAGE_BLOCK_BYTES = 100 * Constants.MB; /** * Indicates the maximum number of blocks allowed in a block blob. @@ -105,6 +105,11 @@ public BlockBlobURL withSnapshot(String snapshot) throws MalformedURLException, * * For more efficient bulk-upload scenarios, please refer to the {@link TransferManager} for convenience methods. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=upload_download "Sample code for BlockBlobURL.upload")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param data * The data to write to the blob. * @param length @@ -119,14 +124,12 @@ public BlockBlobURL withSnapshot(String snapshot) throws MalformedURLException, * @return * Emits the successful response. */ - public Single upload( + public Single upload( Flowable data, long length, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions) { headers = headers == null ? BlobHTTPHeaders.NONE : headers; metadata = metadata == null ? Metadata.NONE : metadata; accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; - - //TODO: runtime flowable wrapper that throws an error if the size doesn't match the data return addErrorWrappingToSingle(this.storageClient.generatedBlockBlobs().uploadWithRestResponseAsync( data, length, null, headers.getContentType(), @@ -149,9 +152,14 @@ public Single upload( * commitBlockList. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.stageBlock")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param base64BlockID - * A Base64 encoded {@code String} that specifies the ID for this block. Note that all block ids must be the - * same length. + * A Base64 encoded {@code String} that specifies the ID for this block. Note that all block ids for a given + * blob must be the same length. * @param data * The data to write to the block. * @param length @@ -162,7 +170,7 @@ public Single upload( * @return * Emits the successful response. */ - public Single stageBlock( + public Single stageBlock( String base64BlockID, Flowable data, long length, LeaseAccessConditions leaseAccessConditions) { leaseAccessConditions = leaseAccessConditions == null ? LeaseAccessConditions.NONE : leaseAccessConditions; @@ -170,11 +178,53 @@ public Single stageBlock( base64BlockID, length, data,null, leaseAccessConditions.getLeaseId(), null)); } + /** + * Creates a new block to be committed as part of a blob where the contents are read from a URL. For more + * information, see the Azure Docs. + * + * @apiNote + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=block_from_url "Sample code for BlockBlobURL.stageBlockFromURL")] + * + * @param base64BlockID + * A Base64 encoded {@code String} that specifies the ID for this block. Note that all block ids for a given + * blob must be the same length. + * @param sourceURL + * The url to the blob that will be the source of the copy. A source blob in the same storage account can be + * authenticated via Shared Key. However, if the source is a blob in another account, the source blob must + * either be public or must be authenticated via a shared access signature. If the source blob is public, no + * authentication is required to perform the operation. + * @param sourceRange + * {@link BlobRange} + * @param sourceContentMD5 + * An MD5 hash of the block content from the source blob. If specified, the service will calculate the MD5 of + * the received data and fail the request if it does not match the provided MD5. + * @param leaseAccessConditions + * {@link LeaseAccessConditions} + * @return + * Emits the successful response. + */ + public Single stageBlockFromURL( + String base64BlockID, URL sourceURL, BlobRange sourceRange, byte[] sourceContentMD5, + LeaseAccessConditions leaseAccessConditions) { + leaseAccessConditions = leaseAccessConditions == null ? LeaseAccessConditions.NONE : leaseAccessConditions; + sourceRange = sourceRange == null ? BlobRange.DEFAULT : sourceRange; + + return addErrorWrappingToSingle( + this.storageClient.generatedBlockBlobs().stageBlockFromURLWithRestResponseAsync( + base64BlockID, 0, sourceURL, sourceRange.toString(), sourceContentMD5, + null, leaseAccessConditions.getLeaseId(), null)); + } + /** * Returns the list of blocks that have been uploaded as part of a block blob using the specified block list filter. * For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.getBlockList")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param listType * Specifies which type of blocks to return. * @param leaseAccessConditions @@ -182,7 +232,7 @@ public Single stageBlock( * @return * Emits the successful response. */ - public Single getBlockList( + public Single getBlockList( BlockListType listType, LeaseAccessConditions leaseAccessConditions) { leaseAccessConditions = leaseAccessConditions == null ? LeaseAccessConditions.NONE : leaseAccessConditions; @@ -201,6 +251,11 @@ public Single getBlockList( * * For more efficient bulk-upload scenarios, please refer to the {@link TransferManager} for convenience methods. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.commitBlockList")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param base64BlockIDs * A list of base64 encode {@code String}s that specifies the block IDs to be committed. * @param headers @@ -212,8 +267,7 @@ public Single getBlockList( * @return * Emits the successful response. */ - // TODO: Add Content-Length to swagger once the modeler knows to hide (or whatever solution). - public Single commitBlockList( + public Single commitBlockList( List base64BlockIDs, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions) { headers = headers == null ? BlobHTTPHeaders.NONE : headers; diff --git a/src/main/java/com/microsoft/azure/storage/blob/CommonRestResponse.java b/src/main/java/com/microsoft/azure/storage/blob/CommonRestResponse.java index 8e78beec7..739d3ae0a 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/CommonRestResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/CommonRestResponse.java @@ -14,8 +14,8 @@ */ package com.microsoft.azure.storage.blob; -import com.microsoft.azure.storage.blob.models.BlockBlobsCommitBlockListResponse; -import com.microsoft.azure.storage.blob.models.BlockBlobsUploadResponse; +import com.microsoft.azure.storage.blob.models.BlockBlobCommitBlockListResponse; +import com.microsoft.azure.storage.blob.models.BlockBlobUploadResponse; import com.microsoft.rest.v2.RestResponse; import java.time.OffsetDateTime; @@ -27,17 +27,17 @@ */ public final class CommonRestResponse { - private BlockBlobsUploadResponse uploadBlobResponse; + private BlockBlobUploadResponse uploadBlobResponse; - private BlockBlobsCommitBlockListResponse commitBlockListResponse; + private BlockBlobCommitBlockListResponse commitBlockListResponse; - static CommonRestResponse createFromPutBlobResponse(BlockBlobsUploadResponse response) { + static CommonRestResponse createFromPutBlobResponse(BlockBlobUploadResponse response) { CommonRestResponse commonRestResponse = new CommonRestResponse(); commonRestResponse.uploadBlobResponse = response; return commonRestResponse; } - static CommonRestResponse createFromPutBlockListResponse(BlockBlobsCommitBlockListResponse response) { + static CommonRestResponse createFromPutBlockListResponse(BlockBlobCommitBlockListResponse response) { CommonRestResponse commonRestResponse = new CommonRestResponse(); commonRestResponse.commitBlockListResponse = response; return commonRestResponse; diff --git a/src/main/java/com/microsoft/azure/storage/blob/Constants.java b/src/main/java/com/microsoft/azure/storage/blob/Constants.java index 866703f05..591b7d440 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/Constants.java +++ b/src/main/java/com/microsoft/azure/storage/blob/Constants.java @@ -106,7 +106,7 @@ static final class HeaderConstants { /** * The current storage version header value. */ - static final String TARGET_STORAGE_VERSION = "2017-07-29"; + static final String TARGET_STORAGE_VERSION = "2018-03-28"; /** * The UserAgent header. @@ -116,12 +116,12 @@ static final class HeaderConstants { /** * Specifies the value to use for UserAgent header. */ - static final String USER_AGENT_PREFIX = "Azure-Storage-Async"; + static final String USER_AGENT_PREFIX = "Azure-Storage"; /** * Specifies the value to use for UserAgent header. */ - static final String USER_AGENT_VERSION = "10.0.1-Preview"; + static final String USER_AGENT_VERSION = "10.0.2-Preview"; private HeaderConstants() { // Private to prevent construction. diff --git a/src/main/java/com/microsoft/azure/storage/blob/ContainerURL.java b/src/main/java/com/microsoft/azure/storage/blob/ContainerURL.java index 96d96d58a..74820db47 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/ContainerURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/ContainerURL.java @@ -36,6 +36,12 @@ */ public final class ContainerURL extends StorageURL { + public static final String ROOT_CONTAINER_NAME = "$root"; + + public static final String STATIC_WEBSITE_CONTAINER_NAME = "$web"; + + public static final String LOG_CONTAINER_NAME = "$logs"; + public ContainerURL(URL url, HttpPipeline pipeline) { super(url, pipeline); } @@ -149,6 +155,11 @@ public BlobURL createBlobURL(String blobName) { * fails. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.create")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param metadata * {@link Metadata} * @param accessType @@ -157,7 +168,7 @@ public BlobURL createBlobURL(String blobName) { * @return * Emits the successful response. */ - public Single create( + public Single create( Metadata metadata, PublicAccessType accessType) { metadata = metadata == null ? Metadata.NONE : metadata; return addErrorWrappingToSingle(this.storageClient.generatedContainers().createWithRestResponseAsync( @@ -170,12 +181,17 @@ public Single create( * deleted during garbage collection. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.delete")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param accessConditions * {@link ContainerAccessConditions} * @return * Emits the successful response. */ - public Single delete( + public Single delete( ContainerAccessConditions accessConditions) { accessConditions = accessConditions == null ? ContainerAccessConditions.NONE : accessConditions; @@ -186,7 +202,8 @@ public Single delete( throw new IllegalArgumentException("ETag access conditions are not supported for this API."); } - return addErrorWrappingToSingle(this.storageClient.generatedContainers().deleteWithRestResponseAsync(null, + return addErrorWrappingToSingle(this.storageClient.generatedContainers() + .deleteWithRestResponseAsync(null, accessConditions.getLeaseAccessConditions().getLeaseId(), accessConditions.getHttpAccessConditions().getIfModifiedSince(), accessConditions.getHttpAccessConditions().getIfUnmodifiedSince(), @@ -197,16 +214,22 @@ public Single delete( * Returns the container's metadata and system properties. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.getProperties")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param leaseAccessConditions * {@link LeaseAccessConditions} * @return * Emits the successful response. */ - public Single getProperties( + public Single getProperties( LeaseAccessConditions leaseAccessConditions) { leaseAccessConditions = leaseAccessConditions == null ? LeaseAccessConditions.NONE : leaseAccessConditions; - return addErrorWrappingToSingle(this.storageClient.generatedContainers().getPropertiesWithRestResponseAsync(null, + return addErrorWrappingToSingle(this.storageClient.generatedContainers() + .getPropertiesWithRestResponseAsync(null, leaseAccessConditions.getLeaseId(), null)); } @@ -214,6 +237,11 @@ public Single getProperties( * Sets the container's metadata. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.setMetadata")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param metadata * {@link Metadata} * @param accessConditions @@ -221,7 +249,7 @@ public Single getProperties( * @return * Emits the successful response. */ - public Single setMetadata( + public Single setMetadata( Metadata metadata, ContainerAccessConditions accessConditions) { metadata = metadata == null ? Metadata.NONE : metadata; accessConditions = accessConditions == null ? ContainerAccessConditions.NONE : accessConditions; @@ -234,7 +262,8 @@ public Single setMetadata( "If-Modified-Since is the only HTTP access condition supported for this API"); } - return addErrorWrappingToSingle(this.storageClient.generatedContainers().setMetadataWithRestResponseAsync(null, + return addErrorWrappingToSingle(this.storageClient.generatedContainers() + .setMetadataWithRestResponseAsync(null, accessConditions.getLeaseAccessConditions().getLeaseId(), metadata, accessConditions.getHttpAccessConditions().getIfModifiedSince(),null)); } @@ -244,12 +273,17 @@ public Single setMetadata( * For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_policy "Sample code for ContainerURL.getAccessPolicy")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param leaseAccessConditions * {@link LeaseAccessConditions} * @return * Emits the successful response. */ - public Single getAccessPolicy( + public Single getAccessPolicy( LeaseAccessConditions leaseAccessConditions) { leaseAccessConditions = leaseAccessConditions == null ? LeaseAccessConditions.NONE : leaseAccessConditions; @@ -263,6 +297,11 @@ public Single getAccessPolicy( * ensure the time formatting is compatible with the service. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_policy "Sample code for ContainerURL.setAccessPolicy")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param accessType * Specifies how the data in this container is available to the public. See the x-ms-blob-public-access header * in the Azure Docs for more information. Pass null for no public access. @@ -275,11 +314,18 @@ public Single getAccessPolicy( * @return * Emits the successful response. */ - public Single setAccessPolicy( + public Single setAccessPolicy( PublicAccessType accessType, List identifiers, ContainerAccessConditions accessConditions) { accessConditions = accessConditions == null ? ContainerAccessConditions.NONE : accessConditions; + if (!accessConditions.getHttpAccessConditions().getIfMatch().equals(ETag.NONE) || + !accessConditions.getHttpAccessConditions().getIfNoneMatch().equals(ETag.NONE)) { + // Throwing is preferred to Single.error because this will error out immediately instead of waiting until + // subscription. + throw new IllegalArgumentException("ETag access conditions are not supported for this API."); + } + /* We truncate to seconds because the service only supports nanoseconds or seconds, but doing an OffsetDateTime.now will only give back milliseconds (more precise fields are zeroed and not serialized). This @@ -300,7 +346,8 @@ OffsetDateTime.now will only give back milliseconds (more precise fields are zer } // TODO: validate that empty list clears permissions and null list does not change list. Document behavior. - return addErrorWrappingToSingle(this.storageClient.generatedContainers().setAccessPolicyWithRestResponseAsync(identifiers, null, + return addErrorWrappingToSingle(this.storageClient.generatedContainers() + .setAccessPolicyWithRestResponseAsync(identifiers, null, accessConditions.getLeaseAccessConditions().getLeaseId(), accessType, accessConditions.getHttpAccessConditions().getIfModifiedSince(), accessConditions.getHttpAccessConditions().getIfUnmodifiedSince(), @@ -317,6 +364,11 @@ private boolean validateLeaseOperationAccessConditions(HTTPAccessConditions http * 60 seconds, or infinite (-1). For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.acquireLease")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param proposedID * A {@code String} in any valid GUID format. * @param duration @@ -327,7 +379,7 @@ private boolean validateLeaseOperationAccessConditions(HTTPAccessConditions http * @return * Emits the successful response. */ - public Single acquireLease( + public Single acquireLease( String proposedID, int duration, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; if (!this.validateLeaseOperationAccessConditions(httpAccessConditions)){ @@ -348,6 +400,11 @@ public Single acquireLease( * Renews the container's previously-acquired lease. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.renewLease")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param leaseID * The leaseId of the active lease on the container. * @param httpAccessConditions @@ -355,7 +412,7 @@ public Single acquireLease( * @return * Emits the successful response. */ - public Single renewLease( + public Single renewLease( String leaseID, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; if (!this.validateLeaseOperationAccessConditions(httpAccessConditions)) { @@ -376,6 +433,11 @@ public Single renewLease( * Releases the container's previously-acquired lease. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.releaseLease")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param leaseID * The leaseId of the active lease on the container. * @param httpAccessConditions @@ -383,7 +445,7 @@ public Single renewLease( * @return * Emits the successful response. */ - public Single releaseLease( + public Single releaseLease( String leaseID, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; if (!this.validateLeaseOperationAccessConditions(httpAccessConditions)) { @@ -404,6 +466,11 @@ public Single releaseLease( * Breaks the container's previously-acquired lease. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.breakLease")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param breakPeriodInSeconds * An optional {@code Integer} representing the proposed duration of seconds that the lease should continue * before it is broken, between 0 and 60 seconds. This break period is only used if it is shorter than the time @@ -414,7 +481,7 @@ public Single releaseLease( * @return * Emits the successful response. */ - public Single breakLease( + public Single breakLease( Integer breakPeriodInSeconds, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; if (!this.validateLeaseOperationAccessConditions(httpAccessConditions)) { @@ -435,6 +502,11 @@ public Single breakLease( * Changes the container's leaseID. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.changeLease")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param leaseID * The leaseId of the active lease on the container. * @param proposedID @@ -444,7 +516,7 @@ public Single breakLease( * @return * Emits the successful response. */ - public Single changeLease( + public Single changeLease( String leaseID, String proposedID, HTTPAccessConditions httpAccessConditions) { httpAccessConditions = httpAccessConditions == null ? HTTPAccessConditions.NONE : httpAccessConditions; if (!this.validateLeaseOperationAccessConditions(httpAccessConditions)) { @@ -468,6 +540,12 @@ public Single changeLease( * Marker) to get the next segment. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_flat "Sample code for ContainerURL.listBlobsFlatSegment")] \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_flat_helper "helper code for ContainerURL.listBlobsFlatSegment")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param marker * Identifies the portion of the list to be returned with the next list operation. * This value is returned in the response of a previous list operation as the @@ -477,11 +555,12 @@ public Single changeLease( * @return * Emits the successful response. */ - public Single listBlobsFlatSegment( + public Single listBlobsFlatSegment( String marker, ListBlobsOptions options) { options = options == null ? ListBlobsOptions.DEFAULT : options; - return addErrorWrappingToSingle(this.storageClient.generatedContainers().listBlobFlatSegmentWithRestResponseAsync( + return addErrorWrappingToSingle(this.storageClient.generatedContainers() + .listBlobFlatSegmentWithRestResponseAsync( options.getPrefix(), marker, options.getMaxResults(), options.getDetails().toList(), null, null)); } @@ -493,6 +572,12 @@ public Single listBlobsFlatSegment( * Marker) to get the next segment. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_hierarchy "Sample code for ContainerURL.listBlobsHierarchySegment")] \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_hierarchy_helper "helper code for ContainerURL.listBlobsHierarchySegment")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param marker * Identifies the portion of the list to be returned with the next list operation. * This value is returned in the response of a previous list operation as the @@ -506,14 +591,15 @@ public Single listBlobsFlatSegment( * @return * Emits the successful response. */ - public Single listBlobsHierarchySegment( + public Single listBlobsHierarchySegment( String marker, String delimiter, ListBlobsOptions options) { options = options == null ? ListBlobsOptions.DEFAULT : options; if (options.getDetails().getSnapshots()) { throw new IllegalArgumentException("Including snapshots in a hierarchical listing is not supported."); } - return addErrorWrappingToSingle(this.storageClient.generatedContainers().listBlobHierarchySegmentWithRestResponseAsync( + return addErrorWrappingToSingle(this.storageClient.generatedContainers() + .listBlobHierarchySegmentWithRestResponseAsync( delimiter, options.getPrefix(), marker, options.getMaxResults(), options.getDetails().toList(), null, null)); } diff --git a/src/main/java/com/microsoft/azure/storage/blob/DownloadResponse.java b/src/main/java/com/microsoft/azure/storage/blob/DownloadResponse.java index 948bd060b..2be06fc76 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/DownloadResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/DownloadResponse.java @@ -15,8 +15,9 @@ package com.microsoft.azure.storage.blob; -import com.microsoft.azure.storage.blob.models.BlobsDownloadHeaders; +import com.microsoft.azure.storage.blob.models.BlobDownloadHeaders; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import io.reactivex.Flowable; import io.reactivex.Single; import io.reactivex.internal.functions.Functions; @@ -29,14 +30,14 @@ * {@code DownloadResponse} wraps the protocol-layer response from {@link BlobURL#download(BlobRange, * BlobAccessConditions, boolean)} to help provide information for retrying. */ -public class DownloadResponse extends RestResponse> implements Closeable { +public class DownloadResponse extends RestResponse> implements Closeable { private BlobURL blobURL; private RetryReader.HTTPGetterInfo info; - DownloadResponse(int statusCode, BlobsDownloadHeaders blobsDownloadHeaders, Map rawHeaders, - Flowable byteBufferFlowable) { - super(statusCode, blobsDownloadHeaders, rawHeaders, byteBufferFlowable); + DownloadResponse(HttpRequest request, int statusCode, BlobDownloadHeaders blobsDownloadHeaders, + Map rawHeaders, Flowable byteBufferFlowable) { + super(request, statusCode, blobsDownloadHeaders, rawHeaders, byteBufferFlowable); } /** @@ -66,7 +67,7 @@ public int statusCode() { } @Override - public BlobsDownloadHeaders headers() { + public BlobDownloadHeaders headers() { return super.headers(); } diff --git a/src/main/java/com/microsoft/azure/storage/blob/ListBlobsOptions.java b/src/main/java/com/microsoft/azure/storage/blob/ListBlobsOptions.java index 54e5008b9..8ddc7e31f 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/ListBlobsOptions.java +++ b/src/main/java/com/microsoft/azure/storage/blob/ListBlobsOptions.java @@ -24,9 +24,8 @@ public final class ListBlobsOptions { * An object representing the default options: no details, prefix, or delimiter. Uses the server default for * maxResults. */ - public static final ListBlobsOptions DEFAULT = new ListBlobsOptions( - new BlobListingDetails(false, false, false, false), - null, null); + public static final ListBlobsOptions DEFAULT = new ListBlobsOptions(BlobListingDetails.NONE, null, + null); private final BlobListingDetails details; diff --git a/src/main/java/com/microsoft/azure/storage/blob/LoggingOptions.java b/src/main/java/com/microsoft/azure/storage/blob/LoggingOptions.java index ff9d85fe6..68160c550 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/LoggingOptions.java +++ b/src/main/java/com/microsoft/azure/storage/blob/LoggingOptions.java @@ -26,11 +26,14 @@ public final class LoggingOptions { private final long minDurationToLogSlowRequestsInMs; - - /** * Creates a new {@link LoggingOptions} object. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=pipeline_options "Sample code for LoggingOptions constructor")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param minDurationToLogSlowRequestsInMs * The duration after which a tried operation will be logged as a warning. */ diff --git a/src/main/java/com/microsoft/azure/storage/blob/PageBlobURL.java b/src/main/java/com/microsoft/azure/storage/blob/PageBlobURL.java index 84084f470..557be48e0 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/PageBlobURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/PageBlobURL.java @@ -95,6 +95,11 @@ public PageBlobURL withSnapshot(String snapshot) throws MalformedURLException, U * For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.create")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param size * Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a * 512-byte boundary. @@ -110,7 +115,7 @@ public PageBlobURL withSnapshot(String snapshot) throws MalformedURLException, U * @return * Emits the successful response. */ - public Single create( + public Single create( long size, Long sequenceNumber, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions) { if (size%PageBlobURL.PAGE_BYTES != 0) { @@ -129,7 +134,7 @@ public Single create( // TODO: What if you pass 0 for pageblob size? Validate? return addErrorWrappingToSingle(this.storageClient.generatedPageBlobs().createWithRestResponseAsync( - 0, null, + 0, size, null, headers.getContentType(), headers.getContentEncoding(), headers.getContentLanguage(), @@ -142,7 +147,7 @@ public Single create( accessConditions.getHttpAccessConditions().getIfUnmodifiedSince(), accessConditions.getHttpAccessConditions().getIfMatch().toString(), accessConditions.getHttpAccessConditions().getIfNoneMatch().toString(), - size, sequenceNumber, null)); + sequenceNumber, null)); } /** @@ -150,6 +155,11 @@ public Single create( * For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.uploadPages")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param pageRange * A {@link PageRange} object. Given that pages must be aligned with 512-byte boundaries, the start offset must * be a modulus of 512 and the end offset must be a modulus of 512 - 1. Examples of valid byte ranges are @@ -161,7 +171,7 @@ public Single create( * @return * Emits the successful response. */ - public Single uploadPages( + public Single uploadPages( PageRange pageRange, Flowable body, BlobAccessConditions accessConditions) { accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; if (pageRange == null) { @@ -188,6 +198,11 @@ public Single uploadPages( * For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.clearPages")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param pageRange * A {@link PageRange} object. Given that pages must be aligned with 512-byte boundaries, the start offset must * be a modulus of 512 and the end offset must be a modulus of 512 - 1. Examples of valid byte ranges are @@ -197,7 +212,7 @@ public Single uploadPages( * @return * Emits the successful response. */ - public Single clearPages( + public Single clearPages( PageRange pageRange, BlobAccessConditions accessConditions) { accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; if (pageRange == null) { @@ -223,6 +238,11 @@ public Single clearPages( * Returns the list of valid page ranges for a page blob or snapshot of a page blob. * For more information, see the Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.getPageRanges")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param blobRange * {@link BlobRange} * @param accessConditions @@ -230,7 +250,7 @@ public Single clearPages( * @return * Emits the successful response. */ - public Single getPageRanges( + public Single getPageRanges( BlobRange blobRange, BlobAccessConditions accessConditions) { blobRange = blobRange == null ? BlobRange.DEFAULT : blobRange; accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; @@ -249,6 +269,11 @@ public Single getPageRanges( * Gets the collection of page ranges that differ between a specified snapshot and this page blob. * For more information, see the Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_diff "Sample code for PageBlobURL.getPageRangesDiff")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param blobRange * {@link BlobRange} * @param prevSnapshot @@ -260,7 +285,7 @@ public Single getPageRanges( * @return * Emits the successful response. */ - public Single getPageRangesDiff( + public Single getPageRangesDiff( BlobRange blobRange, String prevSnapshot, BlobAccessConditions accessConditions) { blobRange = blobRange == null ? BlobRange.DEFAULT : blobRange; accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; @@ -283,6 +308,11 @@ public Single getPageRangesDiff( * Resizes the page blob to the specified size (which must be a multiple of 512). * For more information, see the Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.resize")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param size * Resizes a page blob to the specified size. If the specified value is less than the current size of the * blob, then all pages above the specified value are cleared. @@ -291,7 +321,7 @@ public Single getPageRangesDiff( * @return * Emits the successful response. */ - public Single resize( + public Single resize( long size, BlobAccessConditions accessConditions) { if (size%PageBlobURL.PAGE_BYTES != 0) { // Throwing is preferred to Single.error because this will error out immediately instead of waiting until @@ -312,6 +342,12 @@ public Single resize( /** * Sets the page blob's sequence number. + * For more information, see the Azure Docs. + * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.updateSequenceNumber")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) * * @param action * Indicates how the service should modify the blob's sequence number. @@ -323,7 +359,7 @@ public Single resize( * @return * Emits the successful response. */ - public Single updateSequenceNumber( + public Single updateSequenceNumber( SequenceNumberActionType action, Long sequenceNumber, BlobAccessConditions accessConditions) { if (sequenceNumber != null && sequenceNumber < 0) { // Throwing is preferred to Single.error because this will error out immediately instead of waiting until @@ -363,7 +399,7 @@ public Single updateSequenceNumber( * @return * Emits the successful response. */ - public Single copyIncremental( + public Single copyIncremental( URL source, String snapshot, BlobAccessConditions accessConditions) { accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; diff --git a/src/main/java/com/microsoft/azure/storage/blob/PipelineOptions.java b/src/main/java/com/microsoft/azure/storage/blob/PipelineOptions.java index cdea0cc49..ee11d5959 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/PipelineOptions.java +++ b/src/main/java/com/microsoft/azure/storage/blob/PipelineOptions.java @@ -64,6 +64,11 @@ public final class PipelineOptions { /** * Returns a {@code PipelineOptions} object with default values for each of the options fields. An * {@link HttpClient} must still be set explicitly, however. + * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=pipeline_options "Sample code for PipelineOptions constructor")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) */ public PipelineOptions() { this.logger = new HttpPipelineLogger() { diff --git a/src/main/java/com/microsoft/azure/storage/blob/RequestRetryFactory.java b/src/main/java/com/microsoft/azure/storage/blob/RequestRetryFactory.java index 15959aacc..baba627f3 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/RequestRetryFactory.java +++ b/src/main/java/com/microsoft/azure/storage/blob/RequestRetryFactory.java @@ -37,7 +37,6 @@ * secondary can handle the request. Exponential and fixed backoff are supported. The factory and policy must only be * used directly when creating a custom pipeline. */ -//TODO: This was retrying when I got the xml bom issue. Investigate that public final class RequestRetryFactory implements RequestPolicyFactory { private final RequestRetryOptions requestRetryOptions; diff --git a/src/main/java/com/microsoft/azure/storage/blob/RequestRetryOptions.java b/src/main/java/com/microsoft/azure/storage/blob/RequestRetryOptions.java index 4b8712d4b..f6e42e955 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/RequestRetryOptions.java +++ b/src/main/java/com/microsoft/azure/storage/blob/RequestRetryOptions.java @@ -48,6 +48,11 @@ public final class RequestRetryOptions { /** * Configures how the {@link com.microsoft.rest.v2.http.HttpPipeline} should retry requests. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=pipeline_options "Sample code for RequestRetryOptions constructor")] \n + * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param retryPolicyType * A {@link RetryPolicyType} specifying the type of retry pattern to use. A value of {@code null} accepts the * default. diff --git a/src/main/java/com/microsoft/azure/storage/blob/SR.java b/src/main/java/com/microsoft/azure/storage/blob/SR.java index e9a242011..ec4810195 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/SR.java +++ b/src/main/java/com/microsoft/azure/storage/blob/SR.java @@ -49,7 +49,7 @@ final class SR { public static final String INVALID_ACL_ACCESS_TYPE = "Invalid acl public access type returned '%s'. Expected blob or container."; public static final String INVALID_BLOB_TYPE = "Incorrect Blob type, please use the correct Blob type to access a blob on the server. Expected %s, actual %s."; public static final String INVALID_BLOCK_ID = "Invalid blockID, blockID must be a valid Base64 String."; - public static final String INVALID_BLOCK_SIZE = "Block data should not exceed BlockBlobURL.MAX_PUT_BLOCK_BYTES"; + public static final String INVALID_BLOCK_SIZE = "Block data should not exceed BlockBlobURL.MAX_STAGE_BLOCK_BYTES"; public static final String INVALID_CONDITIONAL_HEADERS = "The conditionals specified for this operation did not match server."; public static final String INVALID_CONNECTION_STRING = "Invalid connection string."; public static final String INVALID_CONNECTION_STRING_DEV_STORE_NOT_TRUE = "Invalid connection string, the UseDevelopmentStorage key must always be paired with 'true'. Remove the flag entirely otherwise."; diff --git a/src/main/java/com/microsoft/azure/storage/blob/ServiceSASSignatureValues.java b/src/main/java/com/microsoft/azure/storage/blob/ServiceSASSignatureValues.java index 49079b357..fad80ce95 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/ServiceSASSignatureValues.java +++ b/src/main/java/com/microsoft/azure/storage/blob/ServiceSASSignatureValues.java @@ -29,6 +29,11 @@ * * Please see here for * more details on each value, including which are required. + * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_sas "Sample code for ServiceSASSignatureValues")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) */ public final class ServiceSASSignatureValues { diff --git a/src/main/java/com/microsoft/azure/storage/blob/ServiceURL.java b/src/main/java/com/microsoft/azure/storage/blob/ServiceURL.java index 8ea6eb226..9a6a4ab2b 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/ServiceURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/ServiceURL.java @@ -35,6 +35,12 @@ public final class ServiceURL extends StorageURL { /** * Creates a {@code ServiceURL} object pointing to the account specified by the URL and using the provided pipeline * to make HTTP requests. + * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_url "Sample code for ServiceURL constructor")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param url * A url to an Azure Storage account. * @param pipeline @@ -78,6 +84,12 @@ public ServiceURL withPipeline(HttpPipeline pipeline) { * Marker) to get the next segment. For more information, see * the Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_list "Sample code for ServiceURL.listContainersSegment")] \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_list_helper "Helper code for ServiceURL.listContainersSegment")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param marker * Identifies the portion of the list to be returned with the next list operation. * This value is returned in the response of a previous list operation as the @@ -99,6 +111,11 @@ public Single listContainersSegment( * Gets the properties of a storage account’s Blob service. For more information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_getsetprops "Sample code for ServiceURL.getProperties")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @return * Emits the successful response. */ @@ -113,6 +130,11 @@ public Single getProperties() { * Note that setting the default service version has no effect when using this client because this client explicitly * sets the version header on each request, overriding the default. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_getsetprops "Sample code for ServiceURL.setProperties")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param properties * Configures the service. * @return @@ -130,6 +152,11 @@ public Single setProperties(StorageServiceProperti * information, see the * Azure Docs. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_stats "Sample code for ServiceURL.getStats")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @return * Emits the successful response. */ diff --git a/src/main/java/com/microsoft/azure/storage/blob/StorageException.java b/src/main/java/com/microsoft/azure/storage/blob/StorageException.java index 760985141..9dac990af 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/StorageException.java +++ b/src/main/java/com/microsoft/azure/storage/blob/StorageException.java @@ -27,6 +27,11 @@ * Note that even some expected "errors" will be thrown as a {@code StorageException}. For example, some users may * perform a getProperties request on an entity to determine whether it exists or not. If it does not exists, an * exception will be thrown even though this may be considered an expected indication of absence in this case. + * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=exception "Sample code for StorageExceptions")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) */ public final class StorageException extends RestException{ diff --git a/src/main/java/com/microsoft/azure/storage/blob/StorageURL.java b/src/main/java/com/microsoft/azure/storage/blob/StorageURL.java index 42055a5c8..e2184a728 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/StorageURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/StorageURL.java @@ -97,6 +97,11 @@ else if (url.path().charAt(url.path().length() - 1) != '/') { /** * Creates an pipeline to process the HTTP requests and Responses. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_url "Sample code for StorageURL.createPipeline")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param credentials * The credentials the pipeline will use to authenticate the requests. * @param pipelineOptions diff --git a/src/main/java/com/microsoft/azure/storage/blob/TransferManager.java b/src/main/java/com/microsoft/azure/storage/blob/TransferManager.java index 46e1bcf5b..485253793 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/TransferManager.java +++ b/src/main/java/com/microsoft/azure/storage/blob/TransferManager.java @@ -95,6 +95,11 @@ else if (parallelism <= 0) { /** * Uploads the contents of a file to a block blob in parallel, breaking it into block-size chunks if necessary. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=tm_file "Sample code for TransferManager.uploadFileToBlockBlob")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param file * The file to upload. * @param blockBlobURL @@ -102,7 +107,7 @@ else if (parallelism <= 0) { * @param blockLength * If the data must be broken up into blocks, this value determines what size those blocks will be. This will * affect the total number of service requests made. This value will be ignored if the data can be uploaded in - * a single put-blob operation. Must be between 1 and {@link BlockBlobURL#MAX_PUT_BLOCK_BYTES}. Note as well + * a single put-blob operation. Must be between 1 and {@link BlockBlobURL#MAX_STAGE_BLOCK_BYTES}. Note as well * that {@code fileLength/blockLength} must be less than or equal to {@link BlockBlobURL#MAX_BLOCKS}. * @param options * {@link UploadToBlockBlobOptions} @@ -114,7 +119,7 @@ public static Single uploadFileToBlockBlob( final UploadToBlockBlobOptions options) { Utility.assertNotNull("file", file); Utility.assertNotNull("blockBlobURL", blockBlobURL); - Utility.assertInBounds("blockLength", blockLength, 1, BlockBlobURL.MAX_PUT_BLOCK_BYTES); + Utility.assertInBounds("blockLength", blockLength, 1, BlockBlobURL.MAX_STAGE_BLOCK_BYTES); UploadToBlockBlobOptions optionsReal = options == null ? UploadToBlockBlobOptions.DEFAULT : options; try { @@ -161,6 +166,11 @@ static int calculateNumBlocks(long dataSize, int blockLength) { /** * Uploads a large ByteBuffer to a block blob in parallel, breaking it up into block-size chunks if necessary. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=tm_buffer "Sample code for TransferManager.uploadByteBufferToBlockBlob")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param data * The buffer to upload. * @param blockBlobURL @@ -179,7 +189,7 @@ public static Single uploadByteBufferToBlockBlob( final UploadToBlockBlobOptions options) { Utility.assertNotNull("data", data); Utility.assertNotNull("blockBlobURL", blockBlobURL); - Utility.assertInBounds("blockLength", blockLength, 1, BlockBlobURL.MAX_PUT_BLOCK_BYTES); + Utility.assertInBounds("blockLength", blockLength, 1, BlockBlobURL.MAX_STAGE_BLOCK_BYTES); UploadToBlockBlobOptions optionsReal = options == null ? UploadToBlockBlobOptions.DEFAULT : options; // If the size of the buffer can fit in a single upload, do it this way. @@ -208,9 +218,14 @@ public static Single uploadByteBufferToBlockBlob( * (i.e. less than or equal to {@link BlockBlobURL#MAX_PUT_BLOB_BYTES}, this method will perform a single upload * operation. Otherwise, each {@code ByteBuffer} in the iterable is assumed to be its own discreet block of data for * the block blob and will be uploaded as such. Note that in this case, each ByteBuffer must be less than or equal - * to {@link BlockBlobURL#MAX_PUT_BLOCK_BYTES}. Note as well that there can only be up to + * to {@link BlockBlobURL#MAX_STAGE_BLOCK_BYTES}. Note as well that there can only be up to * {@link BlockBlobURL#MAX_BLOCKS} ByteBuffers in the list. * + * @apiNote + * ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=tm_buffers "Sample code for TransferManager.uploadByteBuffersToBlockBlob")] \n + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/New-Storage-SDK-V10-Preview/src/test/java/com/microsoft/azure/storage/Samples.java) + * * @param data * The data to upload. * @param blockBlobURL @@ -254,7 +269,7 @@ public static Single uploadByteBuffersToBlockBlob( composing the list of Ids later. */ .concatMapEager(blockData -> { - if (blockData.remaining() > BlockBlobURL.MAX_PUT_BLOCK_BYTES) { + if (blockData.remaining() > BlockBlobURL.MAX_STAGE_BLOCK_BYTES) { throw new IllegalArgumentException(SR.INVALID_BLOCK_SIZE); } diff --git a/src/main/java/com/microsoft/azure/storage/blob/implementation/SignedIdentifierWrapper.java b/src/main/java/com/microsoft/azure/storage/blob/implementation/SignedIdentifierWrapper.java new file mode 100644 index 000000000..b74605fea --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/implementation/SignedIdentifierWrapper.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.implementation; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.microsoft.azure.storage.blob.models.SignedIdentifier; +import java.util.ArrayList; +import java.util.List; + +/** + * A wrapper around List<SignedIdentifier> which provides top-level metadata for serialization. + */ +@JacksonXmlRootElement(localName = "SignedIdentifier") +public final class SignedIdentifierWrapper { + @JacksonXmlProperty(localName = "SignedIdentifier") + private final List signedIdentifier; + + /** + * Creates an instance of SignedIdentifierWrapper. + * + * @param signedIdentifier the list. + */ + @JsonCreator + public SignedIdentifierWrapper(@JsonProperty("SignedIdentifier") List signedIdentifier) { + this.signedIdentifier = signedIdentifier; + } + + /** + * Get the List<SignedIdentifier> contained in this wrapper. + * + * @return the List<SignedIdentifier>. + */ + public List items() { + return signedIdentifier; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/AccountKind.java b/src/main/java/com/microsoft/azure/storage/blob/models/AccountKind.java new file mode 100644 index 000000000..c6bdc109c --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/AccountKind.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccountKind. + */ +public enum AccountKind { + /** + * Enum value Storage. + */ + STORAGE("Storage"), + + /** + * Enum value BlobStorage. + */ + BLOB_STORAGE("BlobStorage"), + + /** + * Enum value StorageV2. + */ + STORAGE_V2("StorageV2"); + + /** + * The actual serialized value for a AccountKind instance. + */ + private final String value; + + private AccountKind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccountKind instance. + * + * @param value the serialized value to parse. + * @return the parsed AccountKind object, or null if unable to parse. + */ + @JsonCreator + public static AccountKind fromString(String value) { + AccountKind[] items = AccountKind.values(); + for (AccountKind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsAppendBlockHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobAppendBlockHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsAppendBlockHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobAppendBlockHeaders.java index 633fe44ab..1a5fb28a1 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsAppendBlockHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobAppendBlockHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for AppendBlock operation. */ -@JacksonXmlRootElement(localName = "AppendBlobs-AppendBlock-Headers") -public final class AppendBlobsAppendBlockHeaders { +@JacksonXmlRootElement(localName = "AppendBlob-AppendBlock-Headers") +public final class AppendBlobAppendBlockHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -94,9 +94,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the AppendBlobsAppendBlockHeaders object itself. + * @return the AppendBlobAppendBlockHeaders object itself. */ - public AppendBlobsAppendBlockHeaders withETag(String eTag) { + public AppendBlobAppendBlockHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -117,9 +117,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the AppendBlobsAppendBlockHeaders object itself. + * @return the AppendBlobAppendBlockHeaders object itself. */ - public AppendBlobsAppendBlockHeaders withLastModified(OffsetDateTime lastModified) { + public AppendBlobAppendBlockHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -141,9 +141,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the AppendBlobsAppendBlockHeaders object itself. + * @return the AppendBlobAppendBlockHeaders object itself. */ - public AppendBlobsAppendBlockHeaders withContentMD5(byte[] contentMD5) { + public AppendBlobAppendBlockHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -161,9 +161,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the AppendBlobsAppendBlockHeaders object itself. + * @return the AppendBlobAppendBlockHeaders object itself. */ - public AppendBlobsAppendBlockHeaders withRequestId(String requestId) { + public AppendBlobAppendBlockHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -181,9 +181,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the AppendBlobsAppendBlockHeaders object itself. + * @return the AppendBlobAppendBlockHeaders object itself. */ - public AppendBlobsAppendBlockHeaders withVersion(String version) { + public AppendBlobAppendBlockHeaders withVersion(String version) { this.version = version; return this; } @@ -204,9 +204,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the AppendBlobsAppendBlockHeaders object itself. + * @return the AppendBlobAppendBlockHeaders object itself. */ - public AppendBlobsAppendBlockHeaders withDate(OffsetDateTime date) { + public AppendBlobAppendBlockHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -228,9 +228,9 @@ public String blobAppendOffset() { * Set the blobAppendOffset value. * * @param blobAppendOffset the blobAppendOffset value to set. - * @return the AppendBlobsAppendBlockHeaders object itself. + * @return the AppendBlobAppendBlockHeaders object itself. */ - public AppendBlobsAppendBlockHeaders withBlobAppendOffset(String blobAppendOffset) { + public AppendBlobAppendBlockHeaders withBlobAppendOffset(String blobAppendOffset) { this.blobAppendOffset = blobAppendOffset; return this; } @@ -248,9 +248,9 @@ public Integer blobCommittedBlockCount() { * Set the blobCommittedBlockCount value. * * @param blobCommittedBlockCount the blobCommittedBlockCount value to set. - * @return the AppendBlobsAppendBlockHeaders object itself. + * @return the AppendBlobAppendBlockHeaders object itself. */ - public AppendBlobsAppendBlockHeaders withBlobCommittedBlockCount(Integer blobCommittedBlockCount) { + public AppendBlobAppendBlockHeaders withBlobCommittedBlockCount(Integer blobCommittedBlockCount) { this.blobCommittedBlockCount = blobCommittedBlockCount; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsAppendBlockResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobAppendBlockResponse.java similarity index 61% rename from src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsAppendBlockResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobAppendBlockResponse.java index 53f0706ec..f612a47ec 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsAppendBlockResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobAppendBlockResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the appendBlock operation. */ -public final class AppendBlobsAppendBlockResponse extends RestResponse { +public final class AppendBlobAppendBlockResponse extends RestResponse { /** - * Creates an instance of AppendBlobsAppendBlockResponse. + * Creates an instance of AppendBlobAppendBlockResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public AppendBlobsAppendBlockResponse(int statusCode, AppendBlobsAppendBlockHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public AppendBlobAppendBlockResponse(HttpRequest request, int statusCode, AppendBlobAppendBlockHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public AppendBlobsAppendBlockHeaders headers() { + public AppendBlobAppendBlockHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsUploadHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobCreateHeaders.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsUploadHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobCreateHeaders.java index 7b308b027..128a14de4 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsUploadHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobCreateHeaders.java @@ -17,10 +17,10 @@ import java.time.OffsetDateTime; /** - * Defines headers for Upload operation. + * Defines headers for Create operation. */ -@JacksonXmlRootElement(localName = "BlockBlobs-Upload-Headers") -public final class BlockBlobsUploadHeaders { +@JacksonXmlRootElement(localName = "AppendBlob-Create-Headers") +public final class AppendBlobCreateHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -88,9 +88,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlockBlobsUploadHeaders object itself. + * @return the AppendBlobCreateHeaders object itself. */ - public BlockBlobsUploadHeaders withETag(String eTag) { + public AppendBlobCreateHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -111,9 +111,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlockBlobsUploadHeaders object itself. + * @return the AppendBlobCreateHeaders object itself. */ - public BlockBlobsUploadHeaders withLastModified(OffsetDateTime lastModified) { + public AppendBlobCreateHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -135,9 +135,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the BlockBlobsUploadHeaders object itself. + * @return the AppendBlobCreateHeaders object itself. */ - public BlockBlobsUploadHeaders withContentMD5(byte[] contentMD5) { + public AppendBlobCreateHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -155,9 +155,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlockBlobsUploadHeaders object itself. + * @return the AppendBlobCreateHeaders object itself. */ - public BlockBlobsUploadHeaders withRequestId(String requestId) { + public AppendBlobCreateHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -175,9 +175,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlockBlobsUploadHeaders object itself. + * @return the AppendBlobCreateHeaders object itself. */ - public BlockBlobsUploadHeaders withVersion(String version) { + public AppendBlobCreateHeaders withVersion(String version) { this.version = version; return this; } @@ -198,9 +198,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlockBlobsUploadHeaders object itself. + * @return the AppendBlobCreateHeaders object itself. */ - public BlockBlobsUploadHeaders withDate(OffsetDateTime date) { + public AppendBlobCreateHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -222,9 +222,9 @@ public Boolean isServerEncrypted() { * Set the isServerEncrypted value. * * @param isServerEncrypted the isServerEncrypted value to set. - * @return the BlockBlobsUploadHeaders object itself. + * @return the AppendBlobCreateHeaders object itself. */ - public BlockBlobsUploadHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + public AppendBlobCreateHeaders withIsServerEncrypted(Boolean isServerEncrypted) { this.isServerEncrypted = isServerEncrypted; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsCreateResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobCreateResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsCreateResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobCreateResponse.java index a5f75411f..41b2b3b6d 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsCreateResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobCreateResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the create operation. */ -public final class AppendBlobsCreateResponse extends RestResponse { +public final class AppendBlobCreateResponse extends RestResponse { /** - * Creates an instance of AppendBlobsCreateResponse. + * Creates an instance of AppendBlobCreateResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public AppendBlobsCreateResponse(int statusCode, AppendBlobsCreateHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public AppendBlobCreateResponse(HttpRequest request, int statusCode, AppendBlobCreateHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public AppendBlobsCreateHeaders headers() { + public AppendBlobCreateHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsAbortCopyFromURLHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobAbortCopyFromURLHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsAbortCopyFromURLHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobAbortCopyFromURLHeaders.java index 0ca7a9e12..a1380974f 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsAbortCopyFromURLHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobAbortCopyFromURLHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for AbortCopyFromURL operation. */ -@JacksonXmlRootElement(localName = "Blobs-AbortCopyFromURL-Headers") -public final class BlobsAbortCopyFromURLHeaders { +@JacksonXmlRootElement(localName = "Blob-AbortCopyFromURL-Headers") +public final class BlobAbortCopyFromURLHeaders { /** * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -56,9 +56,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsAbortCopyFromURLHeaders object itself. + * @return the BlobAbortCopyFromURLHeaders object itself. */ - public BlobsAbortCopyFromURLHeaders withRequestId(String requestId) { + public BlobAbortCopyFromURLHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -76,9 +76,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsAbortCopyFromURLHeaders object itself. + * @return the BlobAbortCopyFromURLHeaders object itself. */ - public BlobsAbortCopyFromURLHeaders withVersion(String version) { + public BlobAbortCopyFromURLHeaders withVersion(String version) { this.version = version; return this; } @@ -99,9 +99,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsAbortCopyFromURLHeaders object itself. + * @return the BlobAbortCopyFromURLHeaders object itself. */ - public BlobsAbortCopyFromURLHeaders withDate(OffsetDateTime date) { + public BlobAbortCopyFromURLHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsAbortCopyFromURLResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobAbortCopyFromURLResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsAbortCopyFromURLResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobAbortCopyFromURLResponse.java index 499f082bd..09f572676 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsAbortCopyFromURLResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobAbortCopyFromURLResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the abortCopyFromURL operation. */ -public final class BlobsAbortCopyFromURLResponse extends RestResponse { +public final class BlobAbortCopyFromURLResponse extends RestResponse { /** - * Creates an instance of BlobsAbortCopyFromURLResponse. + * Creates an instance of BlobAbortCopyFromURLResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsAbortCopyFromURLResponse(int statusCode, BlobsAbortCopyFromURLHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobAbortCopyFromURLResponse(HttpRequest request, int statusCode, BlobAbortCopyFromURLHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsAbortCopyFromURLHeaders headers() { + public BlobAbortCopyFromURLHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsAcquireLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobAcquireLeaseHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsAcquireLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobAcquireLeaseHeaders.java index 6a7a4224b..b3fa9ebc3 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsAcquireLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobAcquireLeaseHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for AcquireLease operation. */ -@JacksonXmlRootElement(localName = "Blobs-AcquireLease-Headers") -public final class BlobsAcquireLeaseHeaders { +@JacksonXmlRootElement(localName = "Blob-AcquireLease-Headers") +public final class BlobAcquireLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -78,9 +78,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsAcquireLeaseHeaders object itself. + * @return the BlobAcquireLeaseHeaders object itself. */ - public BlobsAcquireLeaseHeaders withETag(String eTag) { + public BlobAcquireLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -101,9 +101,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsAcquireLeaseHeaders object itself. + * @return the BlobAcquireLeaseHeaders object itself. */ - public BlobsAcquireLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public BlobAcquireLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -125,9 +125,9 @@ public String leaseId() { * Set the leaseId value. * * @param leaseId the leaseId value to set. - * @return the BlobsAcquireLeaseHeaders object itself. + * @return the BlobAcquireLeaseHeaders object itself. */ - public BlobsAcquireLeaseHeaders withLeaseId(String leaseId) { + public BlobAcquireLeaseHeaders withLeaseId(String leaseId) { this.leaseId = leaseId; return this; } @@ -145,9 +145,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsAcquireLeaseHeaders object itself. + * @return the BlobAcquireLeaseHeaders object itself. */ - public BlobsAcquireLeaseHeaders withRequestId(String requestId) { + public BlobAcquireLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsAcquireLeaseHeaders object itself. + * @return the BlobAcquireLeaseHeaders object itself. */ - public BlobsAcquireLeaseHeaders withVersion(String version) { + public BlobAcquireLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsAcquireLeaseHeaders object itself. + * @return the BlobAcquireLeaseHeaders object itself. */ - public BlobsAcquireLeaseHeaders withDate(OffsetDateTime date) { + public BlobAcquireLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsAcquireLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobAcquireLeaseResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsAcquireLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobAcquireLeaseResponse.java index 924fba67c..aa08a4182 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsAcquireLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobAcquireLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the acquireLease operation. */ -public final class BlobsAcquireLeaseResponse extends RestResponse { +public final class BlobAcquireLeaseResponse extends RestResponse { /** - * Creates an instance of BlobsAcquireLeaseResponse. + * Creates an instance of BlobAcquireLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsAcquireLeaseResponse(int statusCode, BlobsAcquireLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobAcquireLeaseResponse(HttpRequest request, int statusCode, BlobAcquireLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsAcquireLeaseHeaders headers() { + public BlobAcquireLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsBreakLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobBreakLeaseHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsBreakLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobBreakLeaseHeaders.java index 780feff60..0c0bbcec7 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsBreakLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobBreakLeaseHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for BreakLease operation. */ -@JacksonXmlRootElement(localName = "Blobs-BreakLease-Headers") -public final class BlobsBreakLeaseHeaders { +@JacksonXmlRootElement(localName = "Blob-BreakLease-Headers") +public final class BlobBreakLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -78,9 +78,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsBreakLeaseHeaders object itself. + * @return the BlobBreakLeaseHeaders object itself. */ - public BlobsBreakLeaseHeaders withETag(String eTag) { + public BlobBreakLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -101,9 +101,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsBreakLeaseHeaders object itself. + * @return the BlobBreakLeaseHeaders object itself. */ - public BlobsBreakLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public BlobBreakLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -125,9 +125,9 @@ public Integer leaseTime() { * Set the leaseTime value. * * @param leaseTime the leaseTime value to set. - * @return the BlobsBreakLeaseHeaders object itself. + * @return the BlobBreakLeaseHeaders object itself. */ - public BlobsBreakLeaseHeaders withLeaseTime(Integer leaseTime) { + public BlobBreakLeaseHeaders withLeaseTime(Integer leaseTime) { this.leaseTime = leaseTime; return this; } @@ -145,9 +145,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsBreakLeaseHeaders object itself. + * @return the BlobBreakLeaseHeaders object itself. */ - public BlobsBreakLeaseHeaders withRequestId(String requestId) { + public BlobBreakLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsBreakLeaseHeaders object itself. + * @return the BlobBreakLeaseHeaders object itself. */ - public BlobsBreakLeaseHeaders withVersion(String version) { + public BlobBreakLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsBreakLeaseHeaders object itself. + * @return the BlobBreakLeaseHeaders object itself. */ - public BlobsBreakLeaseHeaders withDate(OffsetDateTime date) { + public BlobBreakLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsBreakLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobBreakLeaseResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsBreakLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobBreakLeaseResponse.java index 33a360099..53c9e8496 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsBreakLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobBreakLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the breakLease operation. */ -public final class BlobsBreakLeaseResponse extends RestResponse { +public final class BlobBreakLeaseResponse extends RestResponse { /** - * Creates an instance of BlobsBreakLeaseResponse. + * Creates an instance of BlobBreakLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsBreakLeaseResponse(int statusCode, BlobsBreakLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobBreakLeaseResponse(HttpRequest request, int statusCode, BlobBreakLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsBreakLeaseHeaders headers() { + public BlobBreakLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsChangeLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobChangeLeaseHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsChangeLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobChangeLeaseHeaders.java index 91bb148dc..55fdf6cf9 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsChangeLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobChangeLeaseHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for ChangeLease operation. */ -@JacksonXmlRootElement(localName = "Blobs-ChangeLease-Headers") -public final class BlobsChangeLeaseHeaders { +@JacksonXmlRootElement(localName = "Blob-ChangeLease-Headers") +public final class BlobChangeLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -78,9 +78,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsChangeLeaseHeaders object itself. + * @return the BlobChangeLeaseHeaders object itself. */ - public BlobsChangeLeaseHeaders withETag(String eTag) { + public BlobChangeLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -101,9 +101,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsChangeLeaseHeaders object itself. + * @return the BlobChangeLeaseHeaders object itself. */ - public BlobsChangeLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public BlobChangeLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -125,9 +125,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsChangeLeaseHeaders object itself. + * @return the BlobChangeLeaseHeaders object itself. */ - public BlobsChangeLeaseHeaders withRequestId(String requestId) { + public BlobChangeLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -145,9 +145,9 @@ public String leaseId() { * Set the leaseId value. * * @param leaseId the leaseId value to set. - * @return the BlobsChangeLeaseHeaders object itself. + * @return the BlobChangeLeaseHeaders object itself. */ - public BlobsChangeLeaseHeaders withLeaseId(String leaseId) { + public BlobChangeLeaseHeaders withLeaseId(String leaseId) { this.leaseId = leaseId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsChangeLeaseHeaders object itself. + * @return the BlobChangeLeaseHeaders object itself. */ - public BlobsChangeLeaseHeaders withVersion(String version) { + public BlobChangeLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsChangeLeaseHeaders object itself. + * @return the BlobChangeLeaseHeaders object itself. */ - public BlobsChangeLeaseHeaders withDate(OffsetDateTime date) { + public BlobChangeLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsChangeLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobChangeLeaseResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsChangeLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobChangeLeaseResponse.java index 096df286d..91ce29d40 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsChangeLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobChangeLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the changeLease operation. */ -public final class BlobsChangeLeaseResponse extends RestResponse { +public final class BlobChangeLeaseResponse extends RestResponse { /** - * Creates an instance of BlobsChangeLeaseResponse. + * Creates an instance of BlobChangeLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsChangeLeaseResponse(int statusCode, BlobsChangeLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobChangeLeaseResponse(HttpRequest request, int statusCode, BlobChangeLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsChangeLeaseHeaders headers() { + public BlobChangeLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsCreateSnapshotHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobCreateSnapshotHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsCreateSnapshotHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobCreateSnapshotHeaders.java index bfc2dafe8..10a8abc84 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsCreateSnapshotHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobCreateSnapshotHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for CreateSnapshot operation. */ -@JacksonXmlRootElement(localName = "Blobs-CreateSnapshot-Headers") -public final class BlobsCreateSnapshotHeaders { +@JacksonXmlRootElement(localName = "Blob-CreateSnapshot-Headers") +public final class BlobCreateSnapshotHeaders { /** * Uniquely identifies the snapshot and indicates the snapshot version. It * may be used in subsequent requests to access the snapshot. @@ -79,9 +79,9 @@ public String snapshot() { * Set the snapshot value. * * @param snapshot the snapshot value to set. - * @return the BlobsCreateSnapshotHeaders object itself. + * @return the BlobCreateSnapshotHeaders object itself. */ - public BlobsCreateSnapshotHeaders withSnapshot(String snapshot) { + public BlobCreateSnapshotHeaders withSnapshot(String snapshot) { this.snapshot = snapshot; return this; } @@ -99,9 +99,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsCreateSnapshotHeaders object itself. + * @return the BlobCreateSnapshotHeaders object itself. */ - public BlobsCreateSnapshotHeaders withETag(String eTag) { + public BlobCreateSnapshotHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -122,9 +122,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsCreateSnapshotHeaders object itself. + * @return the BlobCreateSnapshotHeaders object itself. */ - public BlobsCreateSnapshotHeaders withLastModified(OffsetDateTime lastModified) { + public BlobCreateSnapshotHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -146,9 +146,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsCreateSnapshotHeaders object itself. + * @return the BlobCreateSnapshotHeaders object itself. */ - public BlobsCreateSnapshotHeaders withRequestId(String requestId) { + public BlobCreateSnapshotHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -166,9 +166,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsCreateSnapshotHeaders object itself. + * @return the BlobCreateSnapshotHeaders object itself. */ - public BlobsCreateSnapshotHeaders withVersion(String version) { + public BlobCreateSnapshotHeaders withVersion(String version) { this.version = version; return this; } @@ -189,9 +189,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsCreateSnapshotHeaders object itself. + * @return the BlobCreateSnapshotHeaders object itself. */ - public BlobsCreateSnapshotHeaders withDate(OffsetDateTime date) { + public BlobCreateSnapshotHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsCreateSnapshotResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobCreateSnapshotResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsCreateSnapshotResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobCreateSnapshotResponse.java index 2d253df5b..d4e3ece3c 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsCreateSnapshotResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobCreateSnapshotResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the createSnapshot operation. */ -public final class BlobsCreateSnapshotResponse extends RestResponse { +public final class BlobCreateSnapshotResponse extends RestResponse { /** - * Creates an instance of BlobsCreateSnapshotResponse. + * Creates an instance of BlobCreateSnapshotResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsCreateSnapshotResponse(int statusCode, BlobsCreateSnapshotHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobCreateSnapshotResponse(HttpRequest request, int statusCode, BlobCreateSnapshotHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsCreateSnapshotHeaders headers() { + public BlobCreateSnapshotHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsDeleteHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobDeleteHeaders.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsDeleteHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobDeleteHeaders.java index 415f9fdd8..b0af90dc3 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsDeleteHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobDeleteHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for Delete operation. */ -@JacksonXmlRootElement(localName = "Blobs-Delete-Headers") -public final class BlobsDeleteHeaders { +@JacksonXmlRootElement(localName = "Blob-Delete-Headers") +public final class BlobDeleteHeaders { /** * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -56,9 +56,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsDeleteHeaders object itself. + * @return the BlobDeleteHeaders object itself. */ - public BlobsDeleteHeaders withRequestId(String requestId) { + public BlobDeleteHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -76,9 +76,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsDeleteHeaders object itself. + * @return the BlobDeleteHeaders object itself. */ - public BlobsDeleteHeaders withVersion(String version) { + public BlobDeleteHeaders withVersion(String version) { this.version = version; return this; } @@ -99,9 +99,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsDeleteHeaders object itself. + * @return the BlobDeleteHeaders object itself. */ - public BlobsDeleteHeaders withDate(OffsetDateTime date) { + public BlobDeleteHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsDeleteResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobDeleteResponse.java similarity index 64% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsDeleteResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobDeleteResponse.java index e1c4e53d8..dd452f42b 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsDeleteResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobDeleteResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the delete operation. */ -public final class BlobsDeleteResponse extends RestResponse { +public final class BlobDeleteResponse extends RestResponse { /** - * Creates an instance of BlobsDeleteResponse. + * Creates an instance of BlobDeleteResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsDeleteResponse(int statusCode, BlobsDeleteHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobDeleteResponse(HttpRequest request, int statusCode, BlobDeleteHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsDeleteHeaders headers() { + public BlobDeleteHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsDownloadHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobDownloadHeaders.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsDownloadHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobDownloadHeaders.java index 284d3efb7..c5f4d516e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsDownloadHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobDownloadHeaders.java @@ -21,8 +21,8 @@ /** * Defines headers for Download operation. */ -@JacksonXmlRootElement(localName = "Blobs-Download-Headers") -public final class BlobsDownloadHeaders { +@JacksonXmlRootElement(localName = "Blob-Download-Headers") +public final class BlobDownloadHeaders { /** * Returns the date and time the container was last modified. Any operation * that modifies the blob, including an update of the blob's metadata or @@ -270,9 +270,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withLastModified(OffsetDateTime lastModified) { + public BlobDownloadHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -294,9 +294,9 @@ public Map metadata() { * Set the metadata value. * * @param metadata the metadata value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withMetadata(Map metadata) { + public BlobDownloadHeaders withMetadata(Map metadata) { this.metadata = metadata; return this; } @@ -314,9 +314,9 @@ public Long contentLength() { * Set the contentLength value. * * @param contentLength the contentLength value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withContentLength(Long contentLength) { + public BlobDownloadHeaders withContentLength(Long contentLength) { this.contentLength = contentLength; return this; } @@ -334,9 +334,9 @@ public String contentType() { * Set the contentType value. * * @param contentType the contentType value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withContentType(String contentType) { + public BlobDownloadHeaders withContentType(String contentType) { this.contentType = contentType; return this; } @@ -354,9 +354,9 @@ public String contentRange() { * Set the contentRange value. * * @param contentRange the contentRange value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withContentRange(String contentRange) { + public BlobDownloadHeaders withContentRange(String contentRange) { this.contentRange = contentRange; return this; } @@ -374,9 +374,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withETag(String eTag) { + public BlobDownloadHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -394,9 +394,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withContentMD5(byte[] contentMD5) { + public BlobDownloadHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -414,9 +414,9 @@ public String contentEncoding() { * Set the contentEncoding value. * * @param contentEncoding the contentEncoding value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withContentEncoding(String contentEncoding) { + public BlobDownloadHeaders withContentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } @@ -434,9 +434,9 @@ public String cacheControl() { * Set the cacheControl value. * * @param cacheControl the cacheControl value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withCacheControl(String cacheControl) { + public BlobDownloadHeaders withCacheControl(String cacheControl) { this.cacheControl = cacheControl; return this; } @@ -454,9 +454,9 @@ public String contentDisposition() { * Set the contentDisposition value. * * @param contentDisposition the contentDisposition value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withContentDisposition(String contentDisposition) { + public BlobDownloadHeaders withContentDisposition(String contentDisposition) { this.contentDisposition = contentDisposition; return this; } @@ -474,9 +474,9 @@ public String contentLanguage() { * Set the contentLanguage value. * * @param contentLanguage the contentLanguage value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withContentLanguage(String contentLanguage) { + public BlobDownloadHeaders withContentLanguage(String contentLanguage) { this.contentLanguage = contentLanguage; return this; } @@ -494,9 +494,9 @@ public Long blobSequenceNumber() { * Set the blobSequenceNumber value. * * @param blobSequenceNumber the blobSequenceNumber value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withBlobSequenceNumber(Long blobSequenceNumber) { + public BlobDownloadHeaders withBlobSequenceNumber(Long blobSequenceNumber) { this.blobSequenceNumber = blobSequenceNumber; return this; } @@ -514,9 +514,9 @@ public BlobType blobType() { * Set the blobType value. * * @param blobType the blobType value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withBlobType(BlobType blobType) { + public BlobDownloadHeaders withBlobType(BlobType blobType) { this.blobType = blobType; return this; } @@ -537,9 +537,9 @@ public OffsetDateTime copyCompletionTime() { * Set the copyCompletionTime value. * * @param copyCompletionTime the copyCompletionTime value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withCopyCompletionTime(OffsetDateTime copyCompletionTime) { + public BlobDownloadHeaders withCopyCompletionTime(OffsetDateTime copyCompletionTime) { if (copyCompletionTime == null) { this.copyCompletionTime = null; } else { @@ -561,9 +561,9 @@ public String copyStatusDescription() { * Set the copyStatusDescription value. * * @param copyStatusDescription the copyStatusDescription value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withCopyStatusDescription(String copyStatusDescription) { + public BlobDownloadHeaders withCopyStatusDescription(String copyStatusDescription) { this.copyStatusDescription = copyStatusDescription; return this; } @@ -581,9 +581,9 @@ public String copyId() { * Set the copyId value. * * @param copyId the copyId value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withCopyId(String copyId) { + public BlobDownloadHeaders withCopyId(String copyId) { this.copyId = copyId; return this; } @@ -601,9 +601,9 @@ public String copyProgress() { * Set the copyProgress value. * * @param copyProgress the copyProgress value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withCopyProgress(String copyProgress) { + public BlobDownloadHeaders withCopyProgress(String copyProgress) { this.copyProgress = copyProgress; return this; } @@ -621,9 +621,9 @@ public String copySource() { * Set the copySource value. * * @param copySource the copySource value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withCopySource(String copySource) { + public BlobDownloadHeaders withCopySource(String copySource) { this.copySource = copySource; return this; } @@ -641,9 +641,9 @@ public CopyStatusType copyStatus() { * Set the copyStatus value. * * @param copyStatus the copyStatus value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withCopyStatus(CopyStatusType copyStatus) { + public BlobDownloadHeaders withCopyStatus(CopyStatusType copyStatus) { this.copyStatus = copyStatus; return this; } @@ -661,9 +661,9 @@ public LeaseDurationType leaseDuration() { * Set the leaseDuration value. * * @param leaseDuration the leaseDuration value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withLeaseDuration(LeaseDurationType leaseDuration) { + public BlobDownloadHeaders withLeaseDuration(LeaseDurationType leaseDuration) { this.leaseDuration = leaseDuration; return this; } @@ -681,9 +681,9 @@ public LeaseStateType leaseState() { * Set the leaseState value. * * @param leaseState the leaseState value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withLeaseState(LeaseStateType leaseState) { + public BlobDownloadHeaders withLeaseState(LeaseStateType leaseState) { this.leaseState = leaseState; return this; } @@ -701,9 +701,9 @@ public LeaseStatusType leaseStatus() { * Set the leaseStatus value. * * @param leaseStatus the leaseStatus value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withLeaseStatus(LeaseStatusType leaseStatus) { + public BlobDownloadHeaders withLeaseStatus(LeaseStatusType leaseStatus) { this.leaseStatus = leaseStatus; return this; } @@ -721,9 +721,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withRequestId(String requestId) { + public BlobDownloadHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -741,9 +741,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withVersion(String version) { + public BlobDownloadHeaders withVersion(String version) { this.version = version; return this; } @@ -761,9 +761,9 @@ public String acceptRanges() { * Set the acceptRanges value. * * @param acceptRanges the acceptRanges value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withAcceptRanges(String acceptRanges) { + public BlobDownloadHeaders withAcceptRanges(String acceptRanges) { this.acceptRanges = acceptRanges; return this; } @@ -784,9 +784,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withDate(OffsetDateTime date) { + public BlobDownloadHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -808,9 +808,9 @@ public Integer blobCommittedBlockCount() { * Set the blobCommittedBlockCount value. * * @param blobCommittedBlockCount the blobCommittedBlockCount value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withBlobCommittedBlockCount(Integer blobCommittedBlockCount) { + public BlobDownloadHeaders withBlobCommittedBlockCount(Integer blobCommittedBlockCount) { this.blobCommittedBlockCount = blobCommittedBlockCount; return this; } @@ -828,9 +828,9 @@ public Boolean isServerEncrypted() { * Set the isServerEncrypted value. * * @param isServerEncrypted the isServerEncrypted value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + public BlobDownloadHeaders withIsServerEncrypted(Boolean isServerEncrypted) { this.isServerEncrypted = isServerEncrypted; return this; } @@ -848,9 +848,9 @@ public byte[] blobContentMD5() { * Set the blobContentMD5 value. * * @param blobContentMD5 the blobContentMD5 value to set. - * @return the BlobsDownloadHeaders object itself. + * @return the BlobDownloadHeaders object itself. */ - public BlobsDownloadHeaders withBlobContentMD5(byte[] blobContentMD5) { + public BlobDownloadHeaders withBlobContentMD5(byte[] blobContentMD5) { this.blobContentMD5 = blobContentMD5; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsDownloadResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobDownloadResponse.java similarity index 71% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsDownloadResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobDownloadResponse.java index d6589de12..227b178df 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsDownloadResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobDownloadResponse.java @@ -11,6 +11,7 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import io.reactivex.Flowable; import io.reactivex.internal.functions.Functions; import java.io.Closeable; @@ -20,24 +21,25 @@ /** * Contains all response data for the download operation. */ -public final class BlobsDownloadResponse extends RestResponse> implements Closeable { +public final class BlobDownloadResponse extends RestResponse> implements Closeable { /** - * Creates an instance of BlobsDownloadResponse. + * Creates an instance of BlobDownloadResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the body content stream. */ - public BlobsDownloadResponse(int statusCode, BlobsDownloadHeaders headers, Map rawHeaders, Flowable body) { - super(statusCode, headers, rawHeaders, body); + public BlobDownloadResponse(HttpRequest request, int statusCode, BlobDownloadHeaders headers, Map rawHeaders, Flowable body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsDownloadHeaders headers() { + public BlobDownloadHeaders headers() { return super.headers(); } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobFlatList.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobFlatListSegment.java similarity index 56% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobFlatList.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobFlatListSegment.java index 84aeddb41..8aa2b7bf3 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobFlatList.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobFlatListSegment.java @@ -17,33 +17,33 @@ import java.util.List; /** - * The BlobFlatList model. + * The BlobFlatListSegment model. */ -@JacksonXmlRootElement(localName = "BlobFlatList") -public final class BlobFlatList { +@JacksonXmlRootElement(localName = "Blobs") +public final class BlobFlatListSegment { /** - * The blob property. + * The blobItems property. */ @JsonProperty("Blob") - private List blob = new ArrayList<>(); + private List blobItems = new ArrayList<>(); /** - * Get the blob value. + * Get the blobItems value. * - * @return the blob value. + * @return the blobItems value. */ - public List blob() { - return this.blob; + public List blobItems() { + return this.blobItems; } /** - * Set the blob value. + * Set the blobItems value. * - * @param blob the blob value to set. - * @return the BlobFlatList object itself. + * @param blobItems the blobItems value to set. + * @return the BlobFlatListSegment object itself. */ - public BlobFlatList withBlob(List blob) { - this.blob = blob; + public BlobFlatListSegment withBlobItems(List blobItems) { + this.blobItems = blobItems; return this; } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetAccountInfoHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetAccountInfoHeaders.java new file mode 100644 index 000000000..87da30dcb --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetAccountInfoHeaders.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.microsoft.rest.v2.DateTimeRfc1123; +import java.time.OffsetDateTime; + +/** + * Defines headers for GetAccountInfo operation. + */ +@JacksonXmlRootElement(localName = "Blob-GetAccountInfo-Headers") +public final class BlobGetAccountInfoHeaders { + /** + * This header uniquely identifies the request that was made and can be + * used for troubleshooting the request. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /** + * Indicates the version of the Blob service used to execute the request. + * This header is returned for requests made against version 2009-09-19 and + * above. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /** + * UTC date/time value generated by the service that indicates the time at + * which the response was initiated. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 date; + + /** + * Identifies the sku name of the account. Possible values include: + * 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', + * 'Premium_LRS'. + */ + @JsonProperty(value = "x-ms-sku-name") + private SkuName skuName; + + /** + * Identifies the account kind. Possible values include: 'Storage', + * 'BlobStorage', 'StorageV2'. + */ + @JsonProperty(value = "x-ms-account-kind") + private AccountKind accountKind; + + /** + * Get the requestId value. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId value. + * + * @param requestId the requestId value to set. + * @return the BlobGetAccountInfoHeaders object itself. + */ + public BlobGetAccountInfoHeaders withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version value. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version value. + * + * @param version the version value to set. + * @return the BlobGetAccountInfoHeaders object itself. + */ + public BlobGetAccountInfoHeaders withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the date value. + * + * @return the date value. + */ + public OffsetDateTime date() { + if (this.date == null) { + return null; + } + return this.date.dateTime(); + } + + /** + * Set the date value. + * + * @param date the date value to set. + * @return the BlobGetAccountInfoHeaders object itself. + */ + public BlobGetAccountInfoHeaders withDate(OffsetDateTime date) { + if (date == null) { + this.date = null; + } else { + this.date = new DateTimeRfc1123(date); + } + return this; + } + + /** + * Get the skuName value. + * + * @return the skuName value. + */ + public SkuName skuName() { + return this.skuName; + } + + /** + * Set the skuName value. + * + * @param skuName the skuName value to set. + * @return the BlobGetAccountInfoHeaders object itself. + */ + public BlobGetAccountInfoHeaders withSkuName(SkuName skuName) { + this.skuName = skuName; + return this; + } + + /** + * Get the accountKind value. + * + * @return the accountKind value. + */ + public AccountKind accountKind() { + return this.accountKind; + } + + /** + * Set the accountKind value. + * + * @param accountKind the accountKind value to set. + * @return the BlobGetAccountInfoHeaders object itself. + */ + public BlobGetAccountInfoHeaders withAccountKind(AccountKind accountKind) { + this.accountKind = accountKind; + return this; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetAccountInfoResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetAccountInfoResponse.java new file mode 100644 index 000000000..d774469ca --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetAccountInfoResponse.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; +import java.util.Map; + +/** + * Contains all response data for the getAccountInfo operation. + */ +public final class BlobGetAccountInfoResponse extends RestResponse { + /** + * Creates an instance of BlobGetAccountInfoResponse. + * + * @param request the request which resulted in this {response.Name}. + * @param statusCode the status code of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param body the deserialized body of the HTTP response. + */ + public BlobGetAccountInfoResponse(HttpRequest request, int statusCode, BlobGetAccountInfoHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); + } + + /** + * @return the deserialized response headers. + */ + @Override + public BlobGetAccountInfoHeaders headers() { + return super.headers(); + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsGetPropertiesHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesHeaders.java similarity index 77% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsGetPropertiesHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesHeaders.java index ca718e701..7510195de 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsGetPropertiesHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesHeaders.java @@ -21,8 +21,8 @@ /** * Defines headers for GetProperties operation. */ -@JacksonXmlRootElement(localName = "Blobs-GetProperties-Headers") -public final class BlobsGetPropertiesHeaders { +@JacksonXmlRootElement(localName = "Blob-GetProperties-Headers") +public final class BlobGetPropertiesHeaders { /** * Returns the date and time the container was last modified. Any operation * that modifies the blob, including an update of the blob's metadata or @@ -31,6 +31,12 @@ public final class BlobsGetPropertiesHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /** + * Returns the date and time the blob was created. + */ + @JsonProperty(value = "x-ms-creation-time") + private DateTimeRfc1123 creationTime; + /** * The metadata property. */ @@ -278,6 +284,13 @@ public final class BlobsGetPropertiesHeaders { @JsonProperty(value = "x-ms-archive-status") private String archiveStatus; + /** + * The time the tier was changed on the object. This is only returned if + * the tier on the block blob was ever set. + */ + @JsonProperty(value = "x-ms-access-tier-change-time") + private DateTimeRfc1123 accessTierChangeTime; + /** * Get the lastModified value. * @@ -294,9 +307,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withLastModified(OffsetDateTime lastModified) { + public BlobGetPropertiesHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -305,6 +318,33 @@ public BlobsGetPropertiesHeaders withLastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the creationTime value. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + if (this.creationTime == null) { + return null; + } + return this.creationTime.dateTime(); + } + + /** + * Set the creationTime value. + * + * @param creationTime the creationTime value to set. + * @return the BlobGetPropertiesHeaders object itself. + */ + public BlobGetPropertiesHeaders withCreationTime(OffsetDateTime creationTime) { + if (creationTime == null) { + this.creationTime = null; + } else { + this.creationTime = new DateTimeRfc1123(creationTime); + } + return this; + } + /** * Get the metadata value. * @@ -318,9 +358,9 @@ public Map metadata() { * Set the metadata value. * * @param metadata the metadata value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withMetadata(Map metadata) { + public BlobGetPropertiesHeaders withMetadata(Map metadata) { this.metadata = metadata; return this; } @@ -338,9 +378,9 @@ public BlobType blobType() { * Set the blobType value. * * @param blobType the blobType value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withBlobType(BlobType blobType) { + public BlobGetPropertiesHeaders withBlobType(BlobType blobType) { this.blobType = blobType; return this; } @@ -361,9 +401,9 @@ public OffsetDateTime copyCompletionTime() { * Set the copyCompletionTime value. * * @param copyCompletionTime the copyCompletionTime value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withCopyCompletionTime(OffsetDateTime copyCompletionTime) { + public BlobGetPropertiesHeaders withCopyCompletionTime(OffsetDateTime copyCompletionTime) { if (copyCompletionTime == null) { this.copyCompletionTime = null; } else { @@ -385,9 +425,9 @@ public String copyStatusDescription() { * Set the copyStatusDescription value. * * @param copyStatusDescription the copyStatusDescription value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withCopyStatusDescription(String copyStatusDescription) { + public BlobGetPropertiesHeaders withCopyStatusDescription(String copyStatusDescription) { this.copyStatusDescription = copyStatusDescription; return this; } @@ -405,9 +445,9 @@ public String copyId() { * Set the copyId value. * * @param copyId the copyId value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withCopyId(String copyId) { + public BlobGetPropertiesHeaders withCopyId(String copyId) { this.copyId = copyId; return this; } @@ -425,9 +465,9 @@ public String copyProgress() { * Set the copyProgress value. * * @param copyProgress the copyProgress value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withCopyProgress(String copyProgress) { + public BlobGetPropertiesHeaders withCopyProgress(String copyProgress) { this.copyProgress = copyProgress; return this; } @@ -445,9 +485,9 @@ public String copySource() { * Set the copySource value. * * @param copySource the copySource value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withCopySource(String copySource) { + public BlobGetPropertiesHeaders withCopySource(String copySource) { this.copySource = copySource; return this; } @@ -465,9 +505,9 @@ public CopyStatusType copyStatus() { * Set the copyStatus value. * * @param copyStatus the copyStatus value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withCopyStatus(CopyStatusType copyStatus) { + public BlobGetPropertiesHeaders withCopyStatus(CopyStatusType copyStatus) { this.copyStatus = copyStatus; return this; } @@ -485,9 +525,9 @@ public Boolean isIncrementalCopy() { * Set the isIncrementalCopy value. * * @param isIncrementalCopy the isIncrementalCopy value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withIsIncrementalCopy(Boolean isIncrementalCopy) { + public BlobGetPropertiesHeaders withIsIncrementalCopy(Boolean isIncrementalCopy) { this.isIncrementalCopy = isIncrementalCopy; return this; } @@ -505,9 +545,9 @@ public String destinationSnapshot() { * Set the destinationSnapshot value. * * @param destinationSnapshot the destinationSnapshot value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withDestinationSnapshot(String destinationSnapshot) { + public BlobGetPropertiesHeaders withDestinationSnapshot(String destinationSnapshot) { this.destinationSnapshot = destinationSnapshot; return this; } @@ -525,9 +565,9 @@ public LeaseDurationType leaseDuration() { * Set the leaseDuration value. * * @param leaseDuration the leaseDuration value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withLeaseDuration(LeaseDurationType leaseDuration) { + public BlobGetPropertiesHeaders withLeaseDuration(LeaseDurationType leaseDuration) { this.leaseDuration = leaseDuration; return this; } @@ -545,9 +585,9 @@ public LeaseStateType leaseState() { * Set the leaseState value. * * @param leaseState the leaseState value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withLeaseState(LeaseStateType leaseState) { + public BlobGetPropertiesHeaders withLeaseState(LeaseStateType leaseState) { this.leaseState = leaseState; return this; } @@ -565,9 +605,9 @@ public LeaseStatusType leaseStatus() { * Set the leaseStatus value. * * @param leaseStatus the leaseStatus value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withLeaseStatus(LeaseStatusType leaseStatus) { + public BlobGetPropertiesHeaders withLeaseStatus(LeaseStatusType leaseStatus) { this.leaseStatus = leaseStatus; return this; } @@ -585,9 +625,9 @@ public Long contentLength() { * Set the contentLength value. * * @param contentLength the contentLength value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withContentLength(Long contentLength) { + public BlobGetPropertiesHeaders withContentLength(Long contentLength) { this.contentLength = contentLength; return this; } @@ -605,9 +645,9 @@ public String contentType() { * Set the contentType value. * * @param contentType the contentType value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withContentType(String contentType) { + public BlobGetPropertiesHeaders withContentType(String contentType) { this.contentType = contentType; return this; } @@ -625,9 +665,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withETag(String eTag) { + public BlobGetPropertiesHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -645,9 +685,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withContentMD5(byte[] contentMD5) { + public BlobGetPropertiesHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -665,9 +705,9 @@ public String contentEncoding() { * Set the contentEncoding value. * * @param contentEncoding the contentEncoding value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withContentEncoding(String contentEncoding) { + public BlobGetPropertiesHeaders withContentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } @@ -685,9 +725,9 @@ public String contentDisposition() { * Set the contentDisposition value. * * @param contentDisposition the contentDisposition value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withContentDisposition(String contentDisposition) { + public BlobGetPropertiesHeaders withContentDisposition(String contentDisposition) { this.contentDisposition = contentDisposition; return this; } @@ -705,9 +745,9 @@ public String contentLanguage() { * Set the contentLanguage value. * * @param contentLanguage the contentLanguage value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withContentLanguage(String contentLanguage) { + public BlobGetPropertiesHeaders withContentLanguage(String contentLanguage) { this.contentLanguage = contentLanguage; return this; } @@ -725,9 +765,9 @@ public String cacheControl() { * Set the cacheControl value. * * @param cacheControl the cacheControl value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withCacheControl(String cacheControl) { + public BlobGetPropertiesHeaders withCacheControl(String cacheControl) { this.cacheControl = cacheControl; return this; } @@ -745,9 +785,9 @@ public Long blobSequenceNumber() { * Set the blobSequenceNumber value. * * @param blobSequenceNumber the blobSequenceNumber value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withBlobSequenceNumber(Long blobSequenceNumber) { + public BlobGetPropertiesHeaders withBlobSequenceNumber(Long blobSequenceNumber) { this.blobSequenceNumber = blobSequenceNumber; return this; } @@ -765,9 +805,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withRequestId(String requestId) { + public BlobGetPropertiesHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -785,9 +825,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withVersion(String version) { + public BlobGetPropertiesHeaders withVersion(String version) { this.version = version; return this; } @@ -808,9 +848,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withDate(OffsetDateTime date) { + public BlobGetPropertiesHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -832,9 +872,9 @@ public String acceptRanges() { * Set the acceptRanges value. * * @param acceptRanges the acceptRanges value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withAcceptRanges(String acceptRanges) { + public BlobGetPropertiesHeaders withAcceptRanges(String acceptRanges) { this.acceptRanges = acceptRanges; return this; } @@ -852,9 +892,9 @@ public Integer blobCommittedBlockCount() { * Set the blobCommittedBlockCount value. * * @param blobCommittedBlockCount the blobCommittedBlockCount value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withBlobCommittedBlockCount(Integer blobCommittedBlockCount) { + public BlobGetPropertiesHeaders withBlobCommittedBlockCount(Integer blobCommittedBlockCount) { this.blobCommittedBlockCount = blobCommittedBlockCount; return this; } @@ -872,9 +912,9 @@ public Boolean isServerEncrypted() { * Set the isServerEncrypted value. * * @param isServerEncrypted the isServerEncrypted value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + public BlobGetPropertiesHeaders withIsServerEncrypted(Boolean isServerEncrypted) { this.isServerEncrypted = isServerEncrypted; return this; } @@ -892,9 +932,9 @@ public String accessTier() { * Set the accessTier value. * * @param accessTier the accessTier value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withAccessTier(String accessTier) { + public BlobGetPropertiesHeaders withAccessTier(String accessTier) { this.accessTier = accessTier; return this; } @@ -912,9 +952,9 @@ public Boolean accessTierInferred() { * Set the accessTierInferred value. * * @param accessTierInferred the accessTierInferred value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withAccessTierInferred(Boolean accessTierInferred) { + public BlobGetPropertiesHeaders withAccessTierInferred(Boolean accessTierInferred) { this.accessTierInferred = accessTierInferred; return this; } @@ -932,10 +972,37 @@ public String archiveStatus() { * Set the archiveStatus value. * * @param archiveStatus the archiveStatus value to set. - * @return the BlobsGetPropertiesHeaders object itself. + * @return the BlobGetPropertiesHeaders object itself. */ - public BlobsGetPropertiesHeaders withArchiveStatus(String archiveStatus) { + public BlobGetPropertiesHeaders withArchiveStatus(String archiveStatus) { this.archiveStatus = archiveStatus; return this; } + + /** + * Get the accessTierChangeTime value. + * + * @return the accessTierChangeTime value. + */ + public OffsetDateTime accessTierChangeTime() { + if (this.accessTierChangeTime == null) { + return null; + } + return this.accessTierChangeTime.dateTime(); + } + + /** + * Set the accessTierChangeTime value. + * + * @param accessTierChangeTime the accessTierChangeTime value to set. + * @return the BlobGetPropertiesHeaders object itself. + */ + public BlobGetPropertiesHeaders withAccessTierChangeTime(OffsetDateTime accessTierChangeTime) { + if (accessTierChangeTime == null) { + this.accessTierChangeTime = null; + } else { + this.accessTierChangeTime = new DateTimeRfc1123(accessTierChangeTime); + } + return this; + } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsGetPropertiesResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsGetPropertiesResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesResponse.java index 17480bfa1..49a7631cd 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsGetPropertiesResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the getProperties operation. */ -public final class BlobsGetPropertiesResponse extends RestResponse { +public final class BlobGetPropertiesResponse extends RestResponse { /** - * Creates an instance of BlobsGetPropertiesResponse. + * Creates an instance of BlobGetPropertiesResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsGetPropertiesResponse(int statusCode, BlobsGetPropertiesHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobGetPropertiesResponse(HttpRequest request, int statusCode, BlobGetPropertiesHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsGetPropertiesHeaders headers() { + public BlobGetPropertiesHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobHierarchyList.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobHierarchyList.java deleted file mode 100644 index 2b9176d9b..000000000 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobHierarchyList.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -package com.microsoft.azure.storage.blob.models; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.util.ArrayList; -import java.util.List; - -/** - * The BlobHierarchyList model. - */ -@JacksonXmlRootElement(localName = "BlobHierarchyList") -public final class BlobHierarchyList { - /** - * The blobPrefix property. - */ - @JsonProperty("BlobPrefix") - private List blobPrefix = new ArrayList<>(); - - /** - * The blob property. - */ - @JsonProperty("Blob") - private List blob = new ArrayList<>(); - - /** - * Get the blobPrefix value. - * - * @return the blobPrefix value. - */ - public List blobPrefix() { - return this.blobPrefix; - } - - /** - * Set the blobPrefix value. - * - * @param blobPrefix the blobPrefix value to set. - * @return the BlobHierarchyList object itself. - */ - public BlobHierarchyList withBlobPrefix(List blobPrefix) { - this.blobPrefix = blobPrefix; - return this; - } - - /** - * Get the blob value. - * - * @return the blob value. - */ - public List blob() { - return this.blob; - } - - /** - * Set the blob value. - * - * @param blob the blob value to set. - * @return the BlobHierarchyList object itself. - */ - public BlobHierarchyList withBlob(List blob) { - this.blob = blob; - return this; - } -} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobHierarchyListSegment.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobHierarchyListSegment.java new file mode 100644 index 000000000..93f97c12c --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobHierarchyListSegment.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.ArrayList; +import java.util.List; + +/** + * The BlobHierarchyListSegment model. + */ +@JacksonXmlRootElement(localName = "Blobs") +public final class BlobHierarchyListSegment { + /** + * The blobPrefixes property. + */ + @JsonProperty("BlobPrefix") + private List blobPrefixes = new ArrayList<>(); + + /** + * The blobItems property. + */ + @JsonProperty("Blob") + private List blobItems = new ArrayList<>(); + + /** + * Get the blobPrefixes value. + * + * @return the blobPrefixes value. + */ + public List blobPrefixes() { + return this.blobPrefixes; + } + + /** + * Set the blobPrefixes value. + * + * @param blobPrefixes the blobPrefixes value to set. + * @return the BlobHierarchyListSegment object itself. + */ + public BlobHierarchyListSegment withBlobPrefixes(List blobPrefixes) { + this.blobPrefixes = blobPrefixes; + return this; + } + + /** + * Get the blobItems value. + * + * @return the blobItems value. + */ + public List blobItems() { + return this.blobItems; + } + + /** + * Set the blobItems value. + * + * @param blobItems the blobItems value to set. + * @return the BlobHierarchyListSegment object itself. + */ + public BlobHierarchyListSegment withBlobItems(List blobItems) { + this.blobItems = blobItems; + return this; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/Blob.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobItem.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/Blob.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobItem.java index 3e6d7eca7..f244ca4ea 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/Blob.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobItem.java @@ -19,7 +19,7 @@ * An Azure Storage blob. */ @JacksonXmlRootElement(localName = "Blob") -public final class Blob { +public final class BlobItem { /** * The name property. */ @@ -63,9 +63,9 @@ public String name() { * Set the name value. * * @param name the name value to set. - * @return the Blob object itself. + * @return the BlobItem object itself. */ - public Blob withName(String name) { + public BlobItem withName(String name) { this.name = name; return this; } @@ -83,9 +83,9 @@ public boolean deleted() { * Set the deleted value. * * @param deleted the deleted value to set. - * @return the Blob object itself. + * @return the BlobItem object itself. */ - public Blob withDeleted(boolean deleted) { + public BlobItem withDeleted(boolean deleted) { this.deleted = deleted; return this; } @@ -103,9 +103,9 @@ public String snapshot() { * Set the snapshot value. * * @param snapshot the snapshot value to set. - * @return the Blob object itself. + * @return the BlobItem object itself. */ - public Blob withSnapshot(String snapshot) { + public BlobItem withSnapshot(String snapshot) { this.snapshot = snapshot; return this; } @@ -123,9 +123,9 @@ public BlobProperties properties() { * Set the properties value. * * @param properties the properties value to set. - * @return the Blob object itself. + * @return the BlobItem object itself. */ - public Blob withProperties(BlobProperties properties) { + public BlobItem withProperties(BlobProperties properties) { this.properties = properties; return this; } @@ -143,9 +143,9 @@ public Map metadata() { * Set the metadata value. * * @param metadata the metadata value to set. - * @return the Blob object itself. + * @return the BlobItem object itself. */ - public Blob withMetadata(Map metadata) { + public BlobItem withMetadata(Map metadata) { this.metadata = metadata; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobProperties.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobProperties.java index 9f5b38c44..46d179a44 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobProperties.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobProperties.java @@ -19,8 +19,14 @@ /** * Properties of a blob. */ -@JacksonXmlRootElement(localName = "BlobProperties") +@JacksonXmlRootElement(localName = "Properties") public final class BlobProperties { + /** + * The creationTime property. + */ + @JsonProperty(value = "Creation-Time") + private DateTimeRfc1123 creationTime; + /** * The lastModified property. */ @@ -192,6 +198,39 @@ public final class BlobProperties { @JsonProperty(value = "ArchiveStatus") private ArchiveStatus archiveStatus; + /** + * The accessTierChangeTime property. + */ + @JsonProperty(value = "AccessTierChangeTime") + private DateTimeRfc1123 accessTierChangeTime; + + /** + * Get the creationTime value. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + if (this.creationTime == null) { + return null; + } + return this.creationTime.dateTime(); + } + + /** + * Set the creationTime value. + * + * @param creationTime the creationTime value to set. + * @return the BlobProperties object itself. + */ + public BlobProperties withCreationTime(OffsetDateTime creationTime) { + if (creationTime == null) { + this.creationTime = null; + } else { + this.creationTime = new DateTimeRfc1123(creationTime); + } + return this; + } + /** * Get the lastModified value. * @@ -772,4 +811,31 @@ public BlobProperties withArchiveStatus(ArchiveStatus archiveStatus) { this.archiveStatus = archiveStatus; return this; } + + /** + * Get the accessTierChangeTime value. + * + * @return the accessTierChangeTime value. + */ + public OffsetDateTime accessTierChangeTime() { + if (this.accessTierChangeTime == null) { + return null; + } + return this.accessTierChangeTime.dateTime(); + } + + /** + * Set the accessTierChangeTime value. + * + * @param accessTierChangeTime the accessTierChangeTime value to set. + * @return the BlobProperties object itself. + */ + public BlobProperties withAccessTierChangeTime(OffsetDateTime accessTierChangeTime) { + if (accessTierChangeTime == null) { + this.accessTierChangeTime = null; + } else { + this.accessTierChangeTime = new DateTimeRfc1123(accessTierChangeTime); + } + return this; + } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsReleaseLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobReleaseLeaseHeaders.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsReleaseLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobReleaseLeaseHeaders.java index 0f2a74bd0..4635bc05e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsReleaseLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobReleaseLeaseHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for ReleaseLease operation. */ -@JacksonXmlRootElement(localName = "Blobs-ReleaseLease-Headers") -public final class BlobsReleaseLeaseHeaders { +@JacksonXmlRootElement(localName = "Blob-ReleaseLease-Headers") +public final class BlobReleaseLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -72,9 +72,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsReleaseLeaseHeaders object itself. + * @return the BlobReleaseLeaseHeaders object itself. */ - public BlobsReleaseLeaseHeaders withETag(String eTag) { + public BlobReleaseLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -95,9 +95,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsReleaseLeaseHeaders object itself. + * @return the BlobReleaseLeaseHeaders object itself. */ - public BlobsReleaseLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public BlobReleaseLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -119,9 +119,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsReleaseLeaseHeaders object itself. + * @return the BlobReleaseLeaseHeaders object itself. */ - public BlobsReleaseLeaseHeaders withRequestId(String requestId) { + public BlobReleaseLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -139,9 +139,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsReleaseLeaseHeaders object itself. + * @return the BlobReleaseLeaseHeaders object itself. */ - public BlobsReleaseLeaseHeaders withVersion(String version) { + public BlobReleaseLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -162,9 +162,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsReleaseLeaseHeaders object itself. + * @return the BlobReleaseLeaseHeaders object itself. */ - public BlobsReleaseLeaseHeaders withDate(OffsetDateTime date) { + public BlobReleaseLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsReleaseLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobReleaseLeaseResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsReleaseLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobReleaseLeaseResponse.java index d81cf224f..aeae2c5e6 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsReleaseLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobReleaseLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the releaseLease operation. */ -public final class BlobsReleaseLeaseResponse extends RestResponse { +public final class BlobReleaseLeaseResponse extends RestResponse { /** - * Creates an instance of BlobsReleaseLeaseResponse. + * Creates an instance of BlobReleaseLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsReleaseLeaseResponse(int statusCode, BlobsReleaseLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobReleaseLeaseResponse(HttpRequest request, int statusCode, BlobReleaseLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsReleaseLeaseHeaders headers() { + public BlobReleaseLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsRenewLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobRenewLeaseHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsRenewLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobRenewLeaseHeaders.java index 8d96c9157..c531d64a5 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsRenewLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobRenewLeaseHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for RenewLease operation. */ -@JacksonXmlRootElement(localName = "Blobs-RenewLease-Headers") -public final class BlobsRenewLeaseHeaders { +@JacksonXmlRootElement(localName = "Blob-RenewLease-Headers") +public final class BlobRenewLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -78,9 +78,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsRenewLeaseHeaders object itself. + * @return the BlobRenewLeaseHeaders object itself. */ - public BlobsRenewLeaseHeaders withETag(String eTag) { + public BlobRenewLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -101,9 +101,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsRenewLeaseHeaders object itself. + * @return the BlobRenewLeaseHeaders object itself. */ - public BlobsRenewLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public BlobRenewLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -125,9 +125,9 @@ public String leaseId() { * Set the leaseId value. * * @param leaseId the leaseId value to set. - * @return the BlobsRenewLeaseHeaders object itself. + * @return the BlobRenewLeaseHeaders object itself. */ - public BlobsRenewLeaseHeaders withLeaseId(String leaseId) { + public BlobRenewLeaseHeaders withLeaseId(String leaseId) { this.leaseId = leaseId; return this; } @@ -145,9 +145,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsRenewLeaseHeaders object itself. + * @return the BlobRenewLeaseHeaders object itself. */ - public BlobsRenewLeaseHeaders withRequestId(String requestId) { + public BlobRenewLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsRenewLeaseHeaders object itself. + * @return the BlobRenewLeaseHeaders object itself. */ - public BlobsRenewLeaseHeaders withVersion(String version) { + public BlobRenewLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsRenewLeaseHeaders object itself. + * @return the BlobRenewLeaseHeaders object itself. */ - public BlobsRenewLeaseHeaders withDate(OffsetDateTime date) { + public BlobRenewLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsRenewLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobRenewLeaseResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsRenewLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobRenewLeaseResponse.java index a72a270b3..2bd6354d6 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsRenewLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobRenewLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the renewLease operation. */ -public final class BlobsRenewLeaseResponse extends RestResponse { +public final class BlobRenewLeaseResponse extends RestResponse { /** - * Creates an instance of BlobsRenewLeaseResponse. + * Creates an instance of BlobRenewLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsRenewLeaseResponse(int statusCode, BlobsRenewLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobRenewLeaseResponse(HttpRequest request, int statusCode, BlobRenewLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsRenewLeaseHeaders headers() { + public BlobRenewLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetHTTPHeadersHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetHTTPHeadersHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetHTTPHeadersHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobSetHTTPHeadersHeaders.java index 30e674dd9..745f62a7f 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetHTTPHeadersHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetHTTPHeadersHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for SetHTTPHeaders operation. */ -@JacksonXmlRootElement(localName = "Blobs-SetHTTPHeaders-Headers") -public final class BlobsSetHTTPHeadersHeaders { +@JacksonXmlRootElement(localName = "Blob-SetHTTPHeaders-Headers") +public final class BlobSetHTTPHeadersHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -79,9 +79,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsSetHTTPHeadersHeaders object itself. + * @return the BlobSetHTTPHeadersHeaders object itself. */ - public BlobsSetHTTPHeadersHeaders withETag(String eTag) { + public BlobSetHTTPHeadersHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -102,9 +102,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsSetHTTPHeadersHeaders object itself. + * @return the BlobSetHTTPHeadersHeaders object itself. */ - public BlobsSetHTTPHeadersHeaders withLastModified(OffsetDateTime lastModified) { + public BlobSetHTTPHeadersHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -126,9 +126,9 @@ public Long blobSequenceNumber() { * Set the blobSequenceNumber value. * * @param blobSequenceNumber the blobSequenceNumber value to set. - * @return the BlobsSetHTTPHeadersHeaders object itself. + * @return the BlobSetHTTPHeadersHeaders object itself. */ - public BlobsSetHTTPHeadersHeaders withBlobSequenceNumber(Long blobSequenceNumber) { + public BlobSetHTTPHeadersHeaders withBlobSequenceNumber(Long blobSequenceNumber) { this.blobSequenceNumber = blobSequenceNumber; return this; } @@ -146,9 +146,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsSetHTTPHeadersHeaders object itself. + * @return the BlobSetHTTPHeadersHeaders object itself. */ - public BlobsSetHTTPHeadersHeaders withRequestId(String requestId) { + public BlobSetHTTPHeadersHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -166,9 +166,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsSetHTTPHeadersHeaders object itself. + * @return the BlobSetHTTPHeadersHeaders object itself. */ - public BlobsSetHTTPHeadersHeaders withVersion(String version) { + public BlobSetHTTPHeadersHeaders withVersion(String version) { this.version = version; return this; } @@ -189,9 +189,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsSetHTTPHeadersHeaders object itself. + * @return the BlobSetHTTPHeadersHeaders object itself. */ - public BlobsSetHTTPHeadersHeaders withDate(OffsetDateTime date) { + public BlobSetHTTPHeadersHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetHTTPHeadersResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetHTTPHeadersResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetHTTPHeadersResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobSetHTTPHeadersResponse.java index 609671830..8c92290fd 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetHTTPHeadersResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetHTTPHeadersResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the setHTTPHeaders operation. */ -public final class BlobsSetHTTPHeadersResponse extends RestResponse { +public final class BlobSetHTTPHeadersResponse extends RestResponse { /** - * Creates an instance of BlobsSetHTTPHeadersResponse. + * Creates an instance of BlobSetHTTPHeadersResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsSetHTTPHeadersResponse(int statusCode, BlobsSetHTTPHeadersHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobSetHTTPHeadersResponse(HttpRequest request, int statusCode, BlobSetHTTPHeadersHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsSetHTTPHeadersHeaders headers() { + public BlobSetHTTPHeadersHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetMetadataHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetMetadataHeaders.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetMetadataHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobSetMetadataHeaders.java index 58ddffda2..eced8a038 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetMetadataHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetMetadataHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for SetMetadata operation. */ -@JacksonXmlRootElement(localName = "Blobs-SetMetadata-Headers") -public final class BlobsSetMetadataHeaders { +@JacksonXmlRootElement(localName = "Blob-SetMetadata-Headers") +public final class BlobSetMetadataHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -80,9 +80,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsSetMetadataHeaders object itself. + * @return the BlobSetMetadataHeaders object itself. */ - public BlobsSetMetadataHeaders withETag(String eTag) { + public BlobSetMetadataHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -103,9 +103,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsSetMetadataHeaders object itself. + * @return the BlobSetMetadataHeaders object itself. */ - public BlobsSetMetadataHeaders withLastModified(OffsetDateTime lastModified) { + public BlobSetMetadataHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -127,9 +127,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsSetMetadataHeaders object itself. + * @return the BlobSetMetadataHeaders object itself. */ - public BlobsSetMetadataHeaders withRequestId(String requestId) { + public BlobSetMetadataHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -147,9 +147,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsSetMetadataHeaders object itself. + * @return the BlobSetMetadataHeaders object itself. */ - public BlobsSetMetadataHeaders withVersion(String version) { + public BlobSetMetadataHeaders withVersion(String version) { this.version = version; return this; } @@ -170,9 +170,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsSetMetadataHeaders object itself. + * @return the BlobSetMetadataHeaders object itself. */ - public BlobsSetMetadataHeaders withDate(OffsetDateTime date) { + public BlobSetMetadataHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -194,9 +194,9 @@ public Boolean isServerEncrypted() { * Set the isServerEncrypted value. * * @param isServerEncrypted the isServerEncrypted value to set. - * @return the BlobsSetMetadataHeaders object itself. + * @return the BlobSetMetadataHeaders object itself. */ - public BlobsSetMetadataHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + public BlobSetMetadataHeaders withIsServerEncrypted(Boolean isServerEncrypted) { this.isServerEncrypted = isServerEncrypted; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetMetadataResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetMetadataResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetMetadataResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobSetMetadataResponse.java index e8d851e23..c9a9a392c 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetMetadataResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetMetadataResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the setMetadata operation. */ -public final class BlobsSetMetadataResponse extends RestResponse { +public final class BlobSetMetadataResponse extends RestResponse { /** - * Creates an instance of BlobsSetMetadataResponse. + * Creates an instance of BlobSetMetadataResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsSetMetadataResponse(int statusCode, BlobsSetMetadataHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobSetMetadataResponse(HttpRequest request, int statusCode, BlobSetMetadataHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsSetMetadataHeaders headers() { + public BlobSetMetadataHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetTierHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetTierHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetTierHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobSetTierHeaders.java index 3a9081fca..e26f3f8e5 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetTierHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetTierHeaders.java @@ -17,8 +17,8 @@ /** * Defines headers for SetTier operation. */ -@JacksonXmlRootElement(localName = "Blobs-SetTier-Headers") -public final class BlobsSetTierHeaders { +@JacksonXmlRootElement(localName = "Blob-SetTier-Headers") +public final class BlobSetTierHeaders { /** * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -47,9 +47,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsSetTierHeaders object itself. + * @return the BlobSetTierHeaders object itself. */ - public BlobsSetTierHeaders withRequestId(String requestId) { + public BlobSetTierHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -67,9 +67,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsSetTierHeaders object itself. + * @return the BlobSetTierHeaders object itself. */ - public BlobsSetTierHeaders withVersion(String version) { + public BlobSetTierHeaders withVersion(String version) { this.version = version; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetTierResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetTierResponse.java similarity index 64% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetTierResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobSetTierResponse.java index c11180ee6..12e85f0ea 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsSetTierResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobSetTierResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the setTier operation. */ -public final class BlobsSetTierResponse extends RestResponse { +public final class BlobSetTierResponse extends RestResponse { /** - * Creates an instance of BlobsSetTierResponse. + * Creates an instance of BlobSetTierResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsSetTierResponse(int statusCode, BlobsSetTierHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobSetTierResponse(HttpRequest request, int statusCode, BlobSetTierHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsSetTierHeaders headers() { + public BlobSetTierHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsStartCopyFromURLHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobStartCopyFromURLHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsStartCopyFromURLHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobStartCopyFromURLHeaders.java index e431589fa..ceddf0bdd 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsStartCopyFromURLHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobStartCopyFromURLHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for StartCopyFromURL operation. */ -@JacksonXmlRootElement(localName = "Blobs-StartCopyFromURL-Headers") -public final class BlobsStartCopyFromURLHeaders { +@JacksonXmlRootElement(localName = "Blob-StartCopyFromURL-Headers") +public final class BlobStartCopyFromURLHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -87,9 +87,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlobsStartCopyFromURLHeaders object itself. + * @return the BlobStartCopyFromURLHeaders object itself. */ - public BlobsStartCopyFromURLHeaders withETag(String eTag) { + public BlobStartCopyFromURLHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -110,9 +110,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlobsStartCopyFromURLHeaders object itself. + * @return the BlobStartCopyFromURLHeaders object itself. */ - public BlobsStartCopyFromURLHeaders withLastModified(OffsetDateTime lastModified) { + public BlobStartCopyFromURLHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -134,9 +134,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsStartCopyFromURLHeaders object itself. + * @return the BlobStartCopyFromURLHeaders object itself. */ - public BlobsStartCopyFromURLHeaders withRequestId(String requestId) { + public BlobStartCopyFromURLHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -154,9 +154,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsStartCopyFromURLHeaders object itself. + * @return the BlobStartCopyFromURLHeaders object itself. */ - public BlobsStartCopyFromURLHeaders withVersion(String version) { + public BlobStartCopyFromURLHeaders withVersion(String version) { this.version = version; return this; } @@ -177,9 +177,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsStartCopyFromURLHeaders object itself. + * @return the BlobStartCopyFromURLHeaders object itself. */ - public BlobsStartCopyFromURLHeaders withDate(OffsetDateTime date) { + public BlobStartCopyFromURLHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -201,9 +201,9 @@ public String copyId() { * Set the copyId value. * * @param copyId the copyId value to set. - * @return the BlobsStartCopyFromURLHeaders object itself. + * @return the BlobStartCopyFromURLHeaders object itself. */ - public BlobsStartCopyFromURLHeaders withCopyId(String copyId) { + public BlobStartCopyFromURLHeaders withCopyId(String copyId) { this.copyId = copyId; return this; } @@ -221,9 +221,9 @@ public CopyStatusType copyStatus() { * Set the copyStatus value. * * @param copyStatus the copyStatus value to set. - * @return the BlobsStartCopyFromURLHeaders object itself. + * @return the BlobStartCopyFromURLHeaders object itself. */ - public BlobsStartCopyFromURLHeaders withCopyStatus(CopyStatusType copyStatus) { + public BlobStartCopyFromURLHeaders withCopyStatus(CopyStatusType copyStatus) { this.copyStatus = copyStatus; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsStartCopyFromURLResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobStartCopyFromURLResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsStartCopyFromURLResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobStartCopyFromURLResponse.java index 2237afb00..20b30fcd4 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsStartCopyFromURLResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobStartCopyFromURLResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the startCopyFromURL operation. */ -public final class BlobsStartCopyFromURLResponse extends RestResponse { +public final class BlobStartCopyFromURLResponse extends RestResponse { /** - * Creates an instance of BlobsStartCopyFromURLResponse. + * Creates an instance of BlobStartCopyFromURLResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsStartCopyFromURLResponse(int statusCode, BlobsStartCopyFromURLHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobStartCopyFromURLResponse(HttpRequest request, int statusCode, BlobStartCopyFromURLHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsStartCopyFromURLHeaders headers() { + public BlobStartCopyFromURLHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsUndeleteHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobUndeleteHeaders.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsUndeleteHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobUndeleteHeaders.java index c0547e854..de0c5c807 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsUndeleteHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobUndeleteHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for Undelete operation. */ -@JacksonXmlRootElement(localName = "Blobs-Undelete-Headers") -public final class BlobsUndeleteHeaders { +@JacksonXmlRootElement(localName = "Blob-Undelete-Headers") +public final class BlobUndeleteHeaders { /** * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -56,9 +56,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlobsUndeleteHeaders object itself. + * @return the BlobUndeleteHeaders object itself. */ - public BlobsUndeleteHeaders withRequestId(String requestId) { + public BlobUndeleteHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -76,9 +76,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlobsUndeleteHeaders object itself. + * @return the BlobUndeleteHeaders object itself. */ - public BlobsUndeleteHeaders withVersion(String version) { + public BlobUndeleteHeaders withVersion(String version) { this.version = version; return this; } @@ -99,9 +99,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlobsUndeleteHeaders object itself. + * @return the BlobUndeleteHeaders object itself. */ - public BlobsUndeleteHeaders withDate(OffsetDateTime date) { + public BlobUndeleteHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsUndeleteResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobUndeleteResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlobsUndeleteResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlobUndeleteResponse.java index 7d250bbc8..7222085ca 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobsUndeleteResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobUndeleteResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the undelete operation. */ -public final class BlobsUndeleteResponse extends RestResponse { +public final class BlobUndeleteResponse extends RestResponse { /** - * Creates an instance of BlobsUndeleteResponse. + * Creates an instance of BlobUndeleteResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlobsUndeleteResponse(int statusCode, BlobsUndeleteHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlobUndeleteResponse(HttpRequest request, int statusCode, BlobUndeleteHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlobsUndeleteHeaders headers() { + public BlobUndeleteHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsCommitBlockListHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobCommitBlockListHeaders.java similarity index 81% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsCommitBlockListHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobCommitBlockListHeaders.java index 07e37b941..c94db9b41 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsCommitBlockListHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobCommitBlockListHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for CommitBlockList operation. */ -@JacksonXmlRootElement(localName = "BlockBlobs-CommitBlockList-Headers") -public final class BlockBlobsCommitBlockListHeaders { +@JacksonXmlRootElement(localName = "BlockBlob-CommitBlockList-Headers") +public final class BlockBlobCommitBlockListHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -88,9 +88,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlockBlobsCommitBlockListHeaders object itself. + * @return the BlockBlobCommitBlockListHeaders object itself. */ - public BlockBlobsCommitBlockListHeaders withETag(String eTag) { + public BlockBlobCommitBlockListHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -111,9 +111,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlockBlobsCommitBlockListHeaders object itself. + * @return the BlockBlobCommitBlockListHeaders object itself. */ - public BlockBlobsCommitBlockListHeaders withLastModified(OffsetDateTime lastModified) { + public BlockBlobCommitBlockListHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -135,9 +135,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the BlockBlobsCommitBlockListHeaders object itself. + * @return the BlockBlobCommitBlockListHeaders object itself. */ - public BlockBlobsCommitBlockListHeaders withContentMD5(byte[] contentMD5) { + public BlockBlobCommitBlockListHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -155,9 +155,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlockBlobsCommitBlockListHeaders object itself. + * @return the BlockBlobCommitBlockListHeaders object itself. */ - public BlockBlobsCommitBlockListHeaders withRequestId(String requestId) { + public BlockBlobCommitBlockListHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -175,9 +175,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlockBlobsCommitBlockListHeaders object itself. + * @return the BlockBlobCommitBlockListHeaders object itself. */ - public BlockBlobsCommitBlockListHeaders withVersion(String version) { + public BlockBlobCommitBlockListHeaders withVersion(String version) { this.version = version; return this; } @@ -198,9 +198,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlockBlobsCommitBlockListHeaders object itself. + * @return the BlockBlobCommitBlockListHeaders object itself. */ - public BlockBlobsCommitBlockListHeaders withDate(OffsetDateTime date) { + public BlockBlobCommitBlockListHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -222,9 +222,9 @@ public Boolean isServerEncrypted() { * Set the isServerEncrypted value. * * @param isServerEncrypted the isServerEncrypted value to set. - * @return the BlockBlobsCommitBlockListHeaders object itself. + * @return the BlockBlobCommitBlockListHeaders object itself. */ - public BlockBlobsCommitBlockListHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + public BlockBlobCommitBlockListHeaders withIsServerEncrypted(Boolean isServerEncrypted) { this.isServerEncrypted = isServerEncrypted; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsCommitBlockListResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobCommitBlockListResponse.java similarity index 61% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsCommitBlockListResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobCommitBlockListResponse.java index 1dfb5dee6..3901f36b9 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsCommitBlockListResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobCommitBlockListResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the commitBlockList operation. */ -public final class BlockBlobsCommitBlockListResponse extends RestResponse { +public final class BlockBlobCommitBlockListResponse extends RestResponse { /** - * Creates an instance of BlockBlobsCommitBlockListResponse. + * Creates an instance of BlockBlobCommitBlockListResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlockBlobsCommitBlockListResponse(int statusCode, BlockBlobsCommitBlockListHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlockBlobCommitBlockListResponse(HttpRequest request, int statusCode, BlockBlobCommitBlockListHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlockBlobsCommitBlockListHeaders headers() { + public BlockBlobCommitBlockListHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsGetBlockListHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobGetBlockListHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsGetBlockListHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobGetBlockListHeaders.java index da5f1bff9..44eeda65e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsGetBlockListHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobGetBlockListHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for GetBlockList operation. */ -@JacksonXmlRootElement(localName = "BlockBlobs-GetBlockList-Headers") -public final class BlockBlobsGetBlockListHeaders { +@JacksonXmlRootElement(localName = "BlockBlob-GetBlockList-Headers") +public final class BlockBlobGetBlockListHeaders { /** * Returns the date and time the container was last modified. Any operation * that modifies the blob, including an update of the blob's metadata or @@ -88,9 +88,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the BlockBlobsGetBlockListHeaders object itself. + * @return the BlockBlobGetBlockListHeaders object itself. */ - public BlockBlobsGetBlockListHeaders withLastModified(OffsetDateTime lastModified) { + public BlockBlobGetBlockListHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -112,9 +112,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the BlockBlobsGetBlockListHeaders object itself. + * @return the BlockBlobGetBlockListHeaders object itself. */ - public BlockBlobsGetBlockListHeaders withETag(String eTag) { + public BlockBlobGetBlockListHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -132,9 +132,9 @@ public String contentType() { * Set the contentType value. * * @param contentType the contentType value to set. - * @return the BlockBlobsGetBlockListHeaders object itself. + * @return the BlockBlobGetBlockListHeaders object itself. */ - public BlockBlobsGetBlockListHeaders withContentType(String contentType) { + public BlockBlobGetBlockListHeaders withContentType(String contentType) { this.contentType = contentType; return this; } @@ -152,9 +152,9 @@ public Long blobContentLength() { * Set the blobContentLength value. * * @param blobContentLength the blobContentLength value to set. - * @return the BlockBlobsGetBlockListHeaders object itself. + * @return the BlockBlobGetBlockListHeaders object itself. */ - public BlockBlobsGetBlockListHeaders withBlobContentLength(Long blobContentLength) { + public BlockBlobGetBlockListHeaders withBlobContentLength(Long blobContentLength) { this.blobContentLength = blobContentLength; return this; } @@ -172,9 +172,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlockBlobsGetBlockListHeaders object itself. + * @return the BlockBlobGetBlockListHeaders object itself. */ - public BlockBlobsGetBlockListHeaders withRequestId(String requestId) { + public BlockBlobGetBlockListHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -192,9 +192,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlockBlobsGetBlockListHeaders object itself. + * @return the BlockBlobGetBlockListHeaders object itself. */ - public BlockBlobsGetBlockListHeaders withVersion(String version) { + public BlockBlobGetBlockListHeaders withVersion(String version) { this.version = version; return this; } @@ -215,9 +215,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlockBlobsGetBlockListHeaders object itself. + * @return the BlockBlobGetBlockListHeaders object itself. */ - public BlockBlobsGetBlockListHeaders withDate(OffsetDateTime date) { + public BlockBlobGetBlockListHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsGetBlockListResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobGetBlockListResponse.java similarity index 64% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsGetBlockListResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobGetBlockListResponse.java index 0b10471d8..d8a0d26b3 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsGetBlockListResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobGetBlockListResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the getBlockList operation. */ -public final class BlockBlobsGetBlockListResponse extends RestResponse { +public final class BlockBlobGetBlockListResponse extends RestResponse { /** - * Creates an instance of BlockBlobsGetBlockListResponse. + * Creates an instance of BlockBlobGetBlockListResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlockBlobsGetBlockListResponse(int statusCode, BlockBlobsGetBlockListHeaders headers, Map rawHeaders, BlockList body) { - super(statusCode, headers, rawHeaders, body); + public BlockBlobGetBlockListResponse(HttpRequest request, int statusCode, BlockBlobGetBlockListHeaders headers, Map rawHeaders, BlockList body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlockBlobsGetBlockListHeaders headers() { + public BlockBlobGetBlockListHeaders headers() { return super.headers(); } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockFromURLHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockFromURLHeaders.java new file mode 100644 index 000000000..e6bdfd3c4 --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockFromURLHeaders.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.microsoft.rest.v2.DateTimeRfc1123; +import java.time.OffsetDateTime; + +/** + * Defines headers for StageBlockFromURL operation. + */ +@JacksonXmlRootElement(localName = "BlockBlob-StageBlockFromURL-Headers") +public final class BlockBlobStageBlockFromURLHeaders { + /** + * If the blob has an MD5 hash and this operation is to read the full blob, + * this response header is returned so that the client can check for + * message content integrity. + */ + @JsonProperty(value = "Content-MD5") + private byte[] contentMD5; + + /** + * This header uniquely identifies the request that was made and can be + * used for troubleshooting the request. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /** + * Indicates the version of the Blob service used to execute the request. + * This header is returned for requests made against version 2009-09-19 and + * above. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /** + * UTC date/time value generated by the service that indicates the time at + * which the response was initiated. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 date; + + /** + * The value of this header is set to true if the contents of the request + * are successfully encrypted using the specified algorithm, and false + * otherwise. + */ + @JsonProperty(value = "x-ms-request-server-encrypted") + private Boolean isServerEncrypted; + + /** + * Get the contentMD5 value. + * + * @return the contentMD5 value. + */ + public byte[] contentMD5() { + return this.contentMD5; + } + + /** + * Set the contentMD5 value. + * + * @param contentMD5 the contentMD5 value to set. + * @return the BlockBlobStageBlockFromURLHeaders object itself. + */ + public BlockBlobStageBlockFromURLHeaders withContentMD5(byte[] contentMD5) { + this.contentMD5 = contentMD5; + return this; + } + + /** + * Get the requestId value. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId value. + * + * @param requestId the requestId value to set. + * @return the BlockBlobStageBlockFromURLHeaders object itself. + */ + public BlockBlobStageBlockFromURLHeaders withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version value. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version value. + * + * @param version the version value to set. + * @return the BlockBlobStageBlockFromURLHeaders object itself. + */ + public BlockBlobStageBlockFromURLHeaders withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the date value. + * + * @return the date value. + */ + public OffsetDateTime date() { + if (this.date == null) { + return null; + } + return this.date.dateTime(); + } + + /** + * Set the date value. + * + * @param date the date value to set. + * @return the BlockBlobStageBlockFromURLHeaders object itself. + */ + public BlockBlobStageBlockFromURLHeaders withDate(OffsetDateTime date) { + if (date == null) { + this.date = null; + } else { + this.date = new DateTimeRfc1123(date); + } + return this; + } + + /** + * Get the isServerEncrypted value. + * + * @return the isServerEncrypted value. + */ + public Boolean isServerEncrypted() { + return this.isServerEncrypted; + } + + /** + * Set the isServerEncrypted value. + * + * @param isServerEncrypted the isServerEncrypted value to set. + * @return the BlockBlobStageBlockFromURLHeaders object itself. + */ + public BlockBlobStageBlockFromURLHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + this.isServerEncrypted = isServerEncrypted; + return this; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockFromURLResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockFromURLResponse.java new file mode 100644 index 000000000..eec168743 --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockFromURLResponse.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; +import java.util.Map; + +/** + * Contains all response data for the stageBlockFromURL operation. + */ +public final class BlockBlobStageBlockFromURLResponse extends RestResponse { + /** + * Creates an instance of BlockBlobStageBlockFromURLResponse. + * + * @param request the request which resulted in this {response.Name}. + * @param statusCode the status code of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param body the deserialized body of the HTTP response. + */ + public BlockBlobStageBlockFromURLResponse(HttpRequest request, int statusCode, BlockBlobStageBlockFromURLHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); + } + + /** + * @return the deserialized response headers. + */ + @Override + public BlockBlobStageBlockFromURLHeaders headers() { + return super.headers(); + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsStageBlockHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsStageBlockHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockHeaders.java index edc4c6cf1..548ff8658 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsStageBlockHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for StageBlock operation. */ -@JacksonXmlRootElement(localName = "BlockBlobs-StageBlock-Headers") -public final class BlockBlobsStageBlockHeaders { +@JacksonXmlRootElement(localName = "BlockBlob-StageBlock-Headers") +public final class BlockBlobStageBlockHeaders { /** * If the blob has an MD5 hash and this operation is to read the full blob, * this response header is returned so that the client can check for @@ -72,9 +72,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the BlockBlobsStageBlockHeaders object itself. + * @return the BlockBlobStageBlockHeaders object itself. */ - public BlockBlobsStageBlockHeaders withContentMD5(byte[] contentMD5) { + public BlockBlobStageBlockHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -92,9 +92,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the BlockBlobsStageBlockHeaders object itself. + * @return the BlockBlobStageBlockHeaders object itself. */ - public BlockBlobsStageBlockHeaders withRequestId(String requestId) { + public BlockBlobStageBlockHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -112,9 +112,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the BlockBlobsStageBlockHeaders object itself. + * @return the BlockBlobStageBlockHeaders object itself. */ - public BlockBlobsStageBlockHeaders withVersion(String version) { + public BlockBlobStageBlockHeaders withVersion(String version) { this.version = version; return this; } @@ -135,9 +135,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the BlockBlobsStageBlockHeaders object itself. + * @return the BlockBlobStageBlockHeaders object itself. */ - public BlockBlobsStageBlockHeaders withDate(OffsetDateTime date) { + public BlockBlobStageBlockHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -159,9 +159,9 @@ public Boolean isServerEncrypted() { * Set the isServerEncrypted value. * * @param isServerEncrypted the isServerEncrypted value to set. - * @return the BlockBlobsStageBlockHeaders object itself. + * @return the BlockBlobStageBlockHeaders object itself. */ - public BlockBlobsStageBlockHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + public BlockBlobStageBlockHeaders withIsServerEncrypted(Boolean isServerEncrypted) { this.isServerEncrypted = isServerEncrypted; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsStageBlockResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsStageBlockResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockResponse.java index 79e159683..64ffddbc0 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsStageBlockResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobStageBlockResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the stageBlock operation. */ -public final class BlockBlobsStageBlockResponse extends RestResponse { +public final class BlockBlobStageBlockResponse extends RestResponse { /** - * Creates an instance of BlockBlobsStageBlockResponse. + * Creates an instance of BlockBlobStageBlockResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlockBlobsStageBlockResponse(int statusCode, BlockBlobsStageBlockHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlockBlobStageBlockResponse(HttpRequest request, int statusCode, BlockBlobStageBlockHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlockBlobsStageBlockHeaders headers() { + public BlockBlobStageBlockHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCreateHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobUploadHeaders.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCreateHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobUploadHeaders.java index f13e99f6e..8fd34f419 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCreateHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobUploadHeaders.java @@ -17,10 +17,10 @@ import java.time.OffsetDateTime; /** - * Defines headers for Create operation. + * Defines headers for Upload operation. */ -@JacksonXmlRootElement(localName = "PageBlobs-Create-Headers") -public final class PageBlobsCreateHeaders { +@JacksonXmlRootElement(localName = "BlockBlob-Upload-Headers") +public final class BlockBlobUploadHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -88,9 +88,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the PageBlobsCreateHeaders object itself. + * @return the BlockBlobUploadHeaders object itself. */ - public PageBlobsCreateHeaders withETag(String eTag) { + public BlockBlobUploadHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -111,9 +111,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the PageBlobsCreateHeaders object itself. + * @return the BlockBlobUploadHeaders object itself. */ - public PageBlobsCreateHeaders withLastModified(OffsetDateTime lastModified) { + public BlockBlobUploadHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -135,9 +135,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the PageBlobsCreateHeaders object itself. + * @return the BlockBlobUploadHeaders object itself. */ - public PageBlobsCreateHeaders withContentMD5(byte[] contentMD5) { + public BlockBlobUploadHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -155,9 +155,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the PageBlobsCreateHeaders object itself. + * @return the BlockBlobUploadHeaders object itself. */ - public PageBlobsCreateHeaders withRequestId(String requestId) { + public BlockBlobUploadHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -175,9 +175,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the PageBlobsCreateHeaders object itself. + * @return the BlockBlobUploadHeaders object itself. */ - public PageBlobsCreateHeaders withVersion(String version) { + public BlockBlobUploadHeaders withVersion(String version) { this.version = version; return this; } @@ -198,9 +198,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the PageBlobsCreateHeaders object itself. + * @return the BlockBlobUploadHeaders object itself. */ - public PageBlobsCreateHeaders withDate(OffsetDateTime date) { + public BlockBlobUploadHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -222,9 +222,9 @@ public Boolean isServerEncrypted() { * Set the isServerEncrypted value. * * @param isServerEncrypted the isServerEncrypted value to set. - * @return the PageBlobsCreateHeaders object itself. + * @return the BlockBlobUploadHeaders object itself. */ - public PageBlobsCreateHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + public BlockBlobUploadHeaders withIsServerEncrypted(Boolean isServerEncrypted) { this.isServerEncrypted = isServerEncrypted; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsUploadResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobUploadResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsUploadResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobUploadResponse.java index dc9e7441c..43461d15a 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobsUploadResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlockBlobUploadResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the upload operation. */ -public final class BlockBlobsUploadResponse extends RestResponse { +public final class BlockBlobUploadResponse extends RestResponse { /** - * Creates an instance of BlockBlobsUploadResponse. + * Creates an instance of BlockBlobUploadResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public BlockBlobsUploadResponse(int statusCode, BlockBlobsUploadHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public BlockBlobUploadResponse(HttpRequest request, int statusCode, BlockBlobUploadHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public BlockBlobsUploadHeaders headers() { + public BlockBlobUploadHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersChangeLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerAcquireLeaseHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersChangeLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerAcquireLeaseHeaders.java index 55269c467..8cd212b6d 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersChangeLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerAcquireLeaseHeaders.java @@ -17,10 +17,10 @@ import java.time.OffsetDateTime; /** - * Defines headers for ChangeLease operation. + * Defines headers for AcquireLease operation. */ -@JacksonXmlRootElement(localName = "Containers-ChangeLease-Headers") -public final class ContainersChangeLeaseHeaders { +@JacksonXmlRootElement(localName = "Container-AcquireLease-Headers") +public final class ContainerAcquireLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -78,9 +78,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersChangeLeaseHeaders object itself. + * @return the ContainerAcquireLeaseHeaders object itself. */ - public ContainersChangeLeaseHeaders withETag(String eTag) { + public ContainerAcquireLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -101,9 +101,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersChangeLeaseHeaders object itself. + * @return the ContainerAcquireLeaseHeaders object itself. */ - public ContainersChangeLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerAcquireLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -125,9 +125,9 @@ public String leaseId() { * Set the leaseId value. * * @param leaseId the leaseId value to set. - * @return the ContainersChangeLeaseHeaders object itself. + * @return the ContainerAcquireLeaseHeaders object itself. */ - public ContainersChangeLeaseHeaders withLeaseId(String leaseId) { + public ContainerAcquireLeaseHeaders withLeaseId(String leaseId) { this.leaseId = leaseId; return this; } @@ -145,9 +145,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersChangeLeaseHeaders object itself. + * @return the ContainerAcquireLeaseHeaders object itself. */ - public ContainersChangeLeaseHeaders withRequestId(String requestId) { + public ContainerAcquireLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersChangeLeaseHeaders object itself. + * @return the ContainerAcquireLeaseHeaders object itself. */ - public ContainersChangeLeaseHeaders withVersion(String version) { + public ContainerAcquireLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersChangeLeaseHeaders object itself. + * @return the ContainerAcquireLeaseHeaders object itself. */ - public ContainersChangeLeaseHeaders withDate(OffsetDateTime date) { + public ContainerAcquireLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersAcquireLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerAcquireLeaseResponse.java similarity index 61% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersAcquireLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerAcquireLeaseResponse.java index cd236faaa..8379f7222 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersAcquireLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerAcquireLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the acquireLease operation. */ -public final class ContainersAcquireLeaseResponse extends RestResponse { +public final class ContainerAcquireLeaseResponse extends RestResponse { /** - * Creates an instance of ContainersAcquireLeaseResponse. + * Creates an instance of ContainerAcquireLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersAcquireLeaseResponse(int statusCode, ContainersAcquireLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerAcquireLeaseResponse(HttpRequest request, int statusCode, ContainerAcquireLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersAcquireLeaseHeaders headers() { + public ContainerAcquireLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersBreakLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerBreakLeaseHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersBreakLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerBreakLeaseHeaders.java index abc510dcc..d0ba83943 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersBreakLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerBreakLeaseHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for BreakLease operation. */ -@JacksonXmlRootElement(localName = "Containers-BreakLease-Headers") -public final class ContainersBreakLeaseHeaders { +@JacksonXmlRootElement(localName = "Container-BreakLease-Headers") +public final class ContainerBreakLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -78,9 +78,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersBreakLeaseHeaders object itself. + * @return the ContainerBreakLeaseHeaders object itself. */ - public ContainersBreakLeaseHeaders withETag(String eTag) { + public ContainerBreakLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -101,9 +101,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersBreakLeaseHeaders object itself. + * @return the ContainerBreakLeaseHeaders object itself. */ - public ContainersBreakLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerBreakLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -125,9 +125,9 @@ public Integer leaseTime() { * Set the leaseTime value. * * @param leaseTime the leaseTime value to set. - * @return the ContainersBreakLeaseHeaders object itself. + * @return the ContainerBreakLeaseHeaders object itself. */ - public ContainersBreakLeaseHeaders withLeaseTime(Integer leaseTime) { + public ContainerBreakLeaseHeaders withLeaseTime(Integer leaseTime) { this.leaseTime = leaseTime; return this; } @@ -145,9 +145,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersBreakLeaseHeaders object itself. + * @return the ContainerBreakLeaseHeaders object itself. */ - public ContainersBreakLeaseHeaders withRequestId(String requestId) { + public ContainerBreakLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersBreakLeaseHeaders object itself. + * @return the ContainerBreakLeaseHeaders object itself. */ - public ContainersBreakLeaseHeaders withVersion(String version) { + public ContainerBreakLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersBreakLeaseHeaders object itself. + * @return the ContainerBreakLeaseHeaders object itself. */ - public ContainersBreakLeaseHeaders withDate(OffsetDateTime date) { + public ContainerBreakLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersBreakLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerBreakLeaseResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersBreakLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerBreakLeaseResponse.java index 77c8def81..fa8567cde 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersBreakLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerBreakLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the breakLease operation. */ -public final class ContainersBreakLeaseResponse extends RestResponse { +public final class ContainerBreakLeaseResponse extends RestResponse { /** - * Creates an instance of ContainersBreakLeaseResponse. + * Creates an instance of ContainerBreakLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersBreakLeaseResponse(int statusCode, ContainersBreakLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerBreakLeaseResponse(HttpRequest request, int statusCode, ContainerBreakLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersBreakLeaseHeaders headers() { + public ContainerBreakLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersRenewLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerChangeLeaseHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersRenewLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerChangeLeaseHeaders.java index 3dd591381..9c8b5a5d8 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersRenewLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerChangeLeaseHeaders.java @@ -17,10 +17,10 @@ import java.time.OffsetDateTime; /** - * Defines headers for RenewLease operation. + * Defines headers for ChangeLease operation. */ -@JacksonXmlRootElement(localName = "Containers-RenewLease-Headers") -public final class ContainersRenewLeaseHeaders { +@JacksonXmlRootElement(localName = "Container-ChangeLease-Headers") +public final class ContainerChangeLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -78,9 +78,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersRenewLeaseHeaders object itself. + * @return the ContainerChangeLeaseHeaders object itself. */ - public ContainersRenewLeaseHeaders withETag(String eTag) { + public ContainerChangeLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -101,9 +101,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersRenewLeaseHeaders object itself. + * @return the ContainerChangeLeaseHeaders object itself. */ - public ContainersRenewLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerChangeLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -125,9 +125,9 @@ public String leaseId() { * Set the leaseId value. * * @param leaseId the leaseId value to set. - * @return the ContainersRenewLeaseHeaders object itself. + * @return the ContainerChangeLeaseHeaders object itself. */ - public ContainersRenewLeaseHeaders withLeaseId(String leaseId) { + public ContainerChangeLeaseHeaders withLeaseId(String leaseId) { this.leaseId = leaseId; return this; } @@ -145,9 +145,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersRenewLeaseHeaders object itself. + * @return the ContainerChangeLeaseHeaders object itself. */ - public ContainersRenewLeaseHeaders withRequestId(String requestId) { + public ContainerChangeLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersRenewLeaseHeaders object itself. + * @return the ContainerChangeLeaseHeaders object itself. */ - public ContainersRenewLeaseHeaders withVersion(String version) { + public ContainerChangeLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersRenewLeaseHeaders object itself. + * @return the ContainerChangeLeaseHeaders object itself. */ - public ContainersRenewLeaseHeaders withDate(OffsetDateTime date) { + public ContainerChangeLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersChangeLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerChangeLeaseResponse.java similarity index 61% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersChangeLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerChangeLeaseResponse.java index 723da6534..d8d0d390d 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersChangeLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerChangeLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the changeLease operation. */ -public final class ContainersChangeLeaseResponse extends RestResponse { +public final class ContainerChangeLeaseResponse extends RestResponse { /** - * Creates an instance of ContainersChangeLeaseResponse. + * Creates an instance of ContainerChangeLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersChangeLeaseResponse(int statusCode, ContainersChangeLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerChangeLeaseResponse(HttpRequest request, int statusCode, ContainerChangeLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersChangeLeaseHeaders headers() { + public ContainerChangeLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersCreateHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerCreateHeaders.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersCreateHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerCreateHeaders.java index 0bde52a5d..1e636b7f7 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersCreateHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerCreateHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for Create operation. */ -@JacksonXmlRootElement(localName = "Containers-Create-Headers") -public final class ContainersCreateHeaders { +@JacksonXmlRootElement(localName = "Container-Create-Headers") +public final class ContainerCreateHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -72,9 +72,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersCreateHeaders object itself. + * @return the ContainerCreateHeaders object itself. */ - public ContainersCreateHeaders withETag(String eTag) { + public ContainerCreateHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -95,9 +95,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersCreateHeaders object itself. + * @return the ContainerCreateHeaders object itself. */ - public ContainersCreateHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerCreateHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -119,9 +119,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersCreateHeaders object itself. + * @return the ContainerCreateHeaders object itself. */ - public ContainersCreateHeaders withRequestId(String requestId) { + public ContainerCreateHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -139,9 +139,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersCreateHeaders object itself. + * @return the ContainerCreateHeaders object itself. */ - public ContainersCreateHeaders withVersion(String version) { + public ContainerCreateHeaders withVersion(String version) { this.version = version; return this; } @@ -162,9 +162,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersCreateHeaders object itself. + * @return the ContainerCreateHeaders object itself. */ - public ContainersCreateHeaders withDate(OffsetDateTime date) { + public ContainerCreateHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCreateResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerCreateResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCreateResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerCreateResponse.java index 31d4415b9..a34625f5e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCreateResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerCreateResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the create operation. */ -public final class PageBlobsCreateResponse extends RestResponse { +public final class ContainerCreateResponse extends RestResponse { /** - * Creates an instance of PageBlobsCreateResponse. + * Creates an instance of ContainerCreateResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public PageBlobsCreateResponse(int statusCode, PageBlobsCreateHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerCreateResponse(HttpRequest request, int statusCode, ContainerCreateHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public PageBlobsCreateHeaders headers() { + public ContainerCreateHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersDeleteHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerDeleteHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersDeleteHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerDeleteHeaders.java index c33c24011..adacd2017 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersDeleteHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerDeleteHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for Delete operation. */ -@JacksonXmlRootElement(localName = "Containers-Delete-Headers") -public final class ContainersDeleteHeaders { +@JacksonXmlRootElement(localName = "Container-Delete-Headers") +public final class ContainerDeleteHeaders { /** * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -56,9 +56,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersDeleteHeaders object itself. + * @return the ContainerDeleteHeaders object itself. */ - public ContainersDeleteHeaders withRequestId(String requestId) { + public ContainerDeleteHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -76,9 +76,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersDeleteHeaders object itself. + * @return the ContainerDeleteHeaders object itself. */ - public ContainersDeleteHeaders withVersion(String version) { + public ContainerDeleteHeaders withVersion(String version) { this.version = version; return this; } @@ -99,9 +99,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersDeleteHeaders object itself. + * @return the ContainerDeleteHeaders object itself. */ - public ContainersDeleteHeaders withDate(OffsetDateTime date) { + public ContainerDeleteHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersDeleteResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerDeleteResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersDeleteResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerDeleteResponse.java index 2ce273747..ddc8e824c 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersDeleteResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerDeleteResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the delete operation. */ -public final class ContainersDeleteResponse extends RestResponse { +public final class ContainerDeleteResponse extends RestResponse { /** - * Creates an instance of ContainersDeleteResponse. + * Creates an instance of ContainerDeleteResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersDeleteResponse(int statusCode, ContainersDeleteHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerDeleteResponse(HttpRequest request, int statusCode, ContainerDeleteHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersDeleteHeaders headers() { + public ContainerDeleteHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetAccessPolicyHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccessPolicyHeaders.java similarity index 81% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetAccessPolicyHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccessPolicyHeaders.java index 61f30d36f..00e7f518b 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetAccessPolicyHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccessPolicyHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for GetAccessPolicy operation. */ -@JacksonXmlRootElement(localName = "Containers-GetAccessPolicy-Headers") -public final class ContainersGetAccessPolicyHeaders { +@JacksonXmlRootElement(localName = "Container-GetAccessPolicy-Headers") +public final class ContainerGetAccessPolicyHeaders { /** * Indicated whether data in the container may be accessed publicly and the * level of access. Possible values include: 'container', 'blob'. @@ -79,9 +79,9 @@ public PublicAccessType blobPublicAccess() { * Set the blobPublicAccess value. * * @param blobPublicAccess the blobPublicAccess value to set. - * @return the ContainersGetAccessPolicyHeaders object itself. + * @return the ContainerGetAccessPolicyHeaders object itself. */ - public ContainersGetAccessPolicyHeaders withBlobPublicAccess(PublicAccessType blobPublicAccess) { + public ContainerGetAccessPolicyHeaders withBlobPublicAccess(PublicAccessType blobPublicAccess) { this.blobPublicAccess = blobPublicAccess; return this; } @@ -99,9 +99,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersGetAccessPolicyHeaders object itself. + * @return the ContainerGetAccessPolicyHeaders object itself. */ - public ContainersGetAccessPolicyHeaders withETag(String eTag) { + public ContainerGetAccessPolicyHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -122,9 +122,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersGetAccessPolicyHeaders object itself. + * @return the ContainerGetAccessPolicyHeaders object itself. */ - public ContainersGetAccessPolicyHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerGetAccessPolicyHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -146,9 +146,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersGetAccessPolicyHeaders object itself. + * @return the ContainerGetAccessPolicyHeaders object itself. */ - public ContainersGetAccessPolicyHeaders withRequestId(String requestId) { + public ContainerGetAccessPolicyHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -166,9 +166,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersGetAccessPolicyHeaders object itself. + * @return the ContainerGetAccessPolicyHeaders object itself. */ - public ContainersGetAccessPolicyHeaders withVersion(String version) { + public ContainerGetAccessPolicyHeaders withVersion(String version) { this.version = version; return this; } @@ -189,9 +189,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersGetAccessPolicyHeaders object itself. + * @return the ContainerGetAccessPolicyHeaders object itself. */ - public ContainersGetAccessPolicyHeaders withDate(OffsetDateTime date) { + public ContainerGetAccessPolicyHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetAccessPolicyResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccessPolicyResponse.java similarity index 64% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetAccessPolicyResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccessPolicyResponse.java index 3bcbf6e79..b30c99d08 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetAccessPolicyResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccessPolicyResponse.java @@ -11,6 +11,7 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -18,24 +19,25 @@ /** * Contains all response data for the getAccessPolicy operation. */ -public final class ContainersGetAccessPolicyResponse extends RestResponse> { +public final class ContainerGetAccessPolicyResponse extends RestResponse> { /** - * Creates an instance of ContainersGetAccessPolicyResponse. + * Creates an instance of ContainerGetAccessPolicyResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersGetAccessPolicyResponse(int statusCode, ContainersGetAccessPolicyHeaders headers, Map rawHeaders, List body) { - super(statusCode, headers, rawHeaders, body); + public ContainerGetAccessPolicyResponse(HttpRequest request, int statusCode, ContainerGetAccessPolicyHeaders headers, Map rawHeaders, List body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersGetAccessPolicyHeaders headers() { + public ContainerGetAccessPolicyHeaders headers() { return super.headers(); } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccountInfoHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccountInfoHeaders.java new file mode 100644 index 000000000..baab0c1a6 --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccountInfoHeaders.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.microsoft.rest.v2.DateTimeRfc1123; +import java.time.OffsetDateTime; + +/** + * Defines headers for GetAccountInfo operation. + */ +@JacksonXmlRootElement(localName = "Container-GetAccountInfo-Headers") +public final class ContainerGetAccountInfoHeaders { + /** + * This header uniquely identifies the request that was made and can be + * used for troubleshooting the request. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /** + * Indicates the version of the Blob service used to execute the request. + * This header is returned for requests made against version 2009-09-19 and + * above. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /** + * UTC date/time value generated by the service that indicates the time at + * which the response was initiated. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 date; + + /** + * Identifies the sku name of the account. Possible values include: + * 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', + * 'Premium_LRS'. + */ + @JsonProperty(value = "x-ms-sku-name") + private SkuName skuName; + + /** + * Identifies the account kind. Possible values include: 'Storage', + * 'BlobStorage', 'StorageV2'. + */ + @JsonProperty(value = "x-ms-account-kind") + private AccountKind accountKind; + + /** + * Get the requestId value. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId value. + * + * @param requestId the requestId value to set. + * @return the ContainerGetAccountInfoHeaders object itself. + */ + public ContainerGetAccountInfoHeaders withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version value. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version value. + * + * @param version the version value to set. + * @return the ContainerGetAccountInfoHeaders object itself. + */ + public ContainerGetAccountInfoHeaders withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the date value. + * + * @return the date value. + */ + public OffsetDateTime date() { + if (this.date == null) { + return null; + } + return this.date.dateTime(); + } + + /** + * Set the date value. + * + * @param date the date value to set. + * @return the ContainerGetAccountInfoHeaders object itself. + */ + public ContainerGetAccountInfoHeaders withDate(OffsetDateTime date) { + if (date == null) { + this.date = null; + } else { + this.date = new DateTimeRfc1123(date); + } + return this; + } + + /** + * Get the skuName value. + * + * @return the skuName value. + */ + public SkuName skuName() { + return this.skuName; + } + + /** + * Set the skuName value. + * + * @param skuName the skuName value to set. + * @return the ContainerGetAccountInfoHeaders object itself. + */ + public ContainerGetAccountInfoHeaders withSkuName(SkuName skuName) { + this.skuName = skuName; + return this; + } + + /** + * Get the accountKind value. + * + * @return the accountKind value. + */ + public AccountKind accountKind() { + return this.accountKind; + } + + /** + * Set the accountKind value. + * + * @param accountKind the accountKind value to set. + * @return the ContainerGetAccountInfoHeaders object itself. + */ + public ContainerGetAccountInfoHeaders withAccountKind(AccountKind accountKind) { + this.accountKind = accountKind; + return this; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccountInfoResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccountInfoResponse.java new file mode 100644 index 000000000..2348d16b4 --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetAccountInfoResponse.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; +import java.util.Map; + +/** + * Contains all response data for the getAccountInfo operation. + */ +public final class ContainerGetAccountInfoResponse extends RestResponse { + /** + * Creates an instance of ContainerGetAccountInfoResponse. + * + * @param request the request which resulted in this {response.Name}. + * @param statusCode the status code of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param body the deserialized body of the HTTP response. + */ + public ContainerGetAccountInfoResponse(HttpRequest request, int statusCode, ContainerGetAccountInfoHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); + } + + /** + * @return the deserialized response headers. + */ + @Override + public ContainerGetAccountInfoHeaders headers() { + return super.headers(); + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetPropertiesHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetPropertiesHeaders.java similarity index 69% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetPropertiesHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetPropertiesHeaders.java index 29ee2c378..e4e89a382 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetPropertiesHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetPropertiesHeaders.java @@ -21,8 +21,8 @@ /** * Defines headers for GetProperties operation. */ -@JacksonXmlRootElement(localName = "Containers-GetProperties-Headers") -public final class ContainersGetPropertiesHeaders { +@JacksonXmlRootElement(localName = "Container-GetProperties-Headers") +public final class ContainerGetPropertiesHeaders { /** * The metadata property. */ @@ -95,6 +95,18 @@ public final class ContainersGetPropertiesHeaders { @JsonProperty(value = "x-ms-blob-public-access") private PublicAccessType blobPublicAccess; + /** + * Indicates whether the container has an immutability policy set on it. + */ + @JsonProperty(value = "x-ms-has-immutability-policy") + private Boolean hasImmutabilityPolicy; + + /** + * Indicates whether the container has a legal hold. + */ + @JsonProperty(value = "x-ms-has-legal-hold") + private Boolean hasLegalHold; + /** * Get the metadata value. * @@ -108,9 +120,9 @@ public Map metadata() { * Set the metadata value. * * @param metadata the metadata value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withMetadata(Map metadata) { + public ContainerGetPropertiesHeaders withMetadata(Map metadata) { this.metadata = metadata; return this; } @@ -128,9 +140,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withETag(String eTag) { + public ContainerGetPropertiesHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -151,9 +163,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerGetPropertiesHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -175,9 +187,9 @@ public LeaseDurationType leaseDuration() { * Set the leaseDuration value. * * @param leaseDuration the leaseDuration value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withLeaseDuration(LeaseDurationType leaseDuration) { + public ContainerGetPropertiesHeaders withLeaseDuration(LeaseDurationType leaseDuration) { this.leaseDuration = leaseDuration; return this; } @@ -195,9 +207,9 @@ public LeaseStateType leaseState() { * Set the leaseState value. * * @param leaseState the leaseState value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withLeaseState(LeaseStateType leaseState) { + public ContainerGetPropertiesHeaders withLeaseState(LeaseStateType leaseState) { this.leaseState = leaseState; return this; } @@ -215,9 +227,9 @@ public LeaseStatusType leaseStatus() { * Set the leaseStatus value. * * @param leaseStatus the leaseStatus value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withLeaseStatus(LeaseStatusType leaseStatus) { + public ContainerGetPropertiesHeaders withLeaseStatus(LeaseStatusType leaseStatus) { this.leaseStatus = leaseStatus; return this; } @@ -235,9 +247,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withRequestId(String requestId) { + public ContainerGetPropertiesHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -255,9 +267,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withVersion(String version) { + public ContainerGetPropertiesHeaders withVersion(String version) { this.version = version; return this; } @@ -278,9 +290,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withDate(OffsetDateTime date) { + public ContainerGetPropertiesHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -302,10 +314,50 @@ public PublicAccessType blobPublicAccess() { * Set the blobPublicAccess value. * * @param blobPublicAccess the blobPublicAccess value to set. - * @return the ContainersGetPropertiesHeaders object itself. + * @return the ContainerGetPropertiesHeaders object itself. */ - public ContainersGetPropertiesHeaders withBlobPublicAccess(PublicAccessType blobPublicAccess) { + public ContainerGetPropertiesHeaders withBlobPublicAccess(PublicAccessType blobPublicAccess) { this.blobPublicAccess = blobPublicAccess; return this; } + + /** + * Get the hasImmutabilityPolicy value. + * + * @return the hasImmutabilityPolicy value. + */ + public Boolean hasImmutabilityPolicy() { + return this.hasImmutabilityPolicy; + } + + /** + * Set the hasImmutabilityPolicy value. + * + * @param hasImmutabilityPolicy the hasImmutabilityPolicy value to set. + * @return the ContainerGetPropertiesHeaders object itself. + */ + public ContainerGetPropertiesHeaders withHasImmutabilityPolicy(Boolean hasImmutabilityPolicy) { + this.hasImmutabilityPolicy = hasImmutabilityPolicy; + return this; + } + + /** + * Get the hasLegalHold value. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Set the hasLegalHold value. + * + * @param hasLegalHold the hasLegalHold value to set. + * @return the ContainerGetPropertiesHeaders object itself. + */ + public ContainerGetPropertiesHeaders withHasLegalHold(Boolean hasLegalHold) { + this.hasLegalHold = hasLegalHold; + return this; + } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetPropertiesResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetPropertiesResponse.java similarity index 61% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetPropertiesResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetPropertiesResponse.java index 44ae759c5..037e7949b 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersGetPropertiesResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerGetPropertiesResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the getProperties operation. */ -public final class ContainersGetPropertiesResponse extends RestResponse { +public final class ContainerGetPropertiesResponse extends RestResponse { /** - * Creates an instance of ContainersGetPropertiesResponse. + * Creates an instance of ContainerGetPropertiesResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersGetPropertiesResponse(int statusCode, ContainersGetPropertiesHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerGetPropertiesResponse(HttpRequest request, int statusCode, ContainerGetPropertiesHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersGetPropertiesHeaders headers() { + public ContainerGetPropertiesHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/Container.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerItem.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/Container.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerItem.java index 7e53884f8..cbc20b073 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/Container.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerItem.java @@ -19,7 +19,7 @@ * An Azure Storage container. */ @JacksonXmlRootElement(localName = "Container") -public final class Container { +public final class ContainerItem { /** * The name property. */ @@ -51,9 +51,9 @@ public String name() { * Set the name value. * * @param name the name value to set. - * @return the Container object itself. + * @return the ContainerItem object itself. */ - public Container withName(String name) { + public ContainerItem withName(String name) { this.name = name; return this; } @@ -71,9 +71,9 @@ public ContainerProperties properties() { * Set the properties value. * * @param properties the properties value to set. - * @return the Container object itself. + * @return the ContainerItem object itself. */ - public Container withProperties(ContainerProperties properties) { + public ContainerItem withProperties(ContainerProperties properties) { this.properties = properties; return this; } @@ -91,9 +91,9 @@ public Map metadata() { * Set the metadata value. * * @param metadata the metadata value to set. - * @return the Container object itself. + * @return the ContainerItem object itself. */ - public Container withMetadata(Map metadata) { + public ContainerItem withMetadata(Map metadata) { this.metadata = metadata; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobFlatSegmentHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobFlatSegmentHeaders.java similarity index 80% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobFlatSegmentHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobFlatSegmentHeaders.java index ce76cee5b..0f735464d 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobFlatSegmentHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobFlatSegmentHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for ListBlobFlatSegment operation. */ -@JacksonXmlRootElement(localName = "Containers-ListBlobFlatSegment-Headers") -public final class ContainersListBlobFlatSegmentHeaders { +@JacksonXmlRootElement(localName = "Container-ListBlobFlatSegment-Headers") +public final class ContainerListBlobFlatSegmentHeaders { /** * The content type specified for the blob. The default content type is * 'application/octet-stream'. @@ -63,9 +63,9 @@ public String contentType() { * Set the contentType value. * * @param contentType the contentType value to set. - * @return the ContainersListBlobFlatSegmentHeaders object itself. + * @return the ContainerListBlobFlatSegmentHeaders object itself. */ - public ContainersListBlobFlatSegmentHeaders withContentType(String contentType) { + public ContainerListBlobFlatSegmentHeaders withContentType(String contentType) { this.contentType = contentType; return this; } @@ -83,9 +83,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersListBlobFlatSegmentHeaders object itself. + * @return the ContainerListBlobFlatSegmentHeaders object itself. */ - public ContainersListBlobFlatSegmentHeaders withRequestId(String requestId) { + public ContainerListBlobFlatSegmentHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -103,9 +103,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersListBlobFlatSegmentHeaders object itself. + * @return the ContainerListBlobFlatSegmentHeaders object itself. */ - public ContainersListBlobFlatSegmentHeaders withVersion(String version) { + public ContainerListBlobFlatSegmentHeaders withVersion(String version) { this.version = version; return this; } @@ -126,9 +126,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersListBlobFlatSegmentHeaders object itself. + * @return the ContainerListBlobFlatSegmentHeaders object itself. */ - public ContainersListBlobFlatSegmentHeaders withDate(OffsetDateTime date) { + public ContainerListBlobFlatSegmentHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobFlatSegmentResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobFlatSegmentResponse.java similarity index 59% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobFlatSegmentResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobFlatSegmentResponse.java index febb4e3c4..6d751f0b2 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobFlatSegmentResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobFlatSegmentResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the listBlobFlatSegment operation. */ -public final class ContainersListBlobFlatSegmentResponse extends RestResponse { +public final class ContainerListBlobFlatSegmentResponse extends RestResponse { /** - * Creates an instance of ContainersListBlobFlatSegmentResponse. + * Creates an instance of ContainerListBlobFlatSegmentResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersListBlobFlatSegmentResponse(int statusCode, ContainersListBlobFlatSegmentHeaders headers, Map rawHeaders, ListBlobsFlatResponse body) { - super(statusCode, headers, rawHeaders, body); + public ContainerListBlobFlatSegmentResponse(HttpRequest request, int statusCode, ContainerListBlobFlatSegmentHeaders headers, Map rawHeaders, ListBlobsFlatSegmentResponse body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersListBlobFlatSegmentHeaders headers() { + public ContainerListBlobFlatSegmentHeaders headers() { return super.headers(); } @@ -41,7 +43,7 @@ public ContainersListBlobFlatSegmentHeaders headers() { * @return the deserialized response body. */ @Override - public ListBlobsFlatResponse body() { + public ListBlobsFlatSegmentResponse body() { return super.body(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobHierarchySegmentHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobHierarchySegmentHeaders.java similarity index 79% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobHierarchySegmentHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobHierarchySegmentHeaders.java index a9ae2e985..38b5195a6 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobHierarchySegmentHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobHierarchySegmentHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for ListBlobHierarchySegment operation. */ -@JacksonXmlRootElement(localName = "Containers-ListBlobHierarchySegment-Headers") -public final class ContainersListBlobHierarchySegmentHeaders { +@JacksonXmlRootElement(localName = "Container-ListBlobHierarchySegment-Headers") +public final class ContainerListBlobHierarchySegmentHeaders { /** * The content type specified for the blob. The default content type is * 'application/octet-stream'. @@ -63,9 +63,9 @@ public String contentType() { * Set the contentType value. * * @param contentType the contentType value to set. - * @return the ContainersListBlobHierarchySegmentHeaders object itself. + * @return the ContainerListBlobHierarchySegmentHeaders object itself. */ - public ContainersListBlobHierarchySegmentHeaders withContentType(String contentType) { + public ContainerListBlobHierarchySegmentHeaders withContentType(String contentType) { this.contentType = contentType; return this; } @@ -83,9 +83,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersListBlobHierarchySegmentHeaders object itself. + * @return the ContainerListBlobHierarchySegmentHeaders object itself. */ - public ContainersListBlobHierarchySegmentHeaders withRequestId(String requestId) { + public ContainerListBlobHierarchySegmentHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -103,9 +103,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersListBlobHierarchySegmentHeaders object itself. + * @return the ContainerListBlobHierarchySegmentHeaders object itself. */ - public ContainersListBlobHierarchySegmentHeaders withVersion(String version) { + public ContainerListBlobHierarchySegmentHeaders withVersion(String version) { this.version = version; return this; } @@ -126,9 +126,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersListBlobHierarchySegmentHeaders object itself. + * @return the ContainerListBlobHierarchySegmentHeaders object itself. */ - public ContainersListBlobHierarchySegmentHeaders withDate(OffsetDateTime date) { + public ContainerListBlobHierarchySegmentHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobHierarchySegmentResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobHierarchySegmentResponse.java similarity index 58% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobHierarchySegmentResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobHierarchySegmentResponse.java index 4088caaf3..958af2127 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersListBlobHierarchySegmentResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerListBlobHierarchySegmentResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the listBlobHierarchySegment operation. */ -public final class ContainersListBlobHierarchySegmentResponse extends RestResponse { +public final class ContainerListBlobHierarchySegmentResponse extends RestResponse { /** - * Creates an instance of ContainersListBlobHierarchySegmentResponse. + * Creates an instance of ContainerListBlobHierarchySegmentResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersListBlobHierarchySegmentResponse(int statusCode, ContainersListBlobHierarchySegmentHeaders headers, Map rawHeaders, ListBlobsHierarchyResponse body) { - super(statusCode, headers, rawHeaders, body); + public ContainerListBlobHierarchySegmentResponse(HttpRequest request, int statusCode, ContainerListBlobHierarchySegmentHeaders headers, Map rawHeaders, ListBlobsHierarchySegmentResponse body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersListBlobHierarchySegmentHeaders headers() { + public ContainerListBlobHierarchySegmentHeaders headers() { return super.headers(); } @@ -41,7 +43,7 @@ public ContainersListBlobHierarchySegmentHeaders headers() { * @return the deserialized response body. */ @Override - public ListBlobsHierarchyResponse body() { + public ListBlobsHierarchySegmentResponse body() { return super.body(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainerProperties.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerProperties.java index 3416893df..2bc73073e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainerProperties.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerProperties.java @@ -58,6 +58,18 @@ public final class ContainerProperties { @JsonProperty(value = "PublicAccess") private PublicAccessType publicAccess; + /** + * The hasImmutabilityPolicy property. + */ + @JsonProperty(value = "HasImmutabilityPolicy") + private Boolean hasImmutabilityPolicy; + + /** + * The hasLegalHold property. + */ + @JsonProperty(value = "HasLegalHold") + private Boolean hasLegalHold; + /** * Get the lastModified value. * @@ -184,4 +196,44 @@ public ContainerProperties withPublicAccess(PublicAccessType publicAccess) { this.publicAccess = publicAccess; return this; } + + /** + * Get the hasImmutabilityPolicy value. + * + * @return the hasImmutabilityPolicy value. + */ + public Boolean hasImmutabilityPolicy() { + return this.hasImmutabilityPolicy; + } + + /** + * Set the hasImmutabilityPolicy value. + * + * @param hasImmutabilityPolicy the hasImmutabilityPolicy value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withHasImmutabilityPolicy(Boolean hasImmutabilityPolicy) { + this.hasImmutabilityPolicy = hasImmutabilityPolicy; + return this; + } + + /** + * Get the hasLegalHold value. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Set the hasLegalHold value. + * + * @param hasLegalHold the hasLegalHold value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withHasLegalHold(Boolean hasLegalHold) { + this.hasLegalHold = hasLegalHold; + return this; + } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetMetadataHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerReleaseLeaseHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetMetadataHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerReleaseLeaseHeaders.java index 2e793b830..6e4526f5d 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetMetadataHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerReleaseLeaseHeaders.java @@ -17,10 +17,10 @@ import java.time.OffsetDateTime; /** - * Defines headers for SetMetadata operation. + * Defines headers for ReleaseLease operation. */ -@JacksonXmlRootElement(localName = "Containers-SetMetadata-Headers") -public final class ContainersSetMetadataHeaders { +@JacksonXmlRootElement(localName = "Container-ReleaseLease-Headers") +public final class ContainerReleaseLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -72,9 +72,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersSetMetadataHeaders object itself. + * @return the ContainerReleaseLeaseHeaders object itself. */ - public ContainersSetMetadataHeaders withETag(String eTag) { + public ContainerReleaseLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -95,9 +95,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersSetMetadataHeaders object itself. + * @return the ContainerReleaseLeaseHeaders object itself. */ - public ContainersSetMetadataHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerReleaseLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -119,9 +119,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersSetMetadataHeaders object itself. + * @return the ContainerReleaseLeaseHeaders object itself. */ - public ContainersSetMetadataHeaders withRequestId(String requestId) { + public ContainerReleaseLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -139,9 +139,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersSetMetadataHeaders object itself. + * @return the ContainerReleaseLeaseHeaders object itself. */ - public ContainersSetMetadataHeaders withVersion(String version) { + public ContainerReleaseLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -162,9 +162,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersSetMetadataHeaders object itself. + * @return the ContainerReleaseLeaseHeaders object itself. */ - public ContainersSetMetadataHeaders withDate(OffsetDateTime date) { + public ContainerReleaseLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersReleaseLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerReleaseLeaseResponse.java similarity index 61% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersReleaseLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerReleaseLeaseResponse.java index 42bf75b55..21a2aefca 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersReleaseLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerReleaseLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the releaseLease operation. */ -public final class ContainersReleaseLeaseResponse extends RestResponse { +public final class ContainerReleaseLeaseResponse extends RestResponse { /** - * Creates an instance of ContainersReleaseLeaseResponse. + * Creates an instance of ContainerReleaseLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersReleaseLeaseResponse(int statusCode, ContainersReleaseLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerReleaseLeaseResponse(HttpRequest request, int statusCode, ContainerReleaseLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersReleaseLeaseHeaders headers() { + public ContainerReleaseLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersAcquireLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerRenewLeaseHeaders.java similarity index 81% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersAcquireLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerRenewLeaseHeaders.java index 68093e391..2cd394869 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersAcquireLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerRenewLeaseHeaders.java @@ -17,10 +17,10 @@ import java.time.OffsetDateTime; /** - * Defines headers for AcquireLease operation. + * Defines headers for RenewLease operation. */ -@JacksonXmlRootElement(localName = "Containers-AcquireLease-Headers") -public final class ContainersAcquireLeaseHeaders { +@JacksonXmlRootElement(localName = "Container-RenewLease-Headers") +public final class ContainerRenewLeaseHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -78,9 +78,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersAcquireLeaseHeaders object itself. + * @return the ContainerRenewLeaseHeaders object itself. */ - public ContainersAcquireLeaseHeaders withETag(String eTag) { + public ContainerRenewLeaseHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -101,9 +101,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersAcquireLeaseHeaders object itself. + * @return the ContainerRenewLeaseHeaders object itself. */ - public ContainersAcquireLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerRenewLeaseHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -125,9 +125,9 @@ public String leaseId() { * Set the leaseId value. * * @param leaseId the leaseId value to set. - * @return the ContainersAcquireLeaseHeaders object itself. + * @return the ContainerRenewLeaseHeaders object itself. */ - public ContainersAcquireLeaseHeaders withLeaseId(String leaseId) { + public ContainerRenewLeaseHeaders withLeaseId(String leaseId) { this.leaseId = leaseId; return this; } @@ -145,9 +145,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersAcquireLeaseHeaders object itself. + * @return the ContainerRenewLeaseHeaders object itself. */ - public ContainersAcquireLeaseHeaders withRequestId(String requestId) { + public ContainerRenewLeaseHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersAcquireLeaseHeaders object itself. + * @return the ContainerRenewLeaseHeaders object itself. */ - public ContainersAcquireLeaseHeaders withVersion(String version) { + public ContainerRenewLeaseHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersAcquireLeaseHeaders object itself. + * @return the ContainerRenewLeaseHeaders object itself. */ - public ContainersAcquireLeaseHeaders withDate(OffsetDateTime date) { + public ContainerRenewLeaseHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersRenewLeaseResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerRenewLeaseResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersRenewLeaseResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerRenewLeaseResponse.java index 49f17b0bf..9c50a7148 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersRenewLeaseResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerRenewLeaseResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the renewLease operation. */ -public final class ContainersRenewLeaseResponse extends RestResponse { +public final class ContainerRenewLeaseResponse extends RestResponse { /** - * Creates an instance of ContainersRenewLeaseResponse. + * Creates an instance of ContainerRenewLeaseResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersRenewLeaseResponse(int statusCode, ContainersRenewLeaseHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerRenewLeaseResponse(HttpRequest request, int statusCode, ContainerRenewLeaseHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersRenewLeaseHeaders headers() { + public ContainerRenewLeaseHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetAccessPolicyHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetAccessPolicyHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetAccessPolicyHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetAccessPolicyHeaders.java index 10988e79d..8c9714562 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetAccessPolicyHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetAccessPolicyHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for SetAccessPolicy operation. */ -@JacksonXmlRootElement(localName = "Containers-SetAccessPolicy-Headers") -public final class ContainersSetAccessPolicyHeaders { +@JacksonXmlRootElement(localName = "Container-SetAccessPolicy-Headers") +public final class ContainerSetAccessPolicyHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -72,9 +72,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersSetAccessPolicyHeaders object itself. + * @return the ContainerSetAccessPolicyHeaders object itself. */ - public ContainersSetAccessPolicyHeaders withETag(String eTag) { + public ContainerSetAccessPolicyHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -95,9 +95,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersSetAccessPolicyHeaders object itself. + * @return the ContainerSetAccessPolicyHeaders object itself. */ - public ContainersSetAccessPolicyHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerSetAccessPolicyHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -119,9 +119,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersSetAccessPolicyHeaders object itself. + * @return the ContainerSetAccessPolicyHeaders object itself. */ - public ContainersSetAccessPolicyHeaders withRequestId(String requestId) { + public ContainerSetAccessPolicyHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -139,9 +139,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersSetAccessPolicyHeaders object itself. + * @return the ContainerSetAccessPolicyHeaders object itself. */ - public ContainersSetAccessPolicyHeaders withVersion(String version) { + public ContainerSetAccessPolicyHeaders withVersion(String version) { this.version = version; return this; } @@ -162,9 +162,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersSetAccessPolicyHeaders object itself. + * @return the ContainerSetAccessPolicyHeaders object itself. */ - public ContainersSetAccessPolicyHeaders withDate(OffsetDateTime date) { + public ContainerSetAccessPolicyHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetAccessPolicyResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetAccessPolicyResponse.java similarity index 61% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetAccessPolicyResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetAccessPolicyResponse.java index 8c288d977..08faa8cb0 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetAccessPolicyResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetAccessPolicyResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the setAccessPolicy operation. */ -public final class ContainersSetAccessPolicyResponse extends RestResponse { +public final class ContainerSetAccessPolicyResponse extends RestResponse { /** - * Creates an instance of ContainersSetAccessPolicyResponse. + * Creates an instance of ContainerSetAccessPolicyResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersSetAccessPolicyResponse(int statusCode, ContainersSetAccessPolicyHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerSetAccessPolicyResponse(HttpRequest request, int statusCode, ContainerSetAccessPolicyHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersSetAccessPolicyHeaders headers() { + public ContainerSetAccessPolicyHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersReleaseLeaseHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetMetadataHeaders.java similarity index 81% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersReleaseLeaseHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetMetadataHeaders.java index fec294dbc..cd817a5df 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersReleaseLeaseHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetMetadataHeaders.java @@ -17,10 +17,10 @@ import java.time.OffsetDateTime; /** - * Defines headers for ReleaseLease operation. + * Defines headers for SetMetadata operation. */ -@JacksonXmlRootElement(localName = "Containers-ReleaseLease-Headers") -public final class ContainersReleaseLeaseHeaders { +@JacksonXmlRootElement(localName = "Container-SetMetadata-Headers") +public final class ContainerSetMetadataHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -72,9 +72,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the ContainersReleaseLeaseHeaders object itself. + * @return the ContainerSetMetadataHeaders object itself. */ - public ContainersReleaseLeaseHeaders withETag(String eTag) { + public ContainerSetMetadataHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -95,9 +95,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the ContainersReleaseLeaseHeaders object itself. + * @return the ContainerSetMetadataHeaders object itself. */ - public ContainersReleaseLeaseHeaders withLastModified(OffsetDateTime lastModified) { + public ContainerSetMetadataHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -119,9 +119,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the ContainersReleaseLeaseHeaders object itself. + * @return the ContainerSetMetadataHeaders object itself. */ - public ContainersReleaseLeaseHeaders withRequestId(String requestId) { + public ContainerSetMetadataHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -139,9 +139,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the ContainersReleaseLeaseHeaders object itself. + * @return the ContainerSetMetadataHeaders object itself. */ - public ContainersReleaseLeaseHeaders withVersion(String version) { + public ContainerSetMetadataHeaders withVersion(String version) { this.version = version; return this; } @@ -162,9 +162,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the ContainersReleaseLeaseHeaders object itself. + * @return the ContainerSetMetadataHeaders object itself. */ - public ContainersReleaseLeaseHeaders withDate(OffsetDateTime date) { + public ContainerSetMetadataHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetMetadataResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetMetadataResponse.java similarity index 61% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetMetadataResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetMetadataResponse.java index 01401c7b8..07688f18c 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersSetMetadataResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ContainerSetMetadataResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the setMetadata operation. */ -public final class ContainersSetMetadataResponse extends RestResponse { +public final class ContainerSetMetadataResponse extends RestResponse { /** - * Creates an instance of ContainersSetMetadataResponse. + * Creates an instance of ContainerSetMetadataResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersSetMetadataResponse(int statusCode, ContainersSetMetadataHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ContainerSetMetadataResponse(HttpRequest request, int statusCode, ContainerSetMetadataHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersSetMetadataHeaders headers() { + public ContainerSetMetadataHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/GeoReplication.java b/src/main/java/com/microsoft/azure/storage/blob/models/GeoReplication.java index 871f3e356..dd622489e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/GeoReplication.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/GeoReplication.java @@ -17,7 +17,7 @@ import java.time.OffsetDateTime; /** - * The GeoReplication model. + * Geo-Replication information for the Secondary Storage Service. */ @JacksonXmlRootElement(localName = "GeoReplication") public final class GeoReplication { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsFlatResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsFlatSegmentResponse.java similarity index 73% rename from src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsFlatResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsFlatSegmentResponse.java index 3284ab391..629a79f53 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsFlatResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsFlatSegmentResponse.java @@ -18,7 +18,7 @@ * An enumeration of blobs. */ @JacksonXmlRootElement(localName = "EnumerationResults") -public final class ListBlobsFlatResponse { +public final class ListBlobsFlatSegmentResponse { /** * The serviceEndpoint property. */ @@ -56,10 +56,10 @@ public final class ListBlobsFlatResponse { private String delimiter; /** - * The blobs property. + * The segment property. */ @JsonProperty(value = "Blobs", required = true) - private BlobFlatList blobs; + private BlobFlatListSegment segment; /** * The nextMarker property. @@ -80,9 +80,9 @@ public String serviceEndpoint() { * Set the serviceEndpoint value. * * @param serviceEndpoint the serviceEndpoint value to set. - * @return the ListBlobsFlatResponse object itself. + * @return the ListBlobsFlatSegmentResponse object itself. */ - public ListBlobsFlatResponse withServiceEndpoint(String serviceEndpoint) { + public ListBlobsFlatSegmentResponse withServiceEndpoint(String serviceEndpoint) { this.serviceEndpoint = serviceEndpoint; return this; } @@ -100,9 +100,9 @@ public String containerName() { * Set the containerName value. * * @param containerName the containerName value to set. - * @return the ListBlobsFlatResponse object itself. + * @return the ListBlobsFlatSegmentResponse object itself. */ - public ListBlobsFlatResponse withContainerName(String containerName) { + public ListBlobsFlatSegmentResponse withContainerName(String containerName) { this.containerName = containerName; return this; } @@ -120,9 +120,9 @@ public String prefix() { * Set the prefix value. * * @param prefix the prefix value to set. - * @return the ListBlobsFlatResponse object itself. + * @return the ListBlobsFlatSegmentResponse object itself. */ - public ListBlobsFlatResponse withPrefix(String prefix) { + public ListBlobsFlatSegmentResponse withPrefix(String prefix) { this.prefix = prefix; return this; } @@ -140,9 +140,9 @@ public String marker() { * Set the marker value. * * @param marker the marker value to set. - * @return the ListBlobsFlatResponse object itself. + * @return the ListBlobsFlatSegmentResponse object itself. */ - public ListBlobsFlatResponse withMarker(String marker) { + public ListBlobsFlatSegmentResponse withMarker(String marker) { this.marker = marker; return this; } @@ -160,9 +160,9 @@ public int maxResults() { * Set the maxResults value. * * @param maxResults the maxResults value to set. - * @return the ListBlobsFlatResponse object itself. + * @return the ListBlobsFlatSegmentResponse object itself. */ - public ListBlobsFlatResponse withMaxResults(int maxResults) { + public ListBlobsFlatSegmentResponse withMaxResults(int maxResults) { this.maxResults = maxResults; return this; } @@ -180,30 +180,30 @@ public String delimiter() { * Set the delimiter value. * * @param delimiter the delimiter value to set. - * @return the ListBlobsFlatResponse object itself. + * @return the ListBlobsFlatSegmentResponse object itself. */ - public ListBlobsFlatResponse withDelimiter(String delimiter) { + public ListBlobsFlatSegmentResponse withDelimiter(String delimiter) { this.delimiter = delimiter; return this; } /** - * Get the blobs value. + * Get the segment value. * - * @return the blobs value. + * @return the segment value. */ - public BlobFlatList blobs() { - return this.blobs; + public BlobFlatListSegment segment() { + return this.segment; } /** - * Set the blobs value. + * Set the segment value. * - * @param blobs the blobs value to set. - * @return the ListBlobsFlatResponse object itself. + * @param segment the segment value to set. + * @return the ListBlobsFlatSegmentResponse object itself. */ - public ListBlobsFlatResponse withBlobs(BlobFlatList blobs) { - this.blobs = blobs; + public ListBlobsFlatSegmentResponse withSegment(BlobFlatListSegment segment) { + this.segment = segment; return this; } @@ -220,9 +220,9 @@ public String nextMarker() { * Set the nextMarker value. * * @param nextMarker the nextMarker value to set. - * @return the ListBlobsFlatResponse object itself. + * @return the ListBlobsFlatSegmentResponse object itself. */ - public ListBlobsFlatResponse withNextMarker(String nextMarker) { + public ListBlobsFlatSegmentResponse withNextMarker(String nextMarker) { this.nextMarker = nextMarker; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsHierarchyResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsHierarchySegmentResponse.java similarity index 72% rename from src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsHierarchyResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsHierarchySegmentResponse.java index 59bd09e98..12ba3f950 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsHierarchyResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ListBlobsHierarchySegmentResponse.java @@ -18,7 +18,7 @@ * An enumeration of blobs. */ @JacksonXmlRootElement(localName = "EnumerationResults") -public final class ListBlobsHierarchyResponse { +public final class ListBlobsHierarchySegmentResponse { /** * The serviceEndpoint property. */ @@ -56,10 +56,10 @@ public final class ListBlobsHierarchyResponse { private String delimiter; /** - * The blobs property. + * The segment property. */ @JsonProperty(value = "Blobs", required = true) - private BlobHierarchyList blobs; + private BlobHierarchyListSegment segment; /** * The nextMarker property. @@ -80,9 +80,9 @@ public String serviceEndpoint() { * Set the serviceEndpoint value. * * @param serviceEndpoint the serviceEndpoint value to set. - * @return the ListBlobsHierarchyResponse object itself. + * @return the ListBlobsHierarchySegmentResponse object itself. */ - public ListBlobsHierarchyResponse withServiceEndpoint(String serviceEndpoint) { + public ListBlobsHierarchySegmentResponse withServiceEndpoint(String serviceEndpoint) { this.serviceEndpoint = serviceEndpoint; return this; } @@ -100,9 +100,9 @@ public String containerName() { * Set the containerName value. * * @param containerName the containerName value to set. - * @return the ListBlobsHierarchyResponse object itself. + * @return the ListBlobsHierarchySegmentResponse object itself. */ - public ListBlobsHierarchyResponse withContainerName(String containerName) { + public ListBlobsHierarchySegmentResponse withContainerName(String containerName) { this.containerName = containerName; return this; } @@ -120,9 +120,9 @@ public String prefix() { * Set the prefix value. * * @param prefix the prefix value to set. - * @return the ListBlobsHierarchyResponse object itself. + * @return the ListBlobsHierarchySegmentResponse object itself. */ - public ListBlobsHierarchyResponse withPrefix(String prefix) { + public ListBlobsHierarchySegmentResponse withPrefix(String prefix) { this.prefix = prefix; return this; } @@ -140,9 +140,9 @@ public String marker() { * Set the marker value. * * @param marker the marker value to set. - * @return the ListBlobsHierarchyResponse object itself. + * @return the ListBlobsHierarchySegmentResponse object itself. */ - public ListBlobsHierarchyResponse withMarker(String marker) { + public ListBlobsHierarchySegmentResponse withMarker(String marker) { this.marker = marker; return this; } @@ -160,9 +160,9 @@ public int maxResults() { * Set the maxResults value. * * @param maxResults the maxResults value to set. - * @return the ListBlobsHierarchyResponse object itself. + * @return the ListBlobsHierarchySegmentResponse object itself. */ - public ListBlobsHierarchyResponse withMaxResults(int maxResults) { + public ListBlobsHierarchySegmentResponse withMaxResults(int maxResults) { this.maxResults = maxResults; return this; } @@ -180,30 +180,30 @@ public String delimiter() { * Set the delimiter value. * * @param delimiter the delimiter value to set. - * @return the ListBlobsHierarchyResponse object itself. + * @return the ListBlobsHierarchySegmentResponse object itself. */ - public ListBlobsHierarchyResponse withDelimiter(String delimiter) { + public ListBlobsHierarchySegmentResponse withDelimiter(String delimiter) { this.delimiter = delimiter; return this; } /** - * Get the blobs value. + * Get the segment value. * - * @return the blobs value. + * @return the segment value. */ - public BlobHierarchyList blobs() { - return this.blobs; + public BlobHierarchyListSegment segment() { + return this.segment; } /** - * Set the blobs value. + * Set the segment value. * - * @param blobs the blobs value to set. - * @return the ListBlobsHierarchyResponse object itself. + * @param segment the segment value to set. + * @return the ListBlobsHierarchySegmentResponse object itself. */ - public ListBlobsHierarchyResponse withBlobs(BlobHierarchyList blobs) { - this.blobs = blobs; + public ListBlobsHierarchySegmentResponse withSegment(BlobHierarchyListSegment segment) { + this.segment = segment; return this; } @@ -220,9 +220,9 @@ public String nextMarker() { * Set the nextMarker value. * * @param nextMarker the nextMarker value to set. - * @return the ListBlobsHierarchyResponse object itself. + * @return the ListBlobsHierarchySegmentResponse object itself. */ - public ListBlobsHierarchyResponse withNextMarker(String nextMarker) { + public ListBlobsHierarchySegmentResponse withNextMarker(String nextMarker) { this.nextMarker = nextMarker; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ListContainersResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ListContainersSegmentResponse.java similarity index 69% rename from src/main/java/com/microsoft/azure/storage/blob/models/ListContainersResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/ListContainersSegmentResponse.java index 591ad56fb..4bce395b5 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ListContainersResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ListContainersSegmentResponse.java @@ -21,7 +21,7 @@ * An enumeration of containers. */ @JacksonXmlRootElement(localName = "EnumerationResults") -public final class ListContainersResponse { +public final class ListContainersSegmentResponse { /** * The serviceEndpoint property. */ @@ -48,19 +48,19 @@ public final class ListContainersResponse { private static final class ContainersWrapper { @JacksonXmlProperty(localName = "Container") - private final List items; + private final List items; @JsonCreator - private ContainersWrapper(@JacksonXmlProperty(localName = "Container") List items) { + private ContainersWrapper(@JacksonXmlProperty(localName = "Container") List items) { this.items = items; } } /** - * The containers property. + * The containerItems property. */ @JsonProperty(value = "Containers") - private ContainersWrapper containers; + private ContainersWrapper containerItems; /** * The nextMarker property. @@ -81,9 +81,9 @@ public String serviceEndpoint() { * Set the serviceEndpoint value. * * @param serviceEndpoint the serviceEndpoint value to set. - * @return the ListContainersResponse object itself. + * @return the ListContainersSegmentResponse object itself. */ - public ListContainersResponse withServiceEndpoint(String serviceEndpoint) { + public ListContainersSegmentResponse withServiceEndpoint(String serviceEndpoint) { this.serviceEndpoint = serviceEndpoint; return this; } @@ -101,9 +101,9 @@ public String prefix() { * Set the prefix value. * * @param prefix the prefix value to set. - * @return the ListContainersResponse object itself. + * @return the ListContainersSegmentResponse object itself. */ - public ListContainersResponse withPrefix(String prefix) { + public ListContainersSegmentResponse withPrefix(String prefix) { this.prefix = prefix; return this; } @@ -121,9 +121,9 @@ public String marker() { * Set the marker value. * * @param marker the marker value to set. - * @return the ListContainersResponse object itself. + * @return the ListContainersSegmentResponse object itself. */ - public ListContainersResponse withMarker(String marker) { + public ListContainersSegmentResponse withMarker(String marker) { this.marker = marker; return this; } @@ -141,33 +141,33 @@ public int maxResults() { * Set the maxResults value. * * @param maxResults the maxResults value to set. - * @return the ListContainersResponse object itself. + * @return the ListContainersSegmentResponse object itself. */ - public ListContainersResponse withMaxResults(int maxResults) { + public ListContainersSegmentResponse withMaxResults(int maxResults) { this.maxResults = maxResults; return this; } /** - * Get the containers value. + * Get the containerItems value. * - * @return the containers value. + * @return the containerItems value. */ - public List containers() { - if (this.containers == null) { - this.containers = new ContainersWrapper(new ArrayList()); + public List containerItems() { + if (this.containerItems == null) { + this.containerItems = new ContainersWrapper(new ArrayList()); } - return this.containers.items; + return this.containerItems.items; } /** - * Set the containers value. + * Set the containerItems value. * - * @param containers the containers value to set. - * @return the ListContainersResponse object itself. + * @param containerItems the containerItems value to set. + * @return the ListContainersSegmentResponse object itself. */ - public ListContainersResponse withContainers(List containers) { - this.containers = new ContainersWrapper(containers); + public ListContainersSegmentResponse withContainerItems(List containerItems) { + this.containerItems = new ContainersWrapper(containerItems); return this; } @@ -184,9 +184,9 @@ public String nextMarker() { * Set the nextMarker value. * * @param nextMarker the nextMarker value to set. - * @return the ListContainersResponse object itself. + * @return the ListContainersSegmentResponse object itself. */ - public ListContainersResponse withNextMarker(String nextMarker) { + public ListContainersSegmentResponse withNextMarker(String nextMarker) { this.nextMarker = nextMarker; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/Metrics.java b/src/main/java/com/microsoft/azure/storage/blob/models/Metrics.java index 7e709fbd6..4b18484e6 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/Metrics.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/Metrics.java @@ -15,7 +15,8 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; /** - * The Metrics model. + * a summary of request statistics grouped by API in hour or minute aggregates + * for blobs. */ @JacksonXmlRootElement(localName = "Metrics") public final class Metrics { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsClearPagesHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobClearPagesHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsClearPagesHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobClearPagesHeaders.java index cc1a70d92..aa3b0e7ef 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsClearPagesHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobClearPagesHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for ClearPages operation. */ -@JacksonXmlRootElement(localName = "PageBlobs-ClearPages-Headers") -public final class PageBlobsClearPagesHeaders { +@JacksonXmlRootElement(localName = "PageBlob-ClearPages-Headers") +public final class PageBlobClearPagesHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -86,9 +86,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the PageBlobsClearPagesHeaders object itself. + * @return the PageBlobClearPagesHeaders object itself. */ - public PageBlobsClearPagesHeaders withETag(String eTag) { + public PageBlobClearPagesHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -109,9 +109,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the PageBlobsClearPagesHeaders object itself. + * @return the PageBlobClearPagesHeaders object itself. */ - public PageBlobsClearPagesHeaders withLastModified(OffsetDateTime lastModified) { + public PageBlobClearPagesHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -133,9 +133,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the PageBlobsClearPagesHeaders object itself. + * @return the PageBlobClearPagesHeaders object itself. */ - public PageBlobsClearPagesHeaders withContentMD5(byte[] contentMD5) { + public PageBlobClearPagesHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -153,9 +153,9 @@ public Long blobSequenceNumber() { * Set the blobSequenceNumber value. * * @param blobSequenceNumber the blobSequenceNumber value to set. - * @return the PageBlobsClearPagesHeaders object itself. + * @return the PageBlobClearPagesHeaders object itself. */ - public PageBlobsClearPagesHeaders withBlobSequenceNumber(Long blobSequenceNumber) { + public PageBlobClearPagesHeaders withBlobSequenceNumber(Long blobSequenceNumber) { this.blobSequenceNumber = blobSequenceNumber; return this; } @@ -173,9 +173,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the PageBlobsClearPagesHeaders object itself. + * @return the PageBlobClearPagesHeaders object itself. */ - public PageBlobsClearPagesHeaders withRequestId(String requestId) { + public PageBlobClearPagesHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -193,9 +193,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the PageBlobsClearPagesHeaders object itself. + * @return the PageBlobClearPagesHeaders object itself. */ - public PageBlobsClearPagesHeaders withVersion(String version) { + public PageBlobClearPagesHeaders withVersion(String version) { this.version = version; return this; } @@ -216,9 +216,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the PageBlobsClearPagesHeaders object itself. + * @return the PageBlobClearPagesHeaders object itself. */ - public PageBlobsClearPagesHeaders withDate(OffsetDateTime date) { + public PageBlobClearPagesHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsClearPagesResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobClearPagesResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsClearPagesResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobClearPagesResponse.java index 3c09c3eba..99f7fe8bd 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsClearPagesResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobClearPagesResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the clearPages operation. */ -public final class PageBlobsClearPagesResponse extends RestResponse { +public final class PageBlobClearPagesResponse extends RestResponse { /** - * Creates an instance of PageBlobsClearPagesResponse. + * Creates an instance of PageBlobClearPagesResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public PageBlobsClearPagesResponse(int statusCode, PageBlobsClearPagesHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public PageBlobClearPagesResponse(HttpRequest request, int statusCode, PageBlobClearPagesHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public PageBlobsClearPagesHeaders headers() { + public PageBlobClearPagesHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCopyIncrementalHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCopyIncrementalHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCopyIncrementalHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCopyIncrementalHeaders.java index b797016dc..7221d1a80 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCopyIncrementalHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCopyIncrementalHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for CopyIncremental operation. */ -@JacksonXmlRootElement(localName = "PageBlobs-CopyIncremental-Headers") -public final class PageBlobsCopyIncrementalHeaders { +@JacksonXmlRootElement(localName = "PageBlob-CopyIncremental-Headers") +public final class PageBlobCopyIncrementalHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -87,9 +87,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the PageBlobsCopyIncrementalHeaders object itself. + * @return the PageBlobCopyIncrementalHeaders object itself. */ - public PageBlobsCopyIncrementalHeaders withETag(String eTag) { + public PageBlobCopyIncrementalHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -110,9 +110,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the PageBlobsCopyIncrementalHeaders object itself. + * @return the PageBlobCopyIncrementalHeaders object itself. */ - public PageBlobsCopyIncrementalHeaders withLastModified(OffsetDateTime lastModified) { + public PageBlobCopyIncrementalHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -134,9 +134,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the PageBlobsCopyIncrementalHeaders object itself. + * @return the PageBlobCopyIncrementalHeaders object itself. */ - public PageBlobsCopyIncrementalHeaders withRequestId(String requestId) { + public PageBlobCopyIncrementalHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -154,9 +154,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the PageBlobsCopyIncrementalHeaders object itself. + * @return the PageBlobCopyIncrementalHeaders object itself. */ - public PageBlobsCopyIncrementalHeaders withVersion(String version) { + public PageBlobCopyIncrementalHeaders withVersion(String version) { this.version = version; return this; } @@ -177,9 +177,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the PageBlobsCopyIncrementalHeaders object itself. + * @return the PageBlobCopyIncrementalHeaders object itself. */ - public PageBlobsCopyIncrementalHeaders withDate(OffsetDateTime date) { + public PageBlobCopyIncrementalHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -201,9 +201,9 @@ public String copyId() { * Set the copyId value. * * @param copyId the copyId value to set. - * @return the PageBlobsCopyIncrementalHeaders object itself. + * @return the PageBlobCopyIncrementalHeaders object itself. */ - public PageBlobsCopyIncrementalHeaders withCopyId(String copyId) { + public PageBlobCopyIncrementalHeaders withCopyId(String copyId) { this.copyId = copyId; return this; } @@ -221,9 +221,9 @@ public CopyStatusType copyStatus() { * Set the copyStatus value. * * @param copyStatus the copyStatus value to set. - * @return the PageBlobsCopyIncrementalHeaders object itself. + * @return the PageBlobCopyIncrementalHeaders object itself. */ - public PageBlobsCopyIncrementalHeaders withCopyStatus(CopyStatusType copyStatus) { + public PageBlobCopyIncrementalHeaders withCopyStatus(CopyStatusType copyStatus) { this.copyStatus = copyStatus; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCopyIncrementalResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCopyIncrementalResponse.java similarity index 61% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCopyIncrementalResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCopyIncrementalResponse.java index 9dbdd92eb..077a46665 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsCopyIncrementalResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCopyIncrementalResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the copyIncremental operation. */ -public final class PageBlobsCopyIncrementalResponse extends RestResponse { +public final class PageBlobCopyIncrementalResponse extends RestResponse { /** - * Creates an instance of PageBlobsCopyIncrementalResponse. + * Creates an instance of PageBlobCopyIncrementalResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public PageBlobsCopyIncrementalResponse(int statusCode, PageBlobsCopyIncrementalHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public PageBlobCopyIncrementalResponse(HttpRequest request, int statusCode, PageBlobCopyIncrementalHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public PageBlobsCopyIncrementalHeaders headers() { + public PageBlobCopyIncrementalHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsCreateHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCreateHeaders.java similarity index 83% rename from src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsCreateHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCreateHeaders.java index e2771bd36..099fde09a 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/AppendBlobsCreateHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCreateHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for Create operation. */ -@JacksonXmlRootElement(localName = "AppendBlobs-Create-Headers") -public final class AppendBlobsCreateHeaders { +@JacksonXmlRootElement(localName = "PageBlob-Create-Headers") +public final class PageBlobCreateHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -88,9 +88,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the AppendBlobsCreateHeaders object itself. + * @return the PageBlobCreateHeaders object itself. */ - public AppendBlobsCreateHeaders withETag(String eTag) { + public PageBlobCreateHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -111,9 +111,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the AppendBlobsCreateHeaders object itself. + * @return the PageBlobCreateHeaders object itself. */ - public AppendBlobsCreateHeaders withLastModified(OffsetDateTime lastModified) { + public PageBlobCreateHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -135,9 +135,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the AppendBlobsCreateHeaders object itself. + * @return the PageBlobCreateHeaders object itself. */ - public AppendBlobsCreateHeaders withContentMD5(byte[] contentMD5) { + public PageBlobCreateHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -155,9 +155,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the AppendBlobsCreateHeaders object itself. + * @return the PageBlobCreateHeaders object itself. */ - public AppendBlobsCreateHeaders withRequestId(String requestId) { + public PageBlobCreateHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -175,9 +175,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the AppendBlobsCreateHeaders object itself. + * @return the PageBlobCreateHeaders object itself. */ - public AppendBlobsCreateHeaders withVersion(String version) { + public PageBlobCreateHeaders withVersion(String version) { this.version = version; return this; } @@ -198,9 +198,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the AppendBlobsCreateHeaders object itself. + * @return the PageBlobCreateHeaders object itself. */ - public AppendBlobsCreateHeaders withDate(OffsetDateTime date) { + public PageBlobCreateHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -222,9 +222,9 @@ public Boolean isServerEncrypted() { * Set the isServerEncrypted value. * * @param isServerEncrypted the isServerEncrypted value to set. - * @return the AppendBlobsCreateHeaders object itself. + * @return the PageBlobCreateHeaders object itself. */ - public AppendBlobsCreateHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + public PageBlobCreateHeaders withIsServerEncrypted(Boolean isServerEncrypted) { this.isServerEncrypted = isServerEncrypted; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersCreateResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCreateResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/ContainersCreateResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCreateResponse.java index 025abaf36..b18a74841 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ContainersCreateResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobCreateResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the create operation. */ -public final class ContainersCreateResponse extends RestResponse { +public final class PageBlobCreateResponse extends RestResponse { /** - * Creates an instance of ContainersCreateResponse. + * Creates an instance of PageBlobCreateResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ContainersCreateResponse(int statusCode, ContainersCreateHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public PageBlobCreateResponse(HttpRequest request, int statusCode, PageBlobCreateHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public ContainersCreateHeaders headers() { + public PageBlobCreateHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesDiffHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesDiffHeaders.java similarity index 81% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesDiffHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesDiffHeaders.java index 6f9722add..a3d098737 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesDiffHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesDiffHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for GetPageRangesDiff operation. */ -@JacksonXmlRootElement(localName = "PageBlobs-GetPageRangesDiff-Headers") -public final class PageBlobsGetPageRangesDiffHeaders { +@JacksonXmlRootElement(localName = "PageBlob-GetPageRangesDiff-Headers") +public final class PageBlobGetPageRangesDiffHeaders { /** * Returns the date and time the container was last modified. Any operation * that modifies the blob, including an update of the blob's metadata or @@ -81,9 +81,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the PageBlobsGetPageRangesDiffHeaders object itself. + * @return the PageBlobGetPageRangesDiffHeaders object itself. */ - public PageBlobsGetPageRangesDiffHeaders withLastModified(OffsetDateTime lastModified) { + public PageBlobGetPageRangesDiffHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -105,9 +105,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the PageBlobsGetPageRangesDiffHeaders object itself. + * @return the PageBlobGetPageRangesDiffHeaders object itself. */ - public PageBlobsGetPageRangesDiffHeaders withETag(String eTag) { + public PageBlobGetPageRangesDiffHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -125,9 +125,9 @@ public Long blobContentLength() { * Set the blobContentLength value. * * @param blobContentLength the blobContentLength value to set. - * @return the PageBlobsGetPageRangesDiffHeaders object itself. + * @return the PageBlobGetPageRangesDiffHeaders object itself. */ - public PageBlobsGetPageRangesDiffHeaders withBlobContentLength(Long blobContentLength) { + public PageBlobGetPageRangesDiffHeaders withBlobContentLength(Long blobContentLength) { this.blobContentLength = blobContentLength; return this; } @@ -145,9 +145,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the PageBlobsGetPageRangesDiffHeaders object itself. + * @return the PageBlobGetPageRangesDiffHeaders object itself. */ - public PageBlobsGetPageRangesDiffHeaders withRequestId(String requestId) { + public PageBlobGetPageRangesDiffHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the PageBlobsGetPageRangesDiffHeaders object itself. + * @return the PageBlobGetPageRangesDiffHeaders object itself. */ - public PageBlobsGetPageRangesDiffHeaders withVersion(String version) { + public PageBlobGetPageRangesDiffHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the PageBlobsGetPageRangesDiffHeaders object itself. + * @return the PageBlobGetPageRangesDiffHeaders object itself. */ - public PageBlobsGetPageRangesDiffHeaders withDate(OffsetDateTime date) { + public PageBlobGetPageRangesDiffHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesDiffResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesDiffResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesDiffResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesDiffResponse.java index fad0f40d1..28d4ed76a 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesDiffResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesDiffResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the getPageRangesDiff operation. */ -public final class PageBlobsGetPageRangesDiffResponse extends RestResponse { +public final class PageBlobGetPageRangesDiffResponse extends RestResponse { /** - * Creates an instance of PageBlobsGetPageRangesDiffResponse. + * Creates an instance of PageBlobGetPageRangesDiffResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public PageBlobsGetPageRangesDiffResponse(int statusCode, PageBlobsGetPageRangesDiffHeaders headers, Map rawHeaders, PageList body) { - super(statusCode, headers, rawHeaders, body); + public PageBlobGetPageRangesDiffResponse(HttpRequest request, int statusCode, PageBlobGetPageRangesDiffHeaders headers, Map rawHeaders, PageList body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public PageBlobsGetPageRangesDiffHeaders headers() { + public PageBlobGetPageRangesDiffHeaders headers() { return super.headers(); } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesHeaders.java index e9072317c..32860d379 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for GetPageRanges operation. */ -@JacksonXmlRootElement(localName = "PageBlobs-GetPageRanges-Headers") -public final class PageBlobsGetPageRangesHeaders { +@JacksonXmlRootElement(localName = "PageBlob-GetPageRanges-Headers") +public final class PageBlobGetPageRangesHeaders { /** * Returns the date and time the container was last modified. Any operation * that modifies the blob, including an update of the blob's metadata or @@ -81,9 +81,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the PageBlobsGetPageRangesHeaders object itself. + * @return the PageBlobGetPageRangesHeaders object itself. */ - public PageBlobsGetPageRangesHeaders withLastModified(OffsetDateTime lastModified) { + public PageBlobGetPageRangesHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -105,9 +105,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the PageBlobsGetPageRangesHeaders object itself. + * @return the PageBlobGetPageRangesHeaders object itself. */ - public PageBlobsGetPageRangesHeaders withETag(String eTag) { + public PageBlobGetPageRangesHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -125,9 +125,9 @@ public Long blobContentLength() { * Set the blobContentLength value. * * @param blobContentLength the blobContentLength value to set. - * @return the PageBlobsGetPageRangesHeaders object itself. + * @return the PageBlobGetPageRangesHeaders object itself. */ - public PageBlobsGetPageRangesHeaders withBlobContentLength(Long blobContentLength) { + public PageBlobGetPageRangesHeaders withBlobContentLength(Long blobContentLength) { this.blobContentLength = blobContentLength; return this; } @@ -145,9 +145,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the PageBlobsGetPageRangesHeaders object itself. + * @return the PageBlobGetPageRangesHeaders object itself. */ - public PageBlobsGetPageRangesHeaders withRequestId(String requestId) { + public PageBlobGetPageRangesHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -165,9 +165,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the PageBlobsGetPageRangesHeaders object itself. + * @return the PageBlobGetPageRangesHeaders object itself. */ - public PageBlobsGetPageRangesHeaders withVersion(String version) { + public PageBlobGetPageRangesHeaders withVersion(String version) { this.version = version; return this; } @@ -188,9 +188,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the PageBlobsGetPageRangesHeaders object itself. + * @return the PageBlobGetPageRangesHeaders object itself. */ - public PageBlobsGetPageRangesHeaders withDate(OffsetDateTime date) { + public PageBlobGetPageRangesHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesResponse.java similarity index 64% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesResponse.java index c4633b95b..4ca391ed0 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsGetPageRangesResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobGetPageRangesResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the getPageRanges operation. */ -public final class PageBlobsGetPageRangesResponse extends RestResponse { +public final class PageBlobGetPageRangesResponse extends RestResponse { /** - * Creates an instance of PageBlobsGetPageRangesResponse. + * Creates an instance of PageBlobGetPageRangesResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public PageBlobsGetPageRangesResponse(int statusCode, PageBlobsGetPageRangesHeaders headers, Map rawHeaders, PageList body) { - super(statusCode, headers, rawHeaders, body); + public PageBlobGetPageRangesResponse(HttpRequest request, int statusCode, PageBlobGetPageRangesHeaders headers, Map rawHeaders, PageList body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public PageBlobsGetPageRangesHeaders headers() { + public PageBlobGetPageRangesHeaders headers() { return super.headers(); } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsResizeHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobResizeHeaders.java similarity index 84% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsResizeHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobResizeHeaders.java index c2b504615..bdbca9d22 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsResizeHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobResizeHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for Resize operation. */ -@JacksonXmlRootElement(localName = "PageBlobs-Resize-Headers") -public final class PageBlobsResizeHeaders { +@JacksonXmlRootElement(localName = "PageBlob-Resize-Headers") +public final class PageBlobResizeHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -79,9 +79,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the PageBlobsResizeHeaders object itself. + * @return the PageBlobResizeHeaders object itself. */ - public PageBlobsResizeHeaders withETag(String eTag) { + public PageBlobResizeHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -102,9 +102,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the PageBlobsResizeHeaders object itself. + * @return the PageBlobResizeHeaders object itself. */ - public PageBlobsResizeHeaders withLastModified(OffsetDateTime lastModified) { + public PageBlobResizeHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -126,9 +126,9 @@ public Long blobSequenceNumber() { * Set the blobSequenceNumber value. * * @param blobSequenceNumber the blobSequenceNumber value to set. - * @return the PageBlobsResizeHeaders object itself. + * @return the PageBlobResizeHeaders object itself. */ - public PageBlobsResizeHeaders withBlobSequenceNumber(Long blobSequenceNumber) { + public PageBlobResizeHeaders withBlobSequenceNumber(Long blobSequenceNumber) { this.blobSequenceNumber = blobSequenceNumber; return this; } @@ -146,9 +146,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the PageBlobsResizeHeaders object itself. + * @return the PageBlobResizeHeaders object itself. */ - public PageBlobsResizeHeaders withRequestId(String requestId) { + public PageBlobResizeHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -166,9 +166,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the PageBlobsResizeHeaders object itself. + * @return the PageBlobResizeHeaders object itself. */ - public PageBlobsResizeHeaders withVersion(String version) { + public PageBlobResizeHeaders withVersion(String version) { this.version = version; return this; } @@ -189,9 +189,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the PageBlobsResizeHeaders object itself. + * @return the PageBlobResizeHeaders object itself. */ - public PageBlobsResizeHeaders withDate(OffsetDateTime date) { + public PageBlobResizeHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsResizeResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobResizeResponse.java similarity index 63% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsResizeResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobResizeResponse.java index 750822ee9..3de49146b 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsResizeResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobResizeResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the resize operation. */ -public final class PageBlobsResizeResponse extends RestResponse { +public final class PageBlobResizeResponse extends RestResponse { /** - * Creates an instance of PageBlobsResizeResponse. + * Creates an instance of PageBlobResizeResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public PageBlobsResizeResponse(int statusCode, PageBlobsResizeHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public PageBlobResizeResponse(HttpRequest request, int statusCode, PageBlobResizeHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public PageBlobsResizeHeaders headers() { + public PageBlobResizeHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUpdateSequenceNumberHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUpdateSequenceNumberHeaders.java similarity index 81% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUpdateSequenceNumberHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUpdateSequenceNumberHeaders.java index 9dc408f1c..e2b73c9a1 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUpdateSequenceNumberHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUpdateSequenceNumberHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for UpdateSequenceNumber operation. */ -@JacksonXmlRootElement(localName = "PageBlobs-UpdateSequenceNumber-Headers") -public final class PageBlobsUpdateSequenceNumberHeaders { +@JacksonXmlRootElement(localName = "PageBlob-UpdateSequenceNumber-Headers") +public final class PageBlobUpdateSequenceNumberHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -79,9 +79,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the PageBlobsUpdateSequenceNumberHeaders object itself. + * @return the PageBlobUpdateSequenceNumberHeaders object itself. */ - public PageBlobsUpdateSequenceNumberHeaders withETag(String eTag) { + public PageBlobUpdateSequenceNumberHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -102,9 +102,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the PageBlobsUpdateSequenceNumberHeaders object itself. + * @return the PageBlobUpdateSequenceNumberHeaders object itself. */ - public PageBlobsUpdateSequenceNumberHeaders withLastModified(OffsetDateTime lastModified) { + public PageBlobUpdateSequenceNumberHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -126,9 +126,9 @@ public Long blobSequenceNumber() { * Set the blobSequenceNumber value. * * @param blobSequenceNumber the blobSequenceNumber value to set. - * @return the PageBlobsUpdateSequenceNumberHeaders object itself. + * @return the PageBlobUpdateSequenceNumberHeaders object itself. */ - public PageBlobsUpdateSequenceNumberHeaders withBlobSequenceNumber(Long blobSequenceNumber) { + public PageBlobUpdateSequenceNumberHeaders withBlobSequenceNumber(Long blobSequenceNumber) { this.blobSequenceNumber = blobSequenceNumber; return this; } @@ -146,9 +146,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the PageBlobsUpdateSequenceNumberHeaders object itself. + * @return the PageBlobUpdateSequenceNumberHeaders object itself. */ - public PageBlobsUpdateSequenceNumberHeaders withRequestId(String requestId) { + public PageBlobUpdateSequenceNumberHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -166,9 +166,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the PageBlobsUpdateSequenceNumberHeaders object itself. + * @return the PageBlobUpdateSequenceNumberHeaders object itself. */ - public PageBlobsUpdateSequenceNumberHeaders withVersion(String version) { + public PageBlobUpdateSequenceNumberHeaders withVersion(String version) { this.version = version; return this; } @@ -189,9 +189,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the PageBlobsUpdateSequenceNumberHeaders object itself. + * @return the PageBlobUpdateSequenceNumberHeaders object itself. */ - public PageBlobsUpdateSequenceNumberHeaders withDate(OffsetDateTime date) { + public PageBlobUpdateSequenceNumberHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUpdateSequenceNumberResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUpdateSequenceNumberResponse.java similarity index 60% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUpdateSequenceNumberResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUpdateSequenceNumberResponse.java index f52135aef..637404963 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUpdateSequenceNumberResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUpdateSequenceNumberResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the updateSequenceNumber operation. */ -public final class PageBlobsUpdateSequenceNumberResponse extends RestResponse { +public final class PageBlobUpdateSequenceNumberResponse extends RestResponse { /** - * Creates an instance of PageBlobsUpdateSequenceNumberResponse. + * Creates an instance of PageBlobUpdateSequenceNumberResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public PageBlobsUpdateSequenceNumberResponse(int statusCode, PageBlobsUpdateSequenceNumberHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public PageBlobUpdateSequenceNumberResponse(HttpRequest request, int statusCode, PageBlobUpdateSequenceNumberHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public PageBlobsUpdateSequenceNumberHeaders headers() { + public PageBlobUpdateSequenceNumberHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUploadPagesHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUploadPagesHeaders.java similarity index 82% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUploadPagesHeaders.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUploadPagesHeaders.java index af6075fe6..090cb6172 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUploadPagesHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUploadPagesHeaders.java @@ -19,8 +19,8 @@ /** * Defines headers for UploadPages operation. */ -@JacksonXmlRootElement(localName = "PageBlobs-UploadPages-Headers") -public final class PageBlobsUploadPagesHeaders { +@JacksonXmlRootElement(localName = "PageBlob-UploadPages-Headers") +public final class PageBlobUploadPagesHeaders { /** * The ETag contains a value that you can use to perform operations * conditionally. If the request version is 2011-08-18 or newer, the ETag @@ -94,9 +94,9 @@ public String eTag() { * Set the eTag value. * * @param eTag the eTag value to set. - * @return the PageBlobsUploadPagesHeaders object itself. + * @return the PageBlobUploadPagesHeaders object itself. */ - public PageBlobsUploadPagesHeaders withETag(String eTag) { + public PageBlobUploadPagesHeaders withETag(String eTag) { this.eTag = eTag; return this; } @@ -117,9 +117,9 @@ public OffsetDateTime lastModified() { * Set the lastModified value. * * @param lastModified the lastModified value to set. - * @return the PageBlobsUploadPagesHeaders object itself. + * @return the PageBlobUploadPagesHeaders object itself. */ - public PageBlobsUploadPagesHeaders withLastModified(OffsetDateTime lastModified) { + public PageBlobUploadPagesHeaders withLastModified(OffsetDateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { @@ -141,9 +141,9 @@ public byte[] contentMD5() { * Set the contentMD5 value. * * @param contentMD5 the contentMD5 value to set. - * @return the PageBlobsUploadPagesHeaders object itself. + * @return the PageBlobUploadPagesHeaders object itself. */ - public PageBlobsUploadPagesHeaders withContentMD5(byte[] contentMD5) { + public PageBlobUploadPagesHeaders withContentMD5(byte[] contentMD5) { this.contentMD5 = contentMD5; return this; } @@ -161,9 +161,9 @@ public Long blobSequenceNumber() { * Set the blobSequenceNumber value. * * @param blobSequenceNumber the blobSequenceNumber value to set. - * @return the PageBlobsUploadPagesHeaders object itself. + * @return the PageBlobUploadPagesHeaders object itself. */ - public PageBlobsUploadPagesHeaders withBlobSequenceNumber(Long blobSequenceNumber) { + public PageBlobUploadPagesHeaders withBlobSequenceNumber(Long blobSequenceNumber) { this.blobSequenceNumber = blobSequenceNumber; return this; } @@ -181,9 +181,9 @@ public String requestId() { * Set the requestId value. * * @param requestId the requestId value to set. - * @return the PageBlobsUploadPagesHeaders object itself. + * @return the PageBlobUploadPagesHeaders object itself. */ - public PageBlobsUploadPagesHeaders withRequestId(String requestId) { + public PageBlobUploadPagesHeaders withRequestId(String requestId) { this.requestId = requestId; return this; } @@ -201,9 +201,9 @@ public String version() { * Set the version value. * * @param version the version value to set. - * @return the PageBlobsUploadPagesHeaders object itself. + * @return the PageBlobUploadPagesHeaders object itself. */ - public PageBlobsUploadPagesHeaders withVersion(String version) { + public PageBlobUploadPagesHeaders withVersion(String version) { this.version = version; return this; } @@ -224,9 +224,9 @@ public OffsetDateTime date() { * Set the date value. * * @param date the date value to set. - * @return the PageBlobsUploadPagesHeaders object itself. + * @return the PageBlobUploadPagesHeaders object itself. */ - public PageBlobsUploadPagesHeaders withDate(OffsetDateTime date) { + public PageBlobUploadPagesHeaders withDate(OffsetDateTime date) { if (date == null) { this.date = null; } else { @@ -248,9 +248,9 @@ public Boolean isServerEncrypted() { * Set the isServerEncrypted value. * * @param isServerEncrypted the isServerEncrypted value to set. - * @return the PageBlobsUploadPagesHeaders object itself. + * @return the PageBlobUploadPagesHeaders object itself. */ - public PageBlobsUploadPagesHeaders withIsServerEncrypted(Boolean isServerEncrypted) { + public PageBlobUploadPagesHeaders withIsServerEncrypted(Boolean isServerEncrypted) { this.isServerEncrypted = isServerEncrypted; return this; } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUploadPagesResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUploadPagesResponse.java similarity index 62% rename from src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUploadPagesResponse.java rename to src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUploadPagesResponse.java index 45a8c7a5b..d9184fc61 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobsUploadPagesResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/PageBlobUploadPagesResponse.java @@ -11,29 +11,31 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the uploadPages operation. */ -public final class PageBlobsUploadPagesResponse extends RestResponse { +public final class PageBlobUploadPagesResponse extends RestResponse { /** - * Creates an instance of PageBlobsUploadPagesResponse. + * Creates an instance of PageBlobUploadPagesResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public PageBlobsUploadPagesResponse(int statusCode, PageBlobsUploadPagesHeaders headers, Map rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public PageBlobUploadPagesResponse(HttpRequest request, int statusCode, PageBlobUploadPagesHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** * @return the deserialized response headers. */ @Override - public PageBlobsUploadPagesHeaders headers() { + public PageBlobUploadPagesHeaders headers() { return super.headers(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/RetentionPolicy.java b/src/main/java/com/microsoft/azure/storage/blob/models/RetentionPolicy.java index 337f8ded1..092a86bcc 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/RetentionPolicy.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/RetentionPolicy.java @@ -15,7 +15,8 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; /** - * the retention policy. + * the retention policy which determines how long the associated data should + * persist. */ @JacksonXmlRootElement(localName = "RetentionPolicy") public final class RetentionPolicy { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetAccountInfoHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetAccountInfoHeaders.java new file mode 100644 index 000000000..f552cf625 --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetAccountInfoHeaders.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.microsoft.rest.v2.DateTimeRfc1123; +import java.time.OffsetDateTime; + +/** + * Defines headers for GetAccountInfo operation. + */ +@JacksonXmlRootElement(localName = "Service-GetAccountInfo-Headers") +public final class ServiceGetAccountInfoHeaders { + /** + * This header uniquely identifies the request that was made and can be + * used for troubleshooting the request. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /** + * Indicates the version of the Blob service used to execute the request. + * This header is returned for requests made against version 2009-09-19 and + * above. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /** + * UTC date/time value generated by the service that indicates the time at + * which the response was initiated. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 date; + + /** + * Identifies the sku name of the account. Possible values include: + * 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', + * 'Premium_LRS'. + */ + @JsonProperty(value = "x-ms-sku-name") + private SkuName skuName; + + /** + * Identifies the account kind. Possible values include: 'Storage', + * 'BlobStorage', 'StorageV2'. + */ + @JsonProperty(value = "x-ms-account-kind") + private AccountKind accountKind; + + /** + * Get the requestId value. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId value. + * + * @param requestId the requestId value to set. + * @return the ServiceGetAccountInfoHeaders object itself. + */ + public ServiceGetAccountInfoHeaders withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version value. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version value. + * + * @param version the version value to set. + * @return the ServiceGetAccountInfoHeaders object itself. + */ + public ServiceGetAccountInfoHeaders withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the date value. + * + * @return the date value. + */ + public OffsetDateTime date() { + if (this.date == null) { + return null; + } + return this.date.dateTime(); + } + + /** + * Set the date value. + * + * @param date the date value to set. + * @return the ServiceGetAccountInfoHeaders object itself. + */ + public ServiceGetAccountInfoHeaders withDate(OffsetDateTime date) { + if (date == null) { + this.date = null; + } else { + this.date = new DateTimeRfc1123(date); + } + return this; + } + + /** + * Get the skuName value. + * + * @return the skuName value. + */ + public SkuName skuName() { + return this.skuName; + } + + /** + * Set the skuName value. + * + * @param skuName the skuName value to set. + * @return the ServiceGetAccountInfoHeaders object itself. + */ + public ServiceGetAccountInfoHeaders withSkuName(SkuName skuName) { + this.skuName = skuName; + return this; + } + + /** + * Get the accountKind value. + * + * @return the accountKind value. + */ + public AccountKind accountKind() { + return this.accountKind; + } + + /** + * Set the accountKind value. + * + * @param accountKind the accountKind value to set. + * @return the ServiceGetAccountInfoHeaders object itself. + */ + public ServiceGetAccountInfoHeaders withAccountKind(AccountKind accountKind) { + this.accountKind = accountKind; + return this; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetAccountInfoResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetAccountInfoResponse.java new file mode 100644 index 000000000..eb1ac1e60 --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetAccountInfoResponse.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; +import java.util.Map; + +/** + * Contains all response data for the getAccountInfo operation. + */ +public final class ServiceGetAccountInfoResponse extends RestResponse { + /** + * Creates an instance of ServiceGetAccountInfoResponse. + * + * @param request the request which resulted in this {response.Name}. + * @param statusCode the status code of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param body the deserialized body of the HTTP response. + */ + public ServiceGetAccountInfoResponse(HttpRequest request, int statusCode, ServiceGetAccountInfoHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); + } + + /** + * @return the deserialized response headers. + */ + @Override + public ServiceGetAccountInfoHeaders headers() { + return super.headers(); + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetPropertiesResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetPropertiesResponse.java index bbabf6237..cabb5217f 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetPropertiesResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetPropertiesResponse.java @@ -11,6 +11,7 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** @@ -20,13 +21,14 @@ public final class ServiceGetPropertiesResponse extends RestResponse rawHeaders, StorageServiceProperties body) { - super(statusCode, headers, rawHeaders, body); + public ServiceGetPropertiesResponse(HttpRequest request, int statusCode, ServiceGetPropertiesHeaders headers, Map rawHeaders, StorageServiceProperties body) { + super(request, statusCode, headers, rawHeaders, body); } /** diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetStatisticsResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetStatisticsResponse.java index ccfbd4d5c..34c3d7675 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetStatisticsResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetStatisticsResponse.java @@ -11,6 +11,7 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** @@ -20,13 +21,14 @@ public final class ServiceGetStatisticsResponse extends RestResponse rawHeaders, StorageServiceStats body) { - super(statusCode, headers, rawHeaders, body); + public ServiceGetStatisticsResponse(HttpRequest request, int statusCode, ServiceGetStatisticsHeaders headers, Map rawHeaders, StorageServiceStats body) { + super(request, statusCode, headers, rawHeaders, body); } /** diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceListContainersSegmentResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceListContainersSegmentResponse.java index ef1802001..0ead4cebd 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceListContainersSegmentResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceListContainersSegmentResponse.java @@ -11,22 +11,24 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** * Contains all response data for the listContainersSegment operation. */ -public final class ServiceListContainersSegmentResponse extends RestResponse { +public final class ServiceListContainersSegmentResponse extends RestResponse { /** * Creates an instance of ServiceListContainersSegmentResponse. * + * @param request the request which resulted in this {response.Name}. * @param statusCode the status code of the HTTP response. * @param headers the deserialized headers of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param body the deserialized body of the HTTP response. */ - public ServiceListContainersSegmentResponse(int statusCode, ServiceListContainersSegmentHeaders headers, Map rawHeaders, ListContainersResponse body) { - super(statusCode, headers, rawHeaders, body); + public ServiceListContainersSegmentResponse(HttpRequest request, int statusCode, ServiceListContainersSegmentHeaders headers, Map rawHeaders, ListContainersSegmentResponse body) { + super(request, statusCode, headers, rawHeaders, body); } /** @@ -41,7 +43,7 @@ public ServiceListContainersSegmentHeaders headers() { * @return the deserialized response body. */ @Override - public ListContainersResponse body() { + public ListContainersSegmentResponse body() { return super.body(); } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceSetPropertiesResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceSetPropertiesResponse.java index 0d49de16e..52fb3b2a3 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/ServiceSetPropertiesResponse.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/ServiceSetPropertiesResponse.java @@ -11,6 +11,7 @@ package com.microsoft.azure.storage.blob.models; import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; import java.util.Map; /** @@ -20,13 +21,14 @@ public final class ServiceSetPropertiesResponse extends RestResponse rawHeaders, Void body) { - super(statusCode, headers, rawHeaders, body); + public ServiceSetPropertiesResponse(HttpRequest request, int statusCode, ServiceSetPropertiesHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); } /** diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/SignedIdentifier.java b/src/main/java/com/microsoft/azure/storage/blob/models/SignedIdentifier.java index b59f058d3..6ef42d41a 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/SignedIdentifier.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/SignedIdentifier.java @@ -26,7 +26,7 @@ public final class SignedIdentifier { private String id; /** - * The access policy. + * The accessPolicy property. */ @JsonProperty(value = "AccessPolicy", required = true) private AccessPolicy accessPolicy; diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/SkuName.java b/src/main/java/com/microsoft/azure/storage/blob/models/SkuName.java new file mode 100644 index 000000000..468e579a6 --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/SkuName.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuName. + */ +public enum SkuName { + /** + * Enum value Standard_LRS. + */ + STANDARD_LRS("Standard_LRS"), + + /** + * Enum value Standard_GRS. + */ + STANDARD_GRS("Standard_GRS"), + + /** + * Enum value Standard_RAGRS. + */ + STANDARD_RAGRS("Standard_RAGRS"), + + /** + * Enum value Standard_ZRS. + */ + STANDARD_ZRS("Standard_ZRS"), + + /** + * Enum value Premium_LRS. + */ + PREMIUM_LRS("Premium_LRS"); + + /** + * The actual serialized value for a SkuName instance. + */ + private final String value; + + private SkuName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuName instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuName object, or null if unable to parse. + */ + @JsonCreator + public static SkuName fromString(String value) { + SkuName[] items = SkuName.values(); + for (SkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/StaticWebsite.java b/src/main/java/com/microsoft/azure/storage/blob/models/StaticWebsite.java new file mode 100644 index 000000000..dbda8afe3 --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/StaticWebsite.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * The properties that enable an account to host a static website. + */ +@JacksonXmlRootElement(localName = "StaticWebsite") +public final class StaticWebsite { + /** + * Indicates whether this account is hosting a static website. + */ + @JsonProperty(value = "Enabled", required = true) + private boolean enabled; + + /** + * The default name of the index page under each directory. + */ + @JsonProperty(value = "IndexDocument") + private String indexDocument; + + /** + * The absolute path of the custom 404 page. + */ + @JsonProperty(value = "ErrorDocument404Path") + private String errorDocument404Path; + + /** + * Get the enabled value. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled value. + * + * @param enabled the enabled value to set. + * @return the StaticWebsite object itself. + */ + public StaticWebsite withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the indexDocument value. + * + * @return the indexDocument value. + */ + public String indexDocument() { + return this.indexDocument; + } + + /** + * Set the indexDocument value. + * + * @param indexDocument the indexDocument value to set. + * @return the StaticWebsite object itself. + */ + public StaticWebsite withIndexDocument(String indexDocument) { + this.indexDocument = indexDocument; + return this; + } + + /** + * Get the errorDocument404Path value. + * + * @return the errorDocument404Path value. + */ + public String errorDocument404Path() { + return this.errorDocument404Path; + } + + /** + * Set the errorDocument404Path value. + * + * @param errorDocument404Path the errorDocument404Path value to set. + * @return the StaticWebsite object itself. + */ + public StaticWebsite withErrorDocument404Path(String errorDocument404Path) { + this.errorDocument404Path = errorDocument404Path; + return this; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/StorageServiceProperties.java b/src/main/java/com/microsoft/azure/storage/blob/models/StorageServiceProperties.java index 3ec7f3270..5b3467c7e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/StorageServiceProperties.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/StorageServiceProperties.java @@ -23,21 +23,19 @@ @JacksonXmlRootElement(localName = "StorageServiceProperties") public final class StorageServiceProperties { /** - * Azure Analytics Logging settings. + * The logging property. */ @JsonProperty(value = "Logging") private Logging logging; /** - * A summary of request statistics grouped by API in hourly aggregates for - * blobs. + * The hourMetrics property. */ @JsonProperty(value = "HourMetrics") private Metrics hourMetrics; /** - * a summary of request statistics grouped by API in minute aggregates for - * blobs. + * The minuteMetrics property. */ @JsonProperty(value = "MinuteMetrics") private Metrics minuteMetrics; @@ -67,11 +65,17 @@ private CorsWrapper(@JacksonXmlProperty(localName = "CorsRule") List i private String defaultServiceVersion; /** - * The Delete Retention Policy for the service. + * The deleteRetentionPolicy property. */ @JsonProperty(value = "DeleteRetentionPolicy") private RetentionPolicy deleteRetentionPolicy; + /** + * The staticWebsite property. + */ + @JsonProperty(value = "StaticWebsite") + private StaticWebsite staticWebsite; + /** * Get the logging value. * @@ -194,4 +198,24 @@ public StorageServiceProperties withDeleteRetentionPolicy(RetentionPolicy delete this.deleteRetentionPolicy = deleteRetentionPolicy; return this; } + + /** + * Get the staticWebsite value. + * + * @return the staticWebsite value. + */ + public StaticWebsite staticWebsite() { + return this.staticWebsite; + } + + /** + * Set the staticWebsite value. + * + * @param staticWebsite the staticWebsite value to set. + * @return the StorageServiceProperties object itself. + */ + public StorageServiceProperties withStaticWebsite(StaticWebsite staticWebsite) { + this.staticWebsite = staticWebsite; + return this; + } } diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/StorageServiceStats.java b/src/main/java/com/microsoft/azure/storage/blob/models/StorageServiceStats.java index f7ec70169..9b0800077 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/StorageServiceStats.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/StorageServiceStats.java @@ -20,7 +20,7 @@ @JacksonXmlRootElement(localName = "StorageServiceStats") public final class StorageServiceStats { /** - * Geo-Replication information for the Secondary Storage Service. + * The geoReplication property. */ @JsonProperty(value = "GeoReplication") private GeoReplication geoReplication; diff --git a/src/test/java/com/microsoft/azure/storage/APISpec.groovy b/src/test/java/com/microsoft/azure/storage/APISpec.groovy index 65fbcd6c3..20df29932 100644 --- a/src/test/java/com/microsoft/azure/storage/APISpec.groovy +++ b/src/test/java/com/microsoft/azure/storage/APISpec.groovy @@ -23,14 +23,17 @@ import com.microsoft.azure.storage.blob.PipelineOptions import com.microsoft.azure.storage.blob.ServiceURL import com.microsoft.azure.storage.blob.SharedKeyCredentials import com.microsoft.azure.storage.blob.StorageURL -import com.microsoft.azure.storage.blob.models.BlobsAcquireLeaseHeaders -import com.microsoft.azure.storage.blob.models.BlobsGetPropertiesHeaders -import com.microsoft.azure.storage.blob.models.BlobsStartCopyFromURLResponse -import com.microsoft.azure.storage.blob.models.Container -import com.microsoft.azure.storage.blob.models.ContainersAcquireLeaseHeaders -import com.microsoft.azure.storage.blob.models.ContainersGetPropertiesHeaders +import com.microsoft.azure.storage.blob.models.BlobAcquireLeaseHeaders +import com.microsoft.azure.storage.blob.models.BlobGetPropertiesHeaders +import com.microsoft.azure.storage.blob.models.BlobStartCopyFromURLResponse +import com.microsoft.azure.storage.blob.models.ContainerItem +import com.microsoft.azure.storage.blob.models.ContainerAcquireLeaseHeaders +import com.microsoft.azure.storage.blob.models.ContainerGetPropertiesHeaders +import com.microsoft.azure.storage.blob.models.ContainerItem import com.microsoft.azure.storage.blob.models.CopyStatusType import com.microsoft.azure.storage.blob.models.LeaseStateType +import com.microsoft.azure.storage.blob.models.RetentionPolicy +import com.microsoft.azure.storage.blob.models.StorageServiceProperties import com.microsoft.rest.v2.http.HttpClient import com.microsoft.rest.v2.http.HttpClientConfiguration import com.microsoft.rest.v2.http.HttpPipeline @@ -101,6 +104,10 @@ class APISpec extends Specification { static ServiceURL alternateServiceURL = getGenericServiceURL(alternateCreds) + static ServiceURL blobStorageServiceURL = getGenericServiceURL(getGenericCreds("BLOB_STORAGE_")) + + static ServiceURL premiumServiceURL = getGenericServiceURL(getGenericCreds("PREMIUM_")) + static String getTestName(ISpecificationContext ctx) { return ctx.getCurrentFeature().name.replace(' ', '').toLowerCase() } @@ -173,7 +180,8 @@ class APISpec extends Specification { static HttpClient getHttpClient() { if (enableDebugging) { HttpClientConfiguration configuration = new HttpClientConfiguration( - new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8888))) + new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8888)), + false) return HttpClient.createDefault(configuration) } else return HttpClient.createDefault() @@ -196,9 +204,9 @@ class APISpec extends Specification { ServiceURL serviceURL = new ServiceURL( new URL("http://" + System.getenv().get("ACCOUNT_NAME") + ".blob.core.windows.net"), pipeline) // There should not be more than 5000 containers from these tests - for (Container c : serviceURL.listContainersSegment(null, + for (ContainerItem c : serviceURL.listContainersSegment(null, new ListContainersOptions(null, containerPrefix, null)).blockingGet() - .body().containers()) { + .body().containerItems()) { ContainerURL containerURL = serviceURL.createContainerURL(c.name()) if (c.properties().leaseState().equals(LeaseStateType.LEASED)) { containerURL.breakLease(0, null).blockingGet() @@ -258,7 +266,7 @@ class APISpec extends Specification { */ def setupBlobMatchCondition(BlobURL bu, ETag match) { if (match == receivedEtag) { - BlobsGetPropertiesHeaders headers = bu.getProperties(null).blockingGet().headers() + BlobGetPropertiesHeaders headers = bu.getProperties(null).blockingGet().headers() return new ETag(headers.eTag()) } else { return match @@ -279,7 +287,7 @@ class APISpec extends Specification { * The actual leaseID of the blob if recievedLeaseID is passed, otherwise whatever was passed will be returned. */ def setupBlobLeaseCondition(BlobURL bu, String leaseID) { - BlobsAcquireLeaseHeaders headers = null + BlobAcquireLeaseHeaders headers = null if (leaseID == receivedLeaseID || leaseID == garbageLeaseID) { headers = bu.acquireLease(null, -1, null).blockingGet().headers() } @@ -292,7 +300,7 @@ class APISpec extends Specification { def setupContainerMatchCondition(ContainerURL cu, ETag match) { if (match == receivedEtag) { - ContainersGetPropertiesHeaders headers = cu.getProperties(null).blockingGet().headers() + ContainerGetPropertiesHeaders headers = cu.getProperties(null).blockingGet().headers() return new ETag(headers.eTag()) } else { return match @@ -301,7 +309,7 @@ class APISpec extends Specification { def setupContainerLeaseCondition(ContainerURL cu, String leaseID) { if (leaseID == receivedLeaseID) { - ContainersAcquireLeaseHeaders headers = + ContainerAcquireLeaseHeaders headers = cu.acquireLease(null, -1, null).blockingGet().headers() return headers.leaseId() } else { @@ -309,7 +317,7 @@ class APISpec extends Specification { } } - def waitForCopy(BlobURL bu, BlobsStartCopyFromURLResponse response) { + def waitForCopy(BlobURL bu, BlobStartCopyFromURLResponse response) { CopyStatusType status = response.headers().copyStatus() OffsetDateTime start = OffsetDateTime.now() @@ -349,4 +357,18 @@ class APISpec extends Specification { headers.class.getMethod("contentType").invoke(headers) == contentType } + + def enableSoftDelete() { + primaryServiceURL.setProperties(new StorageServiceProperties() + .withDeleteRetentionPolicy(new RetentionPolicy().withEnabled(true).withDays(2))) + .blockingGet() + sleep(30000) // Wait for the policy to take effect. + } + + def disableSoftDelete() { + primaryServiceURL.setProperties(new StorageServiceProperties() + .withDeleteRetentionPolicy(new RetentionPolicy().withEnabled(false))).blockingGet() + + sleep(30000) // Wait for the policy to take effect. + } } diff --git a/src/test/java/com/microsoft/azure/storage/AppendBlobAPITest.groovy b/src/test/java/com/microsoft/azure/storage/AppendBlobAPITest.groovy index fb6953980..adaf0d62f 100644 --- a/src/test/java/com/microsoft/azure/storage/AppendBlobAPITest.groovy +++ b/src/test/java/com/microsoft/azure/storage/AppendBlobAPITest.groovy @@ -23,13 +23,11 @@ import com.microsoft.azure.storage.blob.ETag import com.microsoft.azure.storage.blob.HTTPAccessConditions import com.microsoft.azure.storage.blob.LeaseAccessConditions import com.microsoft.azure.storage.blob.Metadata -import com.microsoft.azure.storage.blob.PageBlobURL import com.microsoft.azure.storage.blob.StorageException -import com.microsoft.azure.storage.blob.models.AppendBlobsAppendBlockHeaders -import com.microsoft.azure.storage.blob.models.AppendBlobsCreateResponse -import com.microsoft.azure.storage.blob.models.BlobsGetPropertiesResponse +import com.microsoft.azure.storage.blob.models.AppendBlobAppendBlockHeaders +import com.microsoft.azure.storage.blob.models.AppendBlobCreateResponse +import com.microsoft.azure.storage.blob.models.BlobGetPropertiesResponse import com.microsoft.rest.v2.util.FlowableUtil -import io.reactivex.Flowable import spock.lang.Unroll import java.security.MessageDigest @@ -43,7 +41,7 @@ public class AppendBlobAPITest extends APISpec { def "Append blob create defaults"() { when: - AppendBlobsCreateResponse createResponse = + AppendBlobCreateResponse createResponse = bu.create(null, null, null).blockingGet() then: @@ -72,7 +70,7 @@ public class AppendBlobAPITest extends APISpec { when: bu.create(headers, null, null).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: validateBlobHeaders(response.headers(), cacheControl, contentDisposition, contentEncoding, contentLanguage, @@ -98,7 +96,7 @@ public class AppendBlobAPITest extends APISpec { when: bu.create(null, metadata, null).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: response.headers().metadata() == metadata @@ -134,7 +132,7 @@ public class AppendBlobAPITest extends APISpec { def "Append blob append block defaults"() { setup: - AppendBlobsAppendBlockHeaders headers = + AppendBlobAppendBlockHeaders headers = bu.appendBlock(defaultFlowable, defaultDataSize, null).blockingGet().headers() diff --git a/src/test/java/com/microsoft/azure/storage/BlobAPITest.groovy b/src/test/java/com/microsoft/azure/storage/BlobAPITest.groovy index 7f8907481..bc069b29f 100644 --- a/src/test/java/com/microsoft/azure/storage/BlobAPITest.groovy +++ b/src/test/java/com/microsoft/azure/storage/BlobAPITest.groovy @@ -1,4 +1,3 @@ - /* * Copyright Microsoft Corporation * @@ -16,6 +15,7 @@ package com.microsoft.azure.storage +import com.google.common.escape.ArrayBasedCharEscaper import com.microsoft.azure.storage.blob.BlobAccessConditions import com.microsoft.azure.storage.blob.BlobHTTPHeaders import com.microsoft.azure.storage.blob.BlobRange @@ -26,32 +26,36 @@ import com.microsoft.azure.storage.blob.DownloadResponse import com.microsoft.azure.storage.blob.HTTPAccessConditions import com.microsoft.azure.storage.blob.LeaseAccessConditions import com.microsoft.azure.storage.blob.Metadata +import com.microsoft.azure.storage.blob.PageBlobURL import com.microsoft.azure.storage.blob.StorageException import com.microsoft.azure.storage.blob.models.AccessTier +import com.microsoft.azure.storage.blob.models.ArchiveStatus +import com.microsoft.azure.storage.blob.models.BlobSetTierResponse import com.microsoft.azure.storage.blob.models.BlobType -import com.microsoft.azure.storage.blob.models.BlobsAbortCopyFromURLHeaders -import com.microsoft.azure.storage.blob.models.BlobsAbortCopyFromURLResponse -import com.microsoft.azure.storage.blob.models.BlobsAcquireLeaseHeaders -import com.microsoft.azure.storage.blob.models.BlobsBreakLeaseHeaders -import com.microsoft.azure.storage.blob.models.BlobsChangeLeaseHeaders -import com.microsoft.azure.storage.blob.models.BlobsCreateSnapshotHeaders -import com.microsoft.azure.storage.blob.models.BlobsCreateSnapshotResponse -import com.microsoft.azure.storage.blob.models.BlobsDeleteHeaders -import com.microsoft.azure.storage.blob.models.BlobsDeleteResponse -import com.microsoft.azure.storage.blob.models.BlobsDownloadHeaders -import com.microsoft.azure.storage.blob.models.BlobsGetPropertiesHeaders -import com.microsoft.azure.storage.blob.models.BlobsReleaseLeaseHeaders -import com.microsoft.azure.storage.blob.models.BlobsRenewLeaseHeaders -import com.microsoft.azure.storage.blob.models.BlobsSetHTTPHeadersResponse -import com.microsoft.azure.storage.blob.models.BlobsSetMetadataResponse -import com.microsoft.azure.storage.blob.models.BlobsStartCopyFromURLHeaders -import com.microsoft.azure.storage.blob.models.BlobsStartCopyFromURLResponse +import com.microsoft.azure.storage.blob.models.BlobAbortCopyFromURLHeaders +import com.microsoft.azure.storage.blob.models.BlobAbortCopyFromURLResponse +import com.microsoft.azure.storage.blob.models.BlobAcquireLeaseHeaders +import com.microsoft.azure.storage.blob.models.BlobBreakLeaseHeaders +import com.microsoft.azure.storage.blob.models.BlobChangeLeaseHeaders +import com.microsoft.azure.storage.blob.models.BlobCreateSnapshotHeaders +import com.microsoft.azure.storage.blob.models.BlobCreateSnapshotResponse +import com.microsoft.azure.storage.blob.models.BlobDeleteHeaders +import com.microsoft.azure.storage.blob.models.BlobDeleteResponse +import com.microsoft.azure.storage.blob.models.BlobDownloadHeaders +import com.microsoft.azure.storage.blob.models.BlobGetPropertiesHeaders +import com.microsoft.azure.storage.blob.models.BlobReleaseLeaseHeaders +import com.microsoft.azure.storage.blob.models.BlobRenewLeaseHeaders +import com.microsoft.azure.storage.blob.models.BlobSetHTTPHeadersResponse +import com.microsoft.azure.storage.blob.models.BlobSetMetadataResponse +import com.microsoft.azure.storage.blob.models.BlobStartCopyFromURLHeaders +import com.microsoft.azure.storage.blob.models.BlobStartCopyFromURLResponse import com.microsoft.azure.storage.blob.models.CopyStatusType import com.microsoft.azure.storage.blob.models.DeleteSnapshotsOptionType import com.microsoft.azure.storage.blob.models.LeaseDurationType import com.microsoft.azure.storage.blob.models.LeaseStateType import com.microsoft.azure.storage.blob.models.LeaseStatusType import com.microsoft.azure.storage.blob.models.PublicAccessType +import com.microsoft.azure.storage.blob.models.StorageErrorCode import com.microsoft.rest.v2.util.FlowableUtil import io.reactivex.Flowable import spock.lang.Unroll @@ -73,7 +77,7 @@ class BlobAPITest extends APISpec { DownloadResponse response = bu.download(null, null, false) .blockingGet() ByteBuffer body = FlowableUtil.collectBytesInBuffer(response.body()).blockingGet() - BlobsDownloadHeaders headers = response.headers() + BlobDownloadHeaders headers = response.headers() then: validateBasicHeaders(headers) @@ -152,7 +156,7 @@ class BlobAPITest extends APISpec { expect: bu.download(new BlobRange(0, 3), null, true).blockingGet() .headers().contentMD5() == - MessageDigest.getInstance("MD5").digest(defaultText.substring(0,3).getBytes()) + MessageDigest.getInstance("MD5").digest(defaultText.substring(0, 3).getBytes()) } def "Blob download error"() { @@ -168,7 +172,7 @@ class BlobAPITest extends APISpec { def "Blob get properties all null"() { when: - BlobsGetPropertiesHeaders headers = bu.getProperties(null).blockingGet().headers() + BlobGetPropertiesHeaders headers = bu.getProperties(null).blockingGet().headers() then: validateBasicHeaders(headers) @@ -237,7 +241,7 @@ class BlobAPITest extends APISpec { def "Blob set HTTP headers null"() { setup: - BlobsSetHTTPHeadersResponse response = bu.setHTTPHeaders(null, null).blockingGet() + BlobSetHTTPHeadersResponse response = bu.setHTTPHeaders(null, null).blockingGet() expect: response.statusCode() == 200 @@ -252,7 +256,7 @@ class BlobAPITest extends APISpec { BlobHTTPHeaders putHeaders = new BlobHTTPHeaders(cacheControl, contentDisposition, contentEncoding, contentLanguage, contentMD5, contentType) bu.setHTTPHeaders(putHeaders, null).blockingGet() - BlobsGetPropertiesHeaders receivedHeaders = + BlobGetPropertiesHeaders receivedHeaders = bu.getProperties(null).blockingGet().headers() expect: @@ -301,7 +305,7 @@ class BlobAPITest extends APISpec { def "Blob set metadata all null"() { setup: - BlobsSetMetadataResponse response = bu.setMetadata(null, null).blockingGet() + BlobSetMetadataResponse response = bu.setMetadata(null, null).blockingGet() expect: bu.getProperties(null).blockingGet().headers().metadata().size() == 0 @@ -368,12 +372,12 @@ class BlobAPITest extends APISpec { @Unroll def "Blob acquire lease"() { setup: - BlobsAcquireLeaseHeaders headers = + BlobAcquireLeaseHeaders headers = bu.acquireLease(UUID.randomUUID().toString(), leaseTime, null) .blockingGet().headers() when: - BlobsGetPropertiesHeaders properties = bu.getProperties(null).blockingGet() + BlobGetPropertiesHeaders properties = bu.getProperties(null).blockingGet() .headers() then: @@ -424,7 +428,7 @@ class BlobAPITest extends APISpec { String leaseID = setupBlobLeaseCondition(bu, receivedLeaseID) Thread.sleep(16000) // Wait for the lease to expire to ensure we are actually renewing it - BlobsRenewLeaseHeaders headers = bu.renewLease(leaseID, null).blockingGet().headers() + BlobRenewLeaseHeaders headers = bu.renewLease(leaseID, null).blockingGet().headers() expect: bu.getProperties(null).blockingGet().headers().leaseState() @@ -467,7 +471,7 @@ class BlobAPITest extends APISpec { setup: String leaseID = setupBlobLeaseCondition(bu, receivedLeaseID) - BlobsReleaseLeaseHeaders headers = bu.releaseLease(leaseID, null).blockingGet().headers() + BlobReleaseLeaseHeaders headers = bu.releaseLease(leaseID, null).blockingGet().headers() expect: bu.getProperties(null).blockingGet().headers().leaseState() == LeaseStateType.AVAILABLE @@ -509,7 +513,7 @@ class BlobAPITest extends APISpec { setup: bu.acquireLease(UUID.randomUUID().toString(), leaseTime, null).blockingGet() - BlobsBreakLeaseHeaders headers = bu.breakLease(breakPeriod, null).blockingGet().headers() + BlobBreakLeaseHeaders headers = bu.breakLease(breakPeriod, null).blockingGet().headers() LeaseStateType state = bu.getProperties(null).blockingGet().headers().leaseState() expect: @@ -560,7 +564,7 @@ class BlobAPITest extends APISpec { String leaseID = bu.acquireLease(UUID.randomUUID().toString(), 15, null).blockingGet() .headers().leaseId() - BlobsChangeLeaseHeaders headers = bu.changeLease(leaseID, UUID.randomUUID().toString(), null) + BlobChangeLeaseHeaders headers = bu.changeLease(leaseID, UUID.randomUUID().toString(), null) .blockingGet().headers() leaseID = headers.leaseId() @@ -601,7 +605,7 @@ class BlobAPITest extends APISpec { def "Blob snapshot"() { when: - BlobsCreateSnapshotHeaders headers = bu.createSnapshot(null, null) + BlobCreateSnapshotHeaders headers = bu.createSnapshot(null, null) .blockingGet().headers() then: @@ -620,7 +624,7 @@ class BlobAPITest extends APISpec { metadata.put(key2, value2) } - BlobsCreateSnapshotResponse response = bu.createSnapshot(metadata, null).blockingGet() + BlobCreateSnapshotResponse response = bu.createSnapshot(metadata, null).blockingGet() expect: response.statusCode() == 201 @@ -670,7 +674,7 @@ class BlobAPITest extends APISpec { def "Blob copy"() { setup: BlobURL bu2 = cu.createBlockBlobURL(generateBlobName()) - BlobsStartCopyFromURLHeaders headers = + BlobStartCopyFromURLHeaders headers = bu2.startCopyFromURL(bu.toURL(), null, null, null) .blockingGet().headers() @@ -695,7 +699,7 @@ class BlobAPITest extends APISpec { metadata.put(key2, value2) } - BlobsStartCopyFromURLResponse response = + BlobStartCopyFromURLResponse response = bu2.startCopyFromURL(bu.toURL(), metadata, null, null) .blockingGet() waitForCopy(bu2, response) @@ -787,8 +791,8 @@ class BlobAPITest extends APISpec { String copyID = bu2.startCopyFromURL(bu.toURL(), null, null, null) .blockingGet().headers().copyId() - BlobsAbortCopyFromURLResponse response = bu2.abortCopyFromURL(copyID, null).blockingGet() - BlobsAbortCopyFromURLHeaders headers = response.headers() + BlobAbortCopyFromURLResponse response = bu2.abortCopyFromURL(copyID, null).blockingGet() + BlobAbortCopyFromURLHeaders headers = response.headers() then: response.statusCode() == 204 @@ -842,8 +846,8 @@ class BlobAPITest extends APISpec { def "Blob delete"() { when: - BlobsDeleteResponse response = bu.delete(null, null).blockingGet() - BlobsDeleteHeaders headers = response.headers() + BlobDeleteResponse response = bu.delete(null, null).blockingGet() + BlobDeleteHeaders headers = response.headers() then: response.statusCode() == 202 @@ -865,7 +869,8 @@ class BlobAPITest extends APISpec { bu.delete(option, null).blockingGet() then: - cu.listBlobsFlatSegment(null, null).blockingGet().body().blobs().blob().size() == blobsRemaining + cu.listBlobsFlatSegment(null, null).blockingGet() + .body().segment().blobItems().size()== blobsRemaining where: option | blobsRemaining @@ -905,4 +910,159 @@ class BlobAPITest extends APISpec { then: thrown(StorageException) } + + @Unroll + def "Set tier block blob"() { + setup: + ContainerURL cu = blobStorageServiceURL.createContainerURL(generateContainerName()) + BlockBlobURL bu = cu.createBlockBlobURL(generateBlobName()) + cu.create(null, null).blockingGet() + bu.upload(defaultFlowable, defaultData.remaining(), null, null, null) + .blockingGet() + + when: + BlobSetTierResponse initialResponse = bu.setTier(tier).blockingGet() + + then: + initialResponse.statusCode() == 200 || initialResponse.statusCode() == 202 + initialResponse.headers().version() != null + initialResponse.headers().requestId() != null + bu.getProperties(null).blockingGet().headers().accessTier() == tier.toString() + cu.listBlobsFlatSegment(null, null).blockingGet().body().segment().blobItems().get(0) + .properties().accessTier() == tier + + where: + tier | _ + AccessTier.HOT | _ + AccessTier.COOL | _ + AccessTier.ARCHIVE | _ + } + + @Unroll + def "Set tier page blob"() { + setup: + ContainerURL cu = premiumServiceURL.createContainerURL(generateContainerName()) + PageBlobURL bu = cu.createPageBlobURL(generateBlobName()) + cu.create(null, null).blockingGet() + bu.create(512, null, null, null, null).blockingGet() + + when: + bu.setTier(tier).blockingGet() + + then: + bu.getProperties(null).blockingGet().headers().accessTier() == tier.toString() + cu.listBlobsFlatSegment(null, null).blockingGet().body().segment().blobItems().get(0) + .properties().accessTier() == tier + cu.delete(null).blockingGet() + + where: + tier | _ + AccessTier.P4 | _ + AccessTier.P6 | _ + AccessTier.P10 | _ + AccessTier.P20 | _ + AccessTier.P30 | _ + AccessTier.P40 | _ + AccessTier.P50 | _ + } + + def "Set tier inferred"() { + setup: + ContainerURL cu = blobStorageServiceURL.createContainerURL(generateBlobName()) + BlockBlobURL bu = cu.createBlockBlobURL(generateBlobName()) + cu.create(null, null).blockingGet() + bu.upload(defaultFlowable, defaultDataSize, null, null, null).blockingGet() + + when: + boolean inferred1 = bu.getProperties(null).blockingGet().headers().accessTierInferred() + Boolean inferredList1 = cu.listBlobsFlatSegment(null, null).blockingGet().body().segment() + .blobItems().get(0).properties().accessTierInferred() + + bu.setTier(AccessTier.HOT).blockingGet() + + BlobGetPropertiesHeaders headers = bu.getProperties(null).blockingGet().headers() + Boolean inferred2 = headers.accessTierInferred() + Boolean inferredList2 = cu.listBlobsFlatSegment(null, null).blockingGet().body().segment() + .blobItems().get(0).properties().accessTierInferred() + + then: + inferred1 + inferredList1 + inferred2 == null + inferredList2 == null + } + + @Unroll + def "Set tier archive status"() { + setup: + ContainerURL cu = blobStorageServiceURL.createContainerURL(generateBlobName()) + BlockBlobURL bu = cu.createBlockBlobURL(generateBlobName()) + cu.create(null, null).blockingGet() + bu.upload(defaultFlowable, defaultDataSize, null, null, null).blockingGet() + + when: + bu.setTier(sourceTier).blockingGet() + bu.setTier(destTier).blockingGet() + + then: + bu.getProperties(null).blockingGet().headers().archiveStatus() == status.toString() + cu.listBlobsFlatSegment(null, null).blockingGet().body().segment().blobItems() + .get(0).properties().archiveStatus() + + where: + sourceTier | destTier | status + AccessTier.ARCHIVE | AccessTier.COOL | ArchiveStatus.REHYDRATE_PENDING_TO_COOL + AccessTier.ARCHIVE | AccessTier.HOT | ArchiveStatus.REHYDRATE_PENDING_TO_HOT + } + + def "Set tier error"() { + setup: + ContainerURL cu = blobStorageServiceURL.createContainerURL(generateBlobName()) + BlockBlobURL bu = cu.createBlockBlobURL(generateBlobName()) + cu.create(null, null).blockingGet() + bu.upload(defaultFlowable, defaultDataSize, null, null, null).blockingGet() + + when: + bu.setTier(AccessTier.fromString("garbage")).blockingGet() + + then: + def e = thrown(StorageException) + e.errorCode() == StorageErrorCode.INVALID_HEADER_VALUE + } + + def "Set tier illegal argument"() { + when: + bu.setTier(null) + + then: + thrown(IllegalArgumentException) + } + + def "Undelete"() { + setup: + enableSoftDelete() + bu.delete(null, null).blockingGet() + + when: + def response = bu.undelete().blockingGet() + bu.getProperties(null).blockingGet() + + then: + notThrown(StorageException) + response.headers().requestId() != null + response.headers().version() != null + response.headers().date() != null + + disableSoftDelete() == null + } + + def "Undelete error"() { + bu = cu.createBlockBlobURL(generateBlobName()) + + when: + bu.undelete().blockingGet() + + then: + thrown(StorageException) + } } diff --git a/src/test/java/com/microsoft/azure/storage/BlobStorageAPITests.java b/src/test/java/com/microsoft/azure/storage/BlobStorageAPITests.java index 024a2e249..f28a8b880 100644 --- a/src/test/java/com/microsoft/azure/storage/BlobStorageAPITests.java +++ b/src/test/java/com/microsoft/azure/storage/BlobStorageAPITests.java @@ -73,7 +73,7 @@ public void TestPutBlobBasic() throws IOException, InvalidKeyException, Interrup // Currently only the default PipelineOptions are supported. PipelineOptions po = new PipelineOptions(); HttpClientConfiguration configuration = new HttpClientConfiguration( - new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8888))); + new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8888)), false); po.client = HttpClient.createDefault();//configuration); HttpPipeline pipeline = StorageURL.createPipeline(creds, po); diff --git a/src/test/java/com/microsoft/azure/storage/BlockBlobAPITest.groovy b/src/test/java/com/microsoft/azure/storage/BlockBlobAPITest.groovy index afb99d0a4..7c7dcf1bc 100644 --- a/src/test/java/com/microsoft/azure/storage/BlockBlobAPITest.groovy +++ b/src/test/java/com/microsoft/azure/storage/BlockBlobAPITest.groovy @@ -17,20 +17,22 @@ package com.microsoft.azure.storage import com.microsoft.azure.storage.blob.BlobAccessConditions import com.microsoft.azure.storage.blob.BlobHTTPHeaders +import com.microsoft.azure.storage.blob.BlobRange import com.microsoft.azure.storage.blob.BlockBlobURL import com.microsoft.azure.storage.blob.HTTPAccessConditions import com.microsoft.azure.storage.blob.LeaseAccessConditions import com.microsoft.azure.storage.blob.Metadata import com.microsoft.azure.storage.blob.StorageException -import com.microsoft.azure.storage.blob.models.BlobsGetPropertiesResponse -import com.microsoft.azure.storage.blob.models.BlockBlobsCommitBlockListHeaders -import com.microsoft.azure.storage.blob.models.BlockBlobsCommitBlockListResponse -import com.microsoft.azure.storage.blob.models.BlockBlobsGetBlockListResponse -import com.microsoft.azure.storage.blob.models.BlockBlobsStageBlockHeaders -import com.microsoft.azure.storage.blob.models.BlockBlobsStageBlockResponse -import com.microsoft.azure.storage.blob.models.BlockBlobsUploadHeaders -import com.microsoft.azure.storage.blob.models.BlockBlobsUploadResponse +import com.microsoft.azure.storage.blob.models.BlobGetPropertiesResponse +import com.microsoft.azure.storage.blob.models.BlockBlobCommitBlockListHeaders +import com.microsoft.azure.storage.blob.models.BlockBlobCommitBlockListResponse +import com.microsoft.azure.storage.blob.models.BlockBlobGetBlockListResponse +import com.microsoft.azure.storage.blob.models.BlockBlobStageBlockHeaders +import com.microsoft.azure.storage.blob.models.BlockBlobStageBlockResponse +import com.microsoft.azure.storage.blob.models.BlockBlobUploadHeaders +import com.microsoft.azure.storage.blob.models.BlockBlobUploadResponse import com.microsoft.azure.storage.blob.models.BlockListType +import com.microsoft.azure.storage.blob.models.PublicAccessType import com.microsoft.azure.storage.blob.models.StorageErrorCode import com.microsoft.rest.v2.util.FlowableUtil import io.reactivex.Flowable @@ -54,9 +56,9 @@ class BlockBlobAPITest extends APISpec { def "Stage block"() { setup: - BlockBlobsStageBlockResponse response = bu.stageBlock(getBlockID(), defaultFlowable, defaultDataSize, + BlockBlobStageBlockResponse response = bu.stageBlock(getBlockID(), defaultFlowable, defaultDataSize, null).blockingGet() - BlockBlobsStageBlockHeaders headers = response.headers() + BlockBlobStageBlockHeaders headers = response.headers() expect: response.statusCode() == 201 @@ -134,6 +136,125 @@ class BlockBlobAPITest extends APISpec { thrown(StorageException) } + def "Stage block from url"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null, null).blockingGet() + def bu2 = cu.createBlockBlobURL(generateBlobName()) + def blockID = getBlockID() + + when: + def response = bu2.stageBlockFromURL(blockID, bu.toURL(), null, null, + null).blockingGet() + def listResponse = bu2.getBlockList(BlockListType.ALL, null).blockingGet() + bu2.commitBlockList(Arrays.asList(blockID), null, null, null).blockingGet() + + then: + response.headers().requestId() != null + response.headers().version() != null + response.headers().requestId() != null + response.headers().contentMD5() != null + response.headers().isServerEncrypted() != null + + listResponse.body().uncommittedBlocks().get(0).name() == blockID + listResponse.body().uncommittedBlocks().size() == 1 + + FlowableUtil.collectBytesInBuffer(bu2.download(null, null, false) + .blockingGet().body()).blockingGet() == defaultData + } + + @Unroll + def "Stage block from URL IA"() { + when: + bu.stageBlockFromURL(blockID, sourceURL, null, null, null) + .blockingGet() + + then: + thrown(IllegalArgumentException) + + where: + blockID | sourceURL + null | new URL("http://www.example.com") + getBlockID() | null + } + + def "Stage block from URL range"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null, null).blockingGet() + def destURL = cu.createBlockBlobURL(generateBlobName()) + + when: + destURL.stageBlockFromURL(getBlockID(), bu.toURL(), new BlobRange(2, 3), null, + null).blockingGet() + + then: + destURL.getBlockList(BlockListType.ALL, null).blockingGet().body().uncommittedBlocks().get(0) + .size() == 3 + } + + def "Stage block from URL MD5"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null, null).blockingGet() + def destURL = cu.createBlockBlobURL(generateBlobName()) + + when: + destURL.stageBlockFromURL(getBlockID(), bu.toURL(), null, + MessageDigest.getInstance("MD5").digest(defaultData.array()),null) + .blockingGet() + + then: + notThrown(StorageException) + } + + def "Stage block from URL MD5 fail"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null, null).blockingGet() + def destURL = cu.createBlockBlobURL(generateBlobName()) + + when: + destURL.stageBlockFromURL(getBlockID(), bu.toURL(), null, "garbage".getBytes(), + null).blockingGet() + + then: + thrown(StorageException) + } + + def "Stage block from URL lease"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null, null).blockingGet() + def lease = new LeaseAccessConditions(setupBlobLeaseCondition(bu, receivedLeaseID)) + + when: + bu.stageBlockFromURL(getBlockID(), bu.toURL(), null, null, lease).blockingGet() + + then: + notThrown(StorageException) + } + + def "Stage block from URL lease fail"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null, null).blockingGet() + def lease = new LeaseAccessConditions("garbage") + + when: + bu.stageBlockFromURL(getBlockID(), bu.toURL(), null, null, lease).blockingGet() + + then: + thrown(StorageException) + } + + def "Stage block from URL error"() { + setup: + cu = primaryServiceURL.createContainerURL(generateContainerName()) + bu = cu.createBlockBlobURL(generateBlobName()) + + when: + bu.stageBlockFromURL(getBlockID(), bu.toURL(), null, null, null) + .blockingGet() + + then: + thrown(StorageException) + } + def "Commit block list"() { setup: String blockID = getBlockID() @@ -143,9 +264,9 @@ class BlockBlobAPITest extends APISpec { ids.add(blockID) when: - BlockBlobsCommitBlockListResponse response = + BlockBlobCommitBlockListResponse response = bu.commitBlockList(ids, null, null, null).blockingGet() - BlockBlobsCommitBlockListHeaders headers = response.headers() + BlockBlobCommitBlockListHeaders headers = response.headers() then: response.statusCode() == 201 @@ -173,7 +294,7 @@ class BlockBlobAPITest extends APISpec { when: bu.commitBlockList(ids, headers, null, null).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: response.statusCode() == 200 @@ -200,7 +321,7 @@ class BlockBlobAPITest extends APISpec { when: bu.commitBlockList(null, null, metadata, null).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: response.statusCode() == 200 @@ -212,18 +333,6 @@ class BlockBlobAPITest extends APISpec { "foo" | "bar" | "fizz" | "buzz" } - def "Commit block list metadata fail"() { - setup: - Metadata metadata = new Metadata() - metadata.put("!nvalid", "value") - - when: - bu.commitBlockList(null, null, metadata, null).blockingGet() - - then: - thrown(IllegalArgumentException) - } - @Unroll def "Commit block list AC"() { setup: @@ -288,20 +397,27 @@ class BlockBlobAPITest extends APISpec { def "Get block list"() { setup: String blockID = getBlockID() - bu.stageBlock(blockID, defaultFlowable, defaultDataSize, - null).blockingGet() + bu.stageBlock(blockID, defaultFlowable, defaultDataSize,null).blockingGet() + bu.commitBlockList(Arrays.asList(blockID), null, null, null).blockingGet() + String blockID2 = getBlockID() + bu.stageBlock(blockID2, defaultFlowable, defaultDataSize, null).blockingGet() when: - BlockBlobsGetBlockListResponse response = bu.getBlockList(BlockListType.ALL, null) + BlockBlobGetBlockListResponse response = bu.getBlockList(BlockListType.ALL, null) .blockingGet() then: - response.body().uncommittedBlocks().get(0).name() == blockID + response.body().committedBlocks().get(0).name() == blockID + response.body().committedBlocks().get(0).size() == defaultDataSize + response.body().uncommittedBlocks().get(0).name() == blockID2 + response.body().uncommittedBlocks().get(0).size() == defaultDataSize validateBasicHeaders(response.headers()) response.headers().contentType() != null response.headers().blobContentLength() == (long) defaultDataSize } + // TODO: at least two blocks per list + @Unroll def "Get block list type"() { setup: @@ -316,7 +432,7 @@ class BlockBlobAPITest extends APISpec { null).blockingGet() when: - BlockBlobsGetBlockListResponse response = bu.getBlockList(type, null).blockingGet() + BlockBlobGetBlockListResponse response = bu.getBlockList(type, null).blockingGet() then: response.body().committedBlocks().size() == committedCount @@ -370,9 +486,9 @@ class BlockBlobAPITest extends APISpec { def "Upload"() { when: - BlockBlobsUploadResponse response = bu.upload(defaultFlowable, defaultDataSize, + BlockBlobUploadResponse response = bu.upload(defaultFlowable, defaultDataSize, null, null, null).blockingGet() - BlockBlobsUploadHeaders headers = response.headers() + BlockBlobUploadHeaders headers = response.headers() then: response.statusCode() == 201 @@ -422,7 +538,7 @@ class BlockBlobAPITest extends APISpec { when: bu.upload(defaultFlowable, defaultDataSize, headers, null, null).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: validateBlobHeaders(response.headers(), cacheControl, contentDisposition, contentEncoding, contentLanguage, @@ -451,7 +567,7 @@ class BlockBlobAPITest extends APISpec { when: bu.upload(defaultFlowable, defaultDataSize, null, metadata, null).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: response.statusCode() == 200 @@ -463,18 +579,6 @@ class BlockBlobAPITest extends APISpec { "foo" | "bar" | "fizz" | "buzz" } - def "Upload metadata fail"() { - setup: - Metadata metadata = new Metadata() - metadata.put("!nvalid", "value") - - when: - bu.upload(defaultFlowable, defaultDataSize, null, metadata, null).blockingGet() - - then: - thrown(IllegalArgumentException) - } - @Unroll def "Upload AC"() { setup: diff --git a/src/test/java/com/microsoft/azure/storage/ContainerAPITest.groovy b/src/test/java/com/microsoft/azure/storage/ContainerAPITest.groovy index 3719765c0..8f2ad59af 100644 --- a/src/test/java/com/microsoft/azure/storage/ContainerAPITest.groovy +++ b/src/test/java/com/microsoft/azure/storage/ContainerAPITest.groovy @@ -20,6 +20,7 @@ import com.microsoft.azure.storage.blob.BlobURL import com.microsoft.azure.storage.blob.BlobListingDetails import com.microsoft.azure.storage.blob.BlockBlobURL import com.microsoft.azure.storage.blob.ContainerAccessConditions +import com.microsoft.azure.storage.blob.ContainerURL import com.microsoft.azure.storage.blob.HTTPAccessConditions import com.microsoft.azure.storage.blob.LeaseAccessConditions import com.microsoft.azure.storage.blob.ListBlobsOptions @@ -29,26 +30,26 @@ import com.microsoft.azure.storage.blob.PipelineOptions import com.microsoft.azure.storage.blob.StorageException import com.microsoft.azure.storage.blob.StorageURL import com.microsoft.azure.storage.blob.models.AccessPolicy -import com.microsoft.azure.storage.blob.models.AppendBlobsCreateResponse -import com.microsoft.azure.storage.blob.models.Blob +import com.microsoft.azure.storage.blob.models.AppendBlobCreateResponse +import com.microsoft.azure.storage.blob.models.BlobGetPropertiesResponse +import com.microsoft.azure.storage.blob.models.BlobItem import com.microsoft.azure.storage.blob.models.BlobType -import com.microsoft.azure.storage.blob.models.BlobsGetPropertiesResponse -import com.microsoft.azure.storage.blob.models.ContainersAcquireLeaseHeaders -import com.microsoft.azure.storage.blob.models.ContainersBreakLeaseHeaders -import com.microsoft.azure.storage.blob.models.ContainersChangeLeaseHeaders -import com.microsoft.azure.storage.blob.models.ContainersCreateResponse -import com.microsoft.azure.storage.blob.models.ContainersDeleteResponse -import com.microsoft.azure.storage.blob.models.ContainersGetAccessPolicyResponse -import com.microsoft.azure.storage.blob.models.ContainersGetPropertiesHeaders -import com.microsoft.azure.storage.blob.models.ContainersGetPropertiesResponse -import com.microsoft.azure.storage.blob.models.ContainersListBlobFlatSegmentHeaders -import com.microsoft.azure.storage.blob.models.ContainersListBlobFlatSegmentResponse -import com.microsoft.azure.storage.blob.models.ContainersListBlobHierarchySegmentHeaders -import com.microsoft.azure.storage.blob.models.ContainersListBlobHierarchySegmentResponse -import com.microsoft.azure.storage.blob.models.ContainersReleaseLeaseHeaders -import com.microsoft.azure.storage.blob.models.ContainersRenewLeaseHeaders -import com.microsoft.azure.storage.blob.models.ContainersSetAccessPolicyResponse -import com.microsoft.azure.storage.blob.models.ContainersSetMetadataResponse +import com.microsoft.azure.storage.blob.models.ContainerAcquireLeaseHeaders +import com.microsoft.azure.storage.blob.models.ContainerBreakLeaseHeaders +import com.microsoft.azure.storage.blob.models.ContainerChangeLeaseHeaders +import com.microsoft.azure.storage.blob.models.ContainerCreateResponse +import com.microsoft.azure.storage.blob.models.ContainerDeleteResponse +import com.microsoft.azure.storage.blob.models.ContainerGetAccessPolicyResponse +import com.microsoft.azure.storage.blob.models.ContainerGetPropertiesHeaders +import com.microsoft.azure.storage.blob.models.ContainerGetPropertiesResponse +import com.microsoft.azure.storage.blob.models.ContainerListBlobFlatSegmentHeaders +import com.microsoft.azure.storage.blob.models.ContainerListBlobFlatSegmentResponse +import com.microsoft.azure.storage.blob.models.ContainerListBlobHierarchySegmentHeaders +import com.microsoft.azure.storage.blob.models.ContainerListBlobHierarchySegmentResponse +import com.microsoft.azure.storage.blob.models.ContainerReleaseLeaseHeaders +import com.microsoft.azure.storage.blob.models.ContainerRenewLeaseHeaders +import com.microsoft.azure.storage.blob.models.ContainerSetAccessPolicyResponse +import com.microsoft.azure.storage.blob.models.ContainerSetMetadataResponse import com.microsoft.azure.storage.blob.models.CopyStatusType import com.microsoft.azure.storage.blob.models.LeaseDurationType import com.microsoft.azure.storage.blob.models.LeaseStateType @@ -57,7 +58,13 @@ import com.microsoft.azure.storage.blob.models.PublicAccessType import com.microsoft.azure.storage.blob.models.SignedIdentifier import com.microsoft.azure.storage.blob.models.StorageErrorCode import com.microsoft.rest.v2.http.HttpPipeline +import com.microsoft.rest.v2.http.HttpRequest +import com.microsoft.rest.v2.http.HttpResponse +import com.microsoft.rest.v2.policy.RequestPolicy +import com.microsoft.rest.v2.policy.RequestPolicyFactory +import com.microsoft.rest.v2.policy.RequestPolicyOptions import io.reactivex.Flowable +import io.reactivex.Single import spock.lang.* import java.time.OffsetDateTime @@ -66,13 +73,13 @@ import java.time.ZoneId class ContainerAPITest extends APISpec { - def "Container create all null"() { + def "Create all null"() { setup: // Overwrite the existing cu, which has already been created cu = primaryServiceURL.createContainerURL(generateContainerName()) when: - ContainersCreateResponse response = cu.create(null, null).blockingGet() + ContainerCreateResponse response = cu.create(null, null).blockingGet() then: response.statusCode() == 201 @@ -80,7 +87,7 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container create metadata"() { + def "Create metadata"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) Metadata metadata = new Metadata() @@ -93,7 +100,7 @@ class ContainerAPITest extends APISpec { when: cu.create(metadata, null).blockingGet() - ContainersGetPropertiesResponse response = cu.getProperties(null).blockingGet() + ContainerGetPropertiesResponse response = cu.getProperties(null).blockingGet() then: response.headers().metadata() == metadata @@ -105,12 +112,12 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container create publicAccess"() { + def "Create publicAccess"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) when: - int statusCode = cu.create(null, publicAccess).blockingGet().statusCode() + cu.create(null, publicAccess).blockingGet() PublicAccessType access = cu.getProperties(null).blockingGet().headers().blobPublicAccess() @@ -124,7 +131,7 @@ class ContainerAPITest extends APISpec { null | _ } - def "Container create exception"() { + def "Create exception"() { when: cu.create(null, null).blockingGet() @@ -135,9 +142,9 @@ class ContainerAPITest extends APISpec { e.message().contains("The specified container already exists.") } - def "Container get properties null"() { + def "Get properties null"() { when: - ContainersGetPropertiesHeaders headers = + ContainerGetPropertiesHeaders headers = cu.getProperties(null).blockingGet().headers() then: @@ -146,9 +153,10 @@ class ContainerAPITest extends APISpec { headers.leaseDuration() == null headers.leaseState() == LeaseStateType.AVAILABLE headers.leaseStatus() == LeaseStatusType.UNLOCKED + headers.metadata().size() == 0 } - def "Container get properties lease"() { + def "Get properties lease"() { setup: String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) @@ -156,7 +164,15 @@ class ContainerAPITest extends APISpec { cu.getProperties(new LeaseAccessConditions(leaseID)).blockingGet().statusCode() == 200 } - def "Container get properties error"() { + def "Get properties lease fail"() { + when: + cu.getProperties(new LeaseAccessConditions("garbage")).blockingGet() + + then: + thrown(StorageException) + } + + def "Get properties error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) @@ -167,17 +183,22 @@ class ContainerAPITest extends APISpec { thrown(StorageException) } - def "Container set metadata"() { + def "Set metadata"() { setup: - ContainersSetMetadataResponse response = cu.setMetadata(null, null).blockingGet() + cu = primaryServiceURL.createContainerURL(generateContainerName()) + Metadata metadata = new Metadata() + metadata.put("key", "value") + cu.create(metadata, null).blockingGet() + ContainerSetMetadataResponse response = cu.setMetadata(null, null).blockingGet() expect: response.statusCode() == 200 validateBasicHeaders(response.headers()) + cu.getProperties(null).blockingGet().headers().metadata().size() == 0 } @Unroll - def "Container set metadata metadata"() { + def "Set metadata metadata"() { setup: Metadata metadata = new Metadata() if (key1 != null) { @@ -199,7 +220,7 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container set metadata AC"() { + def "Set metadata AC"() { setup: leaseID = setupContainerLeaseCondition(cu, leaseID) ContainerAccessConditions cac = new ContainerAccessConditions( @@ -216,7 +237,44 @@ class ContainerAPITest extends APISpec { null | receivedLeaseID } - def "Container set metadata error"() { + @Unroll + def "Set metadata AC fail"() { + setup: + ContainerAccessConditions cac = new ContainerAccessConditions( + new HTTPAccessConditions(modified, null, null, null), + new LeaseAccessConditions(leaseID)) + + when: + cu.setMetadata(null, cac).blockingGet() + + then: + thrown(StorageException) + + where: + modified | leaseID + newDate | null + null | garbageLeaseID + } + + @Unroll + def "Set metadata AC illegal"() { + setup: + HTTPAccessConditions hac = new HTTPAccessConditions(null, unmodified, match, noneMatch) + + when: + cu.setMetadata(null, new ContainerAccessConditions(hac, null)) + + then: + thrown(IllegalArgumentException) + + where: + unmodified | match | noneMatch + newDate | null | null + null | receivedEtag | null + null | null | garbageEtag + } + + def "Set metadata error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) @@ -228,11 +286,12 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container set access policy"() { + def "Set access policy"() { setup: - cu.setAccessPolicy(access, null, null).blockingGet() + def response = cu.setAccessPolicy(access, null, null).blockingGet() expect: + validateBasicHeaders(response.headers()) cu.getProperties(null).blockingGet() .headers().blobPublicAccess() == access @@ -243,7 +302,7 @@ class ContainerAPITest extends APISpec { null | _ } - def "Container set access policy ids"() { + def "Set access policy ids"() { setup: SignedIdentifier identifier = new SignedIdentifier() .withId("0000") @@ -252,24 +311,35 @@ class ContainerAPITest extends APISpec { .withExpiry(OffsetDateTime.now().atZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime() .plusDays(1)) .withPermission("r")) + SignedIdentifier identifier2 = new SignedIdentifier() + .withId("0001") + .withAccessPolicy(new AccessPolicy() + .withStart(OffsetDateTime.now().atZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime()) + .withExpiry(OffsetDateTime.now().atZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime() + .plusDays(2)) + .withPermission("w")) List ids = new ArrayList<>() ids.push(identifier) + ids.push(identifier2) when: - ContainersSetAccessPolicyResponse response = + ContainerSetAccessPolicyResponse response = cu.setAccessPolicy(null, ids, null).blockingGet() - SignedIdentifier receivedIdentifier = cu.getAccessPolicy(null).blockingGet().body().get(0) + List receivedIdentifiers = cu.getAccessPolicy(null).blockingGet().body() then: response.statusCode() == 200 validateBasicHeaders(response.headers()) - receivedIdentifier.accessPolicy().expiry() == identifier.accessPolicy().expiry() - receivedIdentifier.accessPolicy().start() == identifier.accessPolicy().start() - receivedIdentifier.accessPolicy().permission() == identifier.accessPolicy().permission() + receivedIdentifiers.get(0).accessPolicy().expiry() == identifier.accessPolicy().expiry() + receivedIdentifiers.get(0).accessPolicy().start() == identifier.accessPolicy().start() + receivedIdentifiers.get(0).accessPolicy().permission() == identifier.accessPolicy().permission() + receivedIdentifiers.get(1).accessPolicy().expiry() == identifier2.accessPolicy().expiry() + receivedIdentifiers.get(1).accessPolicy().start() == identifier2.accessPolicy().start() + receivedIdentifiers.get(1).accessPolicy().permission() == identifier2.accessPolicy().permission() } @Unroll - def "Container set access policy AC"() { + def "Set access policy AC"() { setup: leaseID = setupContainerLeaseCondition(cu, leaseID) ContainerAccessConditions cac = new ContainerAccessConditions( @@ -287,7 +357,44 @@ class ContainerAPITest extends APISpec { null | null | receivedLeaseID } - def "Container set access policy error"() { + @Unroll + def "Set access policy AC fail"() { + setup: + ContainerAccessConditions cac = new ContainerAccessConditions( + new HTTPAccessConditions(modified, unmodified, null, null), + new LeaseAccessConditions(leaseID)) + + when: + cu.setAccessPolicy(null, null, cac).blockingGet() + + then: + thrown(StorageException) + + where: + modified | unmodified | leaseID + newDate | null | null + null | oldDate | null + null | null | garbageLeaseID + } + + @Unroll + def "Set access policy AC illegal"() { + setup: + HTTPAccessConditions hac = new HTTPAccessConditions(null, null, match, noneMatch) + + when: + cu.setAccessPolicy(null, null, new ContainerAccessConditions(hac, null)) + + then: + thrown(IllegalArgumentException) + + where: + match | noneMatch + receivedEtag | null + null | garbageEtag + } + + def "Set access policy error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) @@ -298,7 +405,7 @@ class ContainerAPITest extends APISpec { thrown(StorageException) } - def "Container get access policy"() { + def "Get access policy"() { setup: SignedIdentifier identifier = new SignedIdentifier() .withId("0000") @@ -310,7 +417,7 @@ class ContainerAPITest extends APISpec { List ids = new ArrayList<>() ids.push(identifier) cu.setAccessPolicy(PublicAccessType.BLOB, ids, null).blockingGet() - ContainersGetAccessPolicyResponse response = cu.getAccessPolicy(null).blockingGet() + ContainerGetAccessPolicyResponse response = cu.getAccessPolicy(null).blockingGet() expect: response.statusCode() == 200 @@ -321,7 +428,7 @@ class ContainerAPITest extends APISpec { response.body().get(0).accessPolicy().permission() == identifier.accessPolicy().permission() } - def "Container get access policy lease"() { + def "Get access policy lease"() { setup: String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) @@ -329,7 +436,15 @@ class ContainerAPITest extends APISpec { cu.getAccessPolicy(new LeaseAccessConditions(leaseID)).blockingGet().statusCode() == 200 } - def "Container get access policy error"() { + def "Get access policy lease fail"() { + when: + cu.getAccessPolicy(new LeaseAccessConditions(garbageLeaseID)).blockingGet() + + then: + thrown(StorageException) + } + + def "Get access policy error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) @@ -340,9 +455,9 @@ class ContainerAPITest extends APISpec { thrown(StorageException) } - def "Container delete"() { + def "Delete"() { when: - ContainersDeleteResponse response = cu.delete(null).blockingGet() + ContainerDeleteResponse response = cu.delete(null).blockingGet() then: response.statusCode() == 202 @@ -352,7 +467,7 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container delete AC"() { + def "Delete AC"() { setup: leaseID = setupContainerLeaseCondition(cu, leaseID) ContainerAccessConditions cac = new ContainerAccessConditions( @@ -370,7 +485,44 @@ class ContainerAPITest extends APISpec { null | null | receivedLeaseID } - def "Container delete error"() { + @Unroll + def "Delete AC fail"() { + setup: + ContainerAccessConditions cac = new ContainerAccessConditions( + new HTTPAccessConditions(modified, unmodified, null, null), + new LeaseAccessConditions(leaseID)) + + when: + cu.delete(cac).blockingGet() + + then: + thrown(StorageException) + + where: + modified | unmodified | leaseID + newDate | null | null + null | oldDate | null + null | null | garbageLeaseID + } + + @Unroll + def "Delete AC illegal"() { + setup: + HTTPAccessConditions hac = new HTTPAccessConditions(null, null, match, noneMatch) + + when: + cu.delete(new ContainerAccessConditions(hac, null)) + + then: + thrown(IllegalArgumentException) + + where: + match | noneMatch + receivedEtag | null + null | garbageEtag + } + + def "Delete error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) @@ -381,17 +533,17 @@ class ContainerAPITest extends APISpec { thrown(StorageException) } - def "Container list blobs flat"() { + def "List blobs flat"() { setup: String name = generateBlobName() PageBlobURL bu = cu.createPageBlobURL(name) bu.create(512, null, null, null, null).blockingGet() when: - ContainersListBlobFlatSegmentResponse response = cu.listBlobsFlatSegment(null, null) + ContainerListBlobFlatSegmentResponse response = cu.listBlobsFlatSegment(null, null) .blockingGet() - ContainersListBlobFlatSegmentHeaders headers = response.headers() - List blobs = response.body().blobs().blob() + ContainerListBlobFlatSegmentHeaders headers = response.headers() + List blobs = response.body().segment().blobItems() then: response.statusCode() == 200 @@ -430,7 +582,7 @@ class ContainerAPITest extends APISpec { def "List blobs flat options copy"() { setup: ListBlobsOptions options = new ListBlobsOptions(new BlobListingDetails( - true, false, false, false), + true, false, false, false, false), null, null) String normalName = "a" + generateBlobName() String copyName = "c" + generateBlobName() @@ -439,7 +591,7 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().blobs().blob() + List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().segment().blobItems() then: blobs.get(0).name() == normalName @@ -456,7 +608,7 @@ class ContainerAPITest extends APISpec { def "List blobs flat options metadata"() { setup: ListBlobsOptions options = new ListBlobsOptions(new BlobListingDetails( - false, true, false, false), + false, true, false, false, false), null, null) String normalName = "a" + generateBlobName() String copyName = "c" + generateBlobName() @@ -465,7 +617,7 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().blobs().blob() + List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().segment().blobItems() then: blobs.get(0).name() == normalName @@ -479,7 +631,7 @@ class ContainerAPITest extends APISpec { def "List blobs flat options snapshots"() { setup: ListBlobsOptions options = new ListBlobsOptions(new BlobListingDetails( - false, false, true, false), + false, false, true, false, false), null, null) String normalName = "a" + generateBlobName() String copyName = "c" + generateBlobName() @@ -488,7 +640,7 @@ class ContainerAPITest extends APISpec { String snapshotTime = setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().blobs().blob() + List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().segment().blobItems() then: blobs.get(0).name() == normalName @@ -500,7 +652,7 @@ class ContainerAPITest extends APISpec { def "List blobs flat options uncommitted"() { setup: ListBlobsOptions options = new ListBlobsOptions(new BlobListingDetails( - false, false, false, true), + false, false, false, true, false), null, null) String normalName = "a" + generateBlobName() String copyName = "c" + generateBlobName() @@ -509,7 +661,7 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().blobs().blob() + List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().segment().blobItems() then: blobs.get(0).name() == normalName @@ -517,6 +669,26 @@ class ContainerAPITest extends APISpec { blobs.size() == 4 // Normal, copy, metadata, uncommitted } + def "List blobs flat options deleted"() { + setup: + enableSoftDelete() + String name = generateBlobName() + AppendBlobURL bu = cu.createAppendBlobURL(name) + bu.create(null, null, null).blockingGet() + bu.delete(null, null).blockingGet() + + when: + List blobs = cu.listBlobsFlatSegment(null, new ListBlobsOptions(new BlobListingDetails( + false, false, false, false, true), null, + null)).blockingGet().body().segment().blobItems() + + then: + blobs.get(0).name() == name + blobs.size() == 1 + + disableSoftDelete() == null // Must produce a true value or test will fail. + } + def "List blobs flat options prefix"() { setup: ListBlobsOptions options = new ListBlobsOptions(null, "a", null) @@ -527,7 +699,7 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().blobs().blob() + List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().segment().blobItems() then: blobs.get(0).name() == normalName @@ -537,7 +709,8 @@ class ContainerAPITest extends APISpec { def "List blobs flat options maxResults"() { setup: ListBlobsOptions options = new ListBlobsOptions(new BlobListingDetails( - true, false, true, true), null, 2) + true, false, true, true, false), + null, 2) String normalName = "a" + generateBlobName() String copyName = "c" + generateBlobName() String metadataName = "m" + generateBlobName() @@ -545,55 +718,63 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().blobs().blob() + List blobs = cu.listBlobsFlatSegment(null, options).blockingGet().body().segment().blobItems() then: blobs.size() == 2 } - def "Container list blobs flat marker"() { + def "List blobs flat options fail"() { + when: + new ListBlobsOptions(null, null, 0) + + then: + thrown(IllegalArgumentException) + } + + def "List blobs flat marker"() { setup: for (int i = 0; i < 10; i++) { PageBlobURL bu = cu.createPageBlobURL(generateBlobName()) bu.create(512, null, null, null, null).blockingGet() } - ContainersListBlobFlatSegmentResponse response = cu.listBlobsFlatSegment(null, + ContainerListBlobFlatSegmentResponse response = cu.listBlobsFlatSegment(null, new ListBlobsOptions(null, null, 6)) .blockingGet() String marker = response.body().nextMarker() - int firstSegmentSize = response.body().blobs().blob().size() + int firstSegmentSize = response.body().segment().blobItems().size() response = cu.listBlobsFlatSegment(marker, null).blockingGet() expect: firstSegmentSize == 6 response.body().nextMarker() == null - response.body().blobs().blob().size() == 4 + response.body().segment().blobItems().size() == 4 } - def "Container list blobs flat error"() { + def "List blobs flat error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) when: - cu.listBlobsFlatSegment(null,null).blockingGet() + cu.listBlobsFlatSegment(null, null).blockingGet() then: thrown(StorageException) } - def "Container list blobs hierarchy"() { + def "List blobs hierarchy"() { setup: String name = generateBlobName() PageBlobURL bu = cu.createPageBlobURL(name) bu.create(512, null, null, null, null).blockingGet() when: - ContainersListBlobHierarchySegmentResponse response = + ContainerListBlobHierarchySegmentResponse response = cu.listBlobsHierarchySegment(null, "/", null) .blockingGet() - ContainersListBlobHierarchySegmentHeaders headers = response.headers() - List blobs = response.body().blobs().blob() + ContainerListBlobHierarchySegmentHeaders headers = response.headers() + List blobs = response.body().segment().blobItems() then: response.statusCode() == 200 @@ -608,7 +789,7 @@ class ContainerAPITest extends APISpec { def "List blobs hier options copy"() { setup: ListBlobsOptions options = new ListBlobsOptions(new BlobListingDetails( - true, false, false, false), + true, false, false, false, false), null, null) String normalName = "a" + generateBlobName() String copyName = "c" + generateBlobName() @@ -617,7 +798,7 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsHierarchySegment(null, "", options).blockingGet().body().blobs().blob() + List blobs = cu.listBlobsHierarchySegment(null, "", options).blockingGet().body().segment().blobItems() then: blobs.get(0).name() == normalName @@ -634,7 +815,7 @@ class ContainerAPITest extends APISpec { def "List blobs hier options metadata"() { setup: ListBlobsOptions options = new ListBlobsOptions(new BlobListingDetails( - false, true, false, false), + false, true, false, false, false), null, null) String normalName = "a" + generateBlobName() String copyName = "c" + generateBlobName() @@ -643,8 +824,8 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsHierarchySegment(null, "", options) - .blockingGet().body().blobs().blob() + List blobs = cu.listBlobsHierarchySegment(null, "", options) + .blockingGet().body().segment().blobItems() then: blobs.get(0).name() == normalName @@ -658,7 +839,7 @@ class ContainerAPITest extends APISpec { def "List blobs hier options uncommitted"() { setup: ListBlobsOptions options = new ListBlobsOptions(new BlobListingDetails( - false, false, false, true), + false, false, false, true, false), null, null) String normalName = "a" + generateBlobName() String copyName = "c" + generateBlobName() @@ -667,8 +848,8 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsHierarchySegment(null, "", options) - .blockingGet().body().blobs().blob() + List blobs = cu.listBlobsHierarchySegment(null, "", options) + .blockingGet().body().segment().blobItems() then: blobs.get(0).name() == normalName @@ -676,6 +857,27 @@ class ContainerAPITest extends APISpec { blobs.size() == 4 // Normal, copy, metadata, uncommitted } + def "List blobs hier options deleted"() { + setup: + enableSoftDelete() + String name = generateBlobName() + AppendBlobURL bu = cu.createAppendBlobURL(name) + bu.create(null, null, null).blockingGet() + bu.delete(null, null).blockingGet() + + when: + List blobs = cu.listBlobsHierarchySegment(null, "", + new ListBlobsOptions(new BlobListingDetails(false, false, false, + false, true), null, null)).blockingGet() + .body().segment().blobItems() + + then: + blobs.get(0).name() == name + blobs.size() == 1 + + disableSoftDelete() == null + } + def "List blobs hier options prefix"() { setup: ListBlobsOptions options = new ListBlobsOptions(null, "a", null) @@ -686,8 +888,8 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsHierarchySegment(null, "", options) - .blockingGet().body().blobs().blob() + List blobs = cu.listBlobsHierarchySegment(null, "", options) + .blockingGet().body().segment().blobItems() then: blobs.get(0).name() == normalName @@ -697,7 +899,8 @@ class ContainerAPITest extends APISpec { def "List blobs hier options maxResults"() { setup: ListBlobsOptions options = new ListBlobsOptions(new BlobListingDetails( - true, false, false, true), null, 1) + true, false, false, true, false), null, + 1) String normalName = "a" + generateBlobName() String copyName = "c" + generateBlobName() String metadataName = "m" + generateBlobName() @@ -705,14 +908,30 @@ class ContainerAPITest extends APISpec { setupListBlobsTest(normalName, copyName, metadataName, uncommittedName) when: - List blobs = cu.listBlobsHierarchySegment(null, "", options) - .blockingGet().body().blobs().blob() + List blobs = cu.listBlobsHierarchySegment(null, "", options) + .blockingGet().body().segment().blobItems() then: blobs.size() == 1 } - def "Container list blobs hier delim"() { + @Unroll + def "List blobs hier options fail"() { + when: + def options = new ListBlobsOptions(new BlobListingDetails(false, false, snapshots, + false, false), null, maxResults) + cu.listBlobsHierarchySegment(null, null, options) + + then: + thrown(IllegalArgumentException) + + where: + snapshots | maxResults + true | 5 + false | 0 + } + + def "List blobs hier delim"() { setup: AppendBlobURL blob = cu.createAppendBlobURL("a") blob.create(null, null, null).blockingGet() @@ -722,37 +941,37 @@ class ContainerAPITest extends APISpec { subBlob.create(null, null, null).blockingGet() when: - ContainersListBlobHierarchySegmentResponse response = + ContainerListBlobHierarchySegmentResponse response = cu.listBlobsHierarchySegment(null, "/", null).blockingGet() then: - response.body().blobs().blobPrefix().size() == 1 - response.body().blobs().blobPrefix().get(0).name() == "b/" - response.body().blobs().blob().size() == 1 - response.body().blobs().blob().get(0).name() == "a" + response.body().segment().blobPrefixes().size() == 1 + response.body().segment().blobPrefixes().get(0).name() == "b/" + response.body().segment().blobItems().size() == 1 + response.body().segment().blobItems().get(0).name() == "a" } - def "Container list blobs hier marker"() { + def "List blobs hier marker"() { setup: for (int i = 0; i < 10; i++) { PageBlobURL bu = cu.createPageBlobURL(generateBlobName()) bu.create(512, null, null, null, null).blockingGet() } - ContainersListBlobHierarchySegmentResponse response = cu.listBlobsHierarchySegment(null, "/", + ContainerListBlobHierarchySegmentResponse response = cu.listBlobsHierarchySegment(null, "/", new ListBlobsOptions(null, null, 6)) .blockingGet() String marker = response.body().nextMarker() - int firstSegmentSize = response.body().blobs().blob().size() + int firstSegmentSize = response.body().segment().blobItems().size() response = cu.listBlobsHierarchySegment(marker, "/", null).blockingGet() expect: firstSegmentSize == 6 response.body().nextMarker() == null - response.body().blobs().blob().size() == 4 + response.body().segment().blobItems().size() == 4 } - def "Container list blobs hier error"() { + def "List blobs hier error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) @@ -764,13 +983,13 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container acquire lease"() { + def "Acquire lease"() { setup: - ContainersAcquireLeaseHeaders headers = - cu.acquireLease(UUID.randomUUID().toString(), leaseTime, null).blockingGet().headers() + ContainerAcquireLeaseHeaders headers = + cu.acquireLease(proposedID, leaseTime, null).blockingGet().headers() when: - ContainersGetPropertiesHeaders properties = cu.getProperties(null).blockingGet() + ContainerGetPropertiesHeaders properties = cu.getProperties(null).blockingGet() .headers() then: @@ -787,7 +1006,7 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container acquire lease AC"() { + def "Acquire lease AC"() { setup: HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) @@ -801,23 +1020,57 @@ class ContainerAPITest extends APISpec { null | newDate } - def "Container acquier lease error"() { + @Unroll + def "Acquire lease AC fail"() { + setup: + HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) + + when: + cu.acquireLease(null, -1, hac).blockingGet() + + then: + thrown(StorageException) + + where: + modified | unmodified + newDate | null + null | oldDate + } + + @Unroll + def "Acquire lease AC illegal"() { + setup: + HTTPAccessConditions hac = new HTTPAccessConditions(null, null, match, noneMatch) + + when: + cu.acquireLease(null, -1, hac).blockingGet() + + then: + thrown(IllegalArgumentException) + + where: + match | noneMatch + receivedEtag | null + null | garbageEtag + } + + def "Acquire lease error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) when: - cu.acquireLease(null, 50,null).blockingGet() + cu.acquireLease(null, 50, null).blockingGet() then: thrown(StorageException) } - def "Container renew lease"() { + def "Renew lease"() { setup: String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) Thread.sleep(16000) // Wait for the lease to expire to ensure we are actually renewing it - ContainersRenewLeaseHeaders headers = cu.renewLease(leaseID, null).blockingGet().headers() + ContainerRenewLeaseHeaders headers = cu.renewLease(leaseID, null).blockingGet().headers() expect: cu.getProperties(null).blockingGet().headers().leaseState() == LeaseStateType.LEASED @@ -826,7 +1079,7 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container renew lease AC"() { + def "Renew lease AC"() { setup: String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) @@ -841,7 +1094,42 @@ class ContainerAPITest extends APISpec { null | newDate } - def "Container renew lease error"() { + @Unroll + def "Renew lease AC fail"() { + setup: + String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) + HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) + + when: + cu.renewLease(leaseID, hac).blockingGet() + + then: + thrown(StorageException) + + where: + modified | unmodified + newDate | null + null | oldDate + } + + @Unroll + def "Renew lease AC illegal"() { + setup: + HTTPAccessConditions hac = new HTTPAccessConditions(null, null, match, noneMatch) + + when: + cu.renewLease(receivedLeaseID, hac).blockingGet() + + then: + thrown(IllegalArgumentException) + + where: + match | noneMatch + receivedEtag | null + null | garbageEtag + } + + def "Renew lease error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) @@ -852,11 +1140,11 @@ class ContainerAPITest extends APISpec { thrown(StorageException) } - def "Container release lease"() { + def "Release lease"() { setup: String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) - ContainersReleaseLeaseHeaders headers = cu.releaseLease(leaseID, null).blockingGet().headers() + ContainerReleaseLeaseHeaders headers = cu.releaseLease(leaseID, null).blockingGet().headers() expect: cu.getProperties(null).blockingGet().headers().leaseState() == LeaseStateType.AVAILABLE @@ -864,7 +1152,7 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container release lease AC"() { + def "Release lease AC"() { setup: String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) @@ -879,7 +1167,43 @@ class ContainerAPITest extends APISpec { null | newDate } - def "Container release lease error"() { + @Unroll + def "Release lease AC fail"() { + setup: + String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) + HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) + + when: + cu.releaseLease(leaseID, hac).blockingGet() + + then: + thrown(StorageException) + + where: + modified | unmodified + newDate | null + null | oldDate + } + + @Unroll + def "Release lease AC illegal"() { + setup: + HTTPAccessConditions hac = new HTTPAccessConditions(null, null, match, noneMatch) + + when: + cu.releaseLease(receivedLeaseID, hac).blockingGet() + + then: + thrown(IllegalArgumentException) + + where: + match | noneMatch + receivedEtag | null + null | garbageEtag + } + + + def "Release lease error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) @@ -891,11 +1215,11 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container break lease"() { + def "Break lease"() { setup: cu.acquireLease(UUID.randomUUID().toString(), leaseTime, null).blockingGet() - ContainersBreakLeaseHeaders headers = cu.breakLease(breakPeriod, null).blockingGet().headers() + ContainerBreakLeaseHeaders headers = cu.breakLease(breakPeriod, null).blockingGet().headers() LeaseStateType state = cu.getProperties(null).blockingGet().headers().leaseState() expect: @@ -915,7 +1239,7 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container break lease AC"() { + def "Break lease AC"() { setup: setupContainerLeaseCondition(cu, receivedLeaseID) HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) @@ -930,7 +1254,42 @@ class ContainerAPITest extends APISpec { null | newDate } - def "Container break lease error"() { + @Unroll + def "Break lease AC fail"() { + setup: + setupContainerLeaseCondition(cu, receivedLeaseID) + HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) + + when: + cu.breakLease(null, hac).blockingGet() + + then: + thrown(StorageException) + + where: + modified | unmodified + newDate | null + null | oldDate + } + + @Unroll + def "Break lease AC illegal"() { + setup: + HTTPAccessConditions hac = new HTTPAccessConditions(null, null, match, noneMatch) + + when: + cu.breakLease(null, hac).blockingGet() + + then: + thrown(IllegalArgumentException) + + where: + match | noneMatch + receivedEtag | null + null | garbageEtag + } + + def "Break lease error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) @@ -941,10 +1300,10 @@ class ContainerAPITest extends APISpec { thrown(StorageException) } - def "Container change lease"() { + def "Change lease"() { setup: String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) - ContainersChangeLeaseHeaders headers = + ContainerChangeLeaseHeaders headers = cu.changeLease(leaseID, UUID.randomUUID().toString(), null) .blockingGet().headers() leaseID = headers.leaseId() @@ -955,7 +1314,7 @@ class ContainerAPITest extends APISpec { } @Unroll - def "Container change lease AC"() { + def "Change lease AC"() { setup: String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) @@ -970,19 +1329,55 @@ class ContainerAPITest extends APISpec { null | newDate } - def "Container change lease error"() { + @Unroll + def "Change lease AC fail"() { + setup: + String leaseID = setupContainerLeaseCondition(cu, receivedLeaseID) + HTTPAccessConditions hac = new HTTPAccessConditions(modified, unmodified, null, null) + + when: + cu.changeLease(leaseID, UUID.randomUUID().toString(), hac).blockingGet() + + then: + thrown(StorageException) + + where: + modified | unmodified + newDate | null + null | oldDate + } + + @Unroll + def "Change lease AC illegal"() { + setup: + HTTPAccessConditions hac = new HTTPAccessConditions(null, null, match, noneMatch) + + when: + cu.changeLease(receivedLeaseID, garbageLeaseID, hac).blockingGet() + + then: + thrown(IllegalArgumentException) + + where: + match | noneMatch + receivedEtag | null + null | garbageEtag + } + + def "Change lease error"() { setup: cu = primaryServiceURL.createContainerURL(generateContainerName()) when: - cu.changeLease("id", "id",null).blockingGet() + cu.changeLease("id", "id", null).blockingGet() then: thrown(StorageException) } @Unroll - def "Container create URL special chars"() { + def "Create URL special chars"() { + // This test checks that we encode special characters in blob names correctly. setup: AppendBlobURL bu2 = cu.createAppendBlobURL(name) PageBlobURL bu3 = cu.createPageBlobURL(name + "2") @@ -998,7 +1393,8 @@ class ContainerAPITest extends APISpec { null, null, null).blockingGet().statusCode() == 201 when: - List blobs = cu.listBlobsFlatSegment(null, null).blockingGet().body().blobs().blob() + List blobs = cu.listBlobsFlatSegment(null, null).blockingGet() + .body().segment().blobItems() then: blobs.get(0).name() == name @@ -1015,30 +1411,53 @@ class ContainerAPITest extends APISpec { "!*'();:@&=+\$,/?#[]" | _ } - def "Container root explicit"() { + def "Root explicit"() { setup: - cu = primaryServiceURL.createContainerURL("\$root") + cu = primaryServiceURL.createContainerURL(ContainerURL.ROOT_CONTAINER_NAME) BlobURL bu = cu.createAppendBlobURL("rootblob") expect: bu.create(null, null, null).blockingGet().statusCode() == 201 } - def "Container root implicit"() { + def "Root implicit"() { setup: PipelineOptions po = new PipelineOptions() po.client = getHttpClient() HttpPipeline pipeline = StorageURL.createPipeline(primaryCreds, po) - AppendBlobURL bu = new AppendBlobURL(new URL("http://xclientdev3.blob.core.windows.net/rootblob"), pipeline) + AppendBlobURL bu = new AppendBlobURL(new URL("http://xclientdev3.blob.core.windows.net/rootblob"), + pipeline) when: - AppendBlobsCreateResponse createResponse = bu.create(null, null, null) + AppendBlobCreateResponse createResponse = bu.create(null, null, null) .blockingGet() - BlobsGetPropertiesResponse propsResponse = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse propsResponse = bu.getProperties(null).blockingGet() then: createResponse.statusCode() == 201 propsResponse.statusCode() == 200 propsResponse.headers().blobType() == BlobType.APPEND_BLOB } + + def "With pipeline"() { + setup: + ContainerURL withPipeline = cu.withPipeline(HttpPipeline.build(new RequestPolicyFactory() { + @Override + RequestPolicy create(RequestPolicy requestPolicy, RequestPolicyOptions requestPolicyOptions) { + return new RequestPolicy() { + @Override + Single sendAsync(HttpRequest httpRequest) { + return Single.error(new Exception("Expected error")) + } + } + } + })) + + when: + withPipeline.create(null, null).blockingGet() + + then: + def e = thrown(Exception) + e.getMessage().contains("Expected error") + } } diff --git a/src/test/java/com/microsoft/azure/storage/PageBlobAPITest.groovy b/src/test/java/com/microsoft/azure/storage/PageBlobAPITest.groovy index 882b968f7..8da0fc83c 100644 --- a/src/test/java/com/microsoft/azure/storage/PageBlobAPITest.groovy +++ b/src/test/java/com/microsoft/azure/storage/PageBlobAPITest.groovy @@ -24,19 +24,18 @@ import com.microsoft.azure.storage.blob.Metadata import com.microsoft.azure.storage.blob.PageBlobAccessConditions import com.microsoft.azure.storage.blob.PageBlobURL import com.microsoft.azure.storage.blob.StorageException -import com.microsoft.azure.storage.blob.models.Blob -import com.microsoft.azure.storage.blob.models.BlobsGetPropertiesResponse -import com.microsoft.azure.storage.blob.models.PageBlobsClearPagesHeaders -import com.microsoft.azure.storage.blob.models.PageBlobsCopyIncrementalHeaders -import com.microsoft.azure.storage.blob.models.PageBlobsCreateResponse -import com.microsoft.azure.storage.blob.models.PageBlobsGetPageRangesDiffHeaders -import com.microsoft.azure.storage.blob.models.PageBlobsGetPageRangesDiffResponse -import com.microsoft.azure.storage.blob.models.PageBlobsGetPageRangesHeaders -import com.microsoft.azure.storage.blob.models.PageBlobsGetPageRangesResponse -import com.microsoft.azure.storage.blob.models.PageBlobsResizeHeaders -import com.microsoft.azure.storage.blob.models.PageBlobsUpdateSequenceNumberHeaders -import com.microsoft.azure.storage.blob.models.PageBlobsUploadPagesHeaders -import com.microsoft.azure.storage.blob.models.PageBlobsUploadPagesResponse +import com.microsoft.azure.storage.blob.models.BlobGetPropertiesResponse +import com.microsoft.azure.storage.blob.models.PageBlobClearPagesHeaders +import com.microsoft.azure.storage.blob.models.PageBlobCopyIncrementalHeaders +import com.microsoft.azure.storage.blob.models.PageBlobCreateResponse +import com.microsoft.azure.storage.blob.models.PageBlobGetPageRangesDiffHeaders +import com.microsoft.azure.storage.blob.models.PageBlobGetPageRangesDiffResponse +import com.microsoft.azure.storage.blob.models.PageBlobGetPageRangesHeaders +import com.microsoft.azure.storage.blob.models.PageBlobGetPageRangesResponse +import com.microsoft.azure.storage.blob.models.PageBlobResizeHeaders +import com.microsoft.azure.storage.blob.models.PageBlobUpdateSequenceNumberHeaders +import com.microsoft.azure.storage.blob.models.PageBlobUploadPagesHeaders +import com.microsoft.azure.storage.blob.models.PageBlobUploadPagesResponse import com.microsoft.azure.storage.blob.models.PageRange import com.microsoft.azure.storage.blob.models.PublicAccessType import com.microsoft.azure.storage.blob.models.SequenceNumberActionType @@ -59,7 +58,7 @@ class PageBlobAPITest extends APISpec { bu = cu.createPageBlobURL(generateBlobName()) when: - PageBlobsCreateResponse response = + PageBlobCreateResponse response = bu.create(512, null, null, null, null).blockingGet() then: @@ -85,7 +84,7 @@ class PageBlobAPITest extends APISpec { when: bu.create(512, null, headers, null, null).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: validateBlobHeaders(response.headers(), cacheControl, contentDisposition, contentEncoding, contentLanguage, @@ -111,7 +110,7 @@ class PageBlobAPITest extends APISpec { when: bu.create(512, null, null, metadata, null).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: response.statusCode() == 200 @@ -158,9 +157,9 @@ class PageBlobAPITest extends APISpec { def "Page blob upload page"() { when: - PageBlobsUploadPagesResponse response = bu.uploadPages(new PageRange().withStart(0).withEnd(511), + PageBlobUploadPagesResponse response = bu.uploadPages(new PageRange().withStart(0).withEnd(511), Flowable.just(getRandomData(512)), null).blockingGet() - PageBlobsUploadPagesHeaders headers = response.headers() + PageBlobUploadPagesHeaders headers = response.headers() then: response.statusCode() == 201 @@ -217,7 +216,7 @@ class PageBlobAPITest extends APISpec { Flowable.just(getRandomData(512)), null).blockingGet() when: - PageBlobsClearPagesHeaders headers = + PageBlobClearPagesHeaders headers = bu.clearPages(new PageRange().withStart(0).withEnd(511), null) .blockingGet().headers() @@ -273,9 +272,9 @@ class PageBlobAPITest extends APISpec { Flowable.just(getRandomData(512)), null).blockingGet() when: - PageBlobsGetPageRangesResponse response = + PageBlobGetPageRangesResponse response = bu.getPageRanges(new BlobRange(0, 512), null).blockingGet() - PageBlobsGetPageRangesHeaders headers = response.headers() + PageBlobGetPageRangesHeaders headers = response.headers() then: response.statusCode() == 200 @@ -328,9 +327,9 @@ class PageBlobAPITest extends APISpec { Flowable.just(getRandomData(512)), null).blockingGet() when: - PageBlobsGetPageRangesDiffResponse response = + PageBlobGetPageRangesDiffResponse response = bu.getPageRangesDiff(new BlobRange(0, 512), snapshot, null).blockingGet() - PageBlobsGetPageRangesDiffHeaders headers = response.headers() + PageBlobGetPageRangesDiffHeaders headers = response.headers() then: response.body().pageRange().size() == 1 @@ -378,7 +377,7 @@ class PageBlobAPITest extends APISpec { def "Page blob resize"() { setup: - PageBlobsResizeHeaders headers = bu.resize(1024, null).blockingGet().headers() + PageBlobResizeHeaders headers = bu.resize(1024, null).blockingGet().headers() expect: bu.getProperties(null).blockingGet().headers().contentLength() == 1024 @@ -425,7 +424,7 @@ class PageBlobAPITest extends APISpec { def "Page blob sequence number"() { setup: - PageBlobsUpdateSequenceNumberHeaders headers = + PageBlobUpdateSequenceNumberHeaders headers = bu.updateSequenceNumber(SequenceNumberActionType.UPDATE, 5, null) .blockingGet().headers() @@ -478,7 +477,7 @@ class PageBlobAPITest extends APISpec { cu.setAccessPolicy(PublicAccessType.BLOB, null, null).blockingGet() PageBlobURL bu2 = cu.createPageBlobURL(generateBlobName()) String snapshot = bu.createSnapshot(null, null).blockingGet().headers().snapshot() - PageBlobsCopyIncrementalHeaders headers = bu2.copyIncremental(bu.toURL(), snapshot, null) + PageBlobCopyIncrementalHeaders headers = bu2.copyIncremental(bu.toURL(), snapshot, null) .blockingGet().headers() expect: diff --git a/src/test/java/com/microsoft/azure/storage/RetryReaderMockFlowable.java b/src/test/java/com/microsoft/azure/storage/RetryReaderMockFlowable.java index 163933db4..6d41fa1a1 100644 --- a/src/test/java/com/microsoft/azure/storage/RetryReaderMockFlowable.java +++ b/src/test/java/com/microsoft/azure/storage/RetryReaderMockFlowable.java @@ -17,7 +17,7 @@ import com.microsoft.azure.storage.blob.ETag; import com.microsoft.azure.storage.blob.RetryReader; -import com.microsoft.azure.storage.blob.models.BlobsDownloadHeaders; +import com.microsoft.azure.storage.blob.models.BlobDownloadHeaders; import com.microsoft.azure.storage.blob.models.StorageErrorException; import com.microsoft.rest.v2.RestResponse; import com.microsoft.rest.v2.http.HttpHeaders; @@ -168,8 +168,8 @@ protected void subscribeActual(Subscriber s) { public Single>> getter(RetryReader.HTTPGetterInfo info) { this.tryNumber++; this.info = info; - RestResponse> response = - new RestResponse<>(200, new BlobsDownloadHeaders(), new HashMap<>(), this); + RestResponse> response = + new RestResponse<>(null,200, new BlobDownloadHeaders(), new HashMap<>(), this); switch(this.scenario) { case RR_TEST_SCENARIO_ERROR_GETTER_INITIAL: diff --git a/src/test/java/com/microsoft/azure/storage/Samples.java b/src/test/java/com/microsoft/azure/storage/Samples.java index 37b3e243e..7c0ec5400 100644 --- a/src/test/java/com/microsoft/azure/storage/Samples.java +++ b/src/test/java/com/microsoft/azure/storage/Samples.java @@ -21,6 +21,7 @@ import com.microsoft.rest.v2.http.HttpPipeline; import com.microsoft.rest.v2.http.HttpPipelineLogLevel; import com.microsoft.rest.v2.http.HttpPipelineLogger; +import com.microsoft.rest.v2.http.HttpResponse; import com.microsoft.rest.v2.util.FlowableUtil; import io.reactivex.*; import io.reactivex.Observable; @@ -35,12 +36,12 @@ import java.nio.ByteBuffer; import java.nio.channels.AsynchronousFileChannel; import java.nio.channels.FileChannel; +import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.security.InvalidKeyException; import java.time.OffsetDateTime; import java.util.*; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import java.util.logging.Level; import java.util.logging.Logger; @@ -66,7 +67,7 @@ public void basicExample() throws InvalidKeyException, MalformedURLException { SharedKeyCredentials credential = new SharedKeyCredentials(accountName, accountKey); /* - Create a request pipeline that is used to process HTTP(S) requests and responses. It requires your accont + Create a request pipeline that is used to process HTTP(S) requests and responses. It requires your account credentials. In more advanced scenarios, you can configure telemetry, retry policies, logging, and other options. Also you can configure multiple pipelines for different scenarios. */ @@ -103,24 +104,24 @@ Create a request pipeline that is used to process HTTP(S) requests and responses // Create the container on the service (with no metadata and no public access) containerURL.create(null, null) - .flatMap(containersCreateResponse -> + .flatMap(containerCreateResponse -> /* Create the blob with string (plain text) content. NOTE: It is imperative that the provided length matches the actual length exactly. */ blobURL.upload(Flowable.just(ByteBuffer.wrap(data.getBytes())), data.length(), null, null, null)) - .flatMap(blobsDownloadResponse -> + .flatMap(blobUploadResponse -> // Download the blob's content. blobURL.download(null, null, false)) - .flatMap(blobsDownloadResponse -> - // Verify that the blob data round-tripped correctly. - FlowableUtil.collectBytesInBuffer(blobsDownloadResponse.body()) - .doOnSuccess(byteBuffer -> { - if (byteBuffer.compareTo(ByteBuffer.wrap(data.getBytes())) != 0) { - throw new Exception("The downloaded data does not match the uploaded data."); - } - })) + .flatMap(blobDownloadResponse -> + // Verify that the blob data round-tripped correctly. + FlowableUtil.collectBytesInBuffer(blobDownloadResponse.body()) + .doOnSuccess(byteBuffer -> { + if (byteBuffer.compareTo(ByteBuffer.wrap(data.getBytes())) != 0) { + throw new Exception("The downloaded data does not match the uploaded data."); + } + })) .flatMap(byteBuffer -> /* List the blob(s) in our container; since a container may hold millions of blobs, this is done @@ -128,13 +129,13 @@ Create the blob with string (plain text) content. */ containerURL.listBlobsFlatSegment(null, new ListBlobsOptions(null, null, 1))) - .flatMap(containersListBlobFlatSegmentResponse -> + .flatMap(containerListBlobFlatSegmentResponse -> // The asynchronous requests require we use recursion to continue our listing. - listBlobsHelper(containerURL, containersListBlobFlatSegmentResponse)) - .flatMap(containersListBlobFlatSegmentResponse -> + listBlobsFlatHelper(containerURL, containerListBlobFlatSegmentResponse)) + .flatMap(containerListBlobFlatSegmentResponse -> // Delete the blob we created earlier. blobURL.delete(null, null)) - .flatMap(blobsDeleteResponse -> + .flatMap(blobDeleteResponse -> // Delete the container we created earlier. containerURL.delete(null)) /* @@ -145,12 +146,13 @@ Create the blob with string (plain text) content. .blockingGet(); } - public Single listBlobsHelper( - ContainerURL containerURL, ContainersListBlobFlatSegmentResponse response) { + // + public Single listBlobsFlatHelper( + ContainerURL containerURL, ContainerListBlobFlatSegmentResponse response) { // Process the blobs returned in this result segment (if the segment is empty, blob() will be null. - if (response.body().blobs().blob() != null) { - for (Blob b : response.body().blobs().blob()) { + if (response.body().segment().blobItems() != null) { + for (BlobItem b : response.body().segment().blobItems()) { String output = "Blob name: " + b.name(); if (b.snapshot() != null) { output += ", Snapshot: " + b.snapshot(); @@ -176,9 +178,87 @@ public Single listBlobsHelper( return containerURL.listBlobsFlatSegment(nextMarker, new ListBlobsOptions(null, null, 1)) .flatMap(containersListBlobFlatSegmentResponse -> - listBlobsHelper(containerURL, containersListBlobFlatSegmentResponse)); + listBlobsFlatHelper(containerURL, containersListBlobFlatSegmentResponse)); + } + } + // + + // + public Single listBlobsHierarchyHelper( + ContainerURL containerURL, ContainerListBlobHierarchySegmentResponse response) { + + // Process the blobs returned in this result segment (if the segment is empty, blob() will be null. + if (response.body().segment().blobItems() != null) { + for (BlobItem b : response.body().segment().blobItems()) { + String output = "Blob name: " + b.name(); + if (b.snapshot() != null) { + output += ", Snapshot: " + b.snapshot(); + } + System.out.println(output); + } + } + + // Process the blobsPrefixes returned in this result segment + if (response.body().segment().blobPrefixes() != null) { + for (BlobPrefix bp : response.body().segment().blobPrefixes()) { + // Process the prefixes. + } + } + + // If there is not another segment, return this response as the final response. + if (response.body().nextMarker() == null) { + return Single.just(response); + } else { + /* + IMPORTANT: ListBlobHierarchySegment returns the start of the next segment; you MUST use this to get the + next segment (after processing the current result segment + */ + String nextMarker = response.body().nextMarker(); + + /* + The presence of the marker indicates that there are more blobs to list, so we make another call to + listBlobsHierarchySegment and pass the result through this helper function. + */ + return containerURL.listBlobsHierarchySegment(nextMarker, response.body().delimiter(), + new ListBlobsOptions(null, null,1)) + .flatMap(containersListBlobHierarchySegmentResponse -> + listBlobsHierarchyHelper(containerURL, containersListBlobHierarchySegmentResponse)); } } + // + + // + public Single listContainersHelper( + ServiceURL serviceURL, ServiceListContainersSegmentResponse response) { + + // Process the containers returned in this result segment (if the segment is empty, containerItems will be null. + if (response.body().containerItems() != null) { + for (ContainerItem b : response.body().containerItems()) { + String output = "Container name: " + b.name(); + System.out.println(output); + } + } + + // If there is not another segment, return this response as the final response. + if (response.body().nextMarker() == null) { + return Single.just(response); + } else { + /* + IMPORTANT: ListContainersSegment returns the start of the next segment; you MUST use this to get the + next segment (after processing the current result segment + */ + String nextMarker = response.body().nextMarker(); + + /* + The presence of the marker indicates that there are more blobs to list, so we make another call to + listContainersSegment and pass the result through this helper function. + */ + return serviceURL.listContainersSegment(nextMarker, ListContainersOptions.DEFAULT) + .flatMap(containersListBlobHierarchySegmentResponse -> + listContainersHelper(serviceURL, response)); + } + } + // // This example shows how you can configure a pipeline for making HTTP requests to the Azure Storage blob Service. @Test @@ -287,8 +367,48 @@ public void log(HttpPipelineLogLevel httpPipelineLogLevel, String s, Object... o } @Test - public void exampleStorageError() { - // TODO: Once we add better error code support. + /* + * This example shows how to handle errors thrown by various XxxURL methods. Any client-side error will be + * propagated unmodified. However, any response from the service with an unexpected status code will be wrapped in a + * StorageException. If the pipeline includes the RequestRetryFactory, which is the default, some of these errors + * will be automatically retried if it makes sense to do so. The StorageException type exposes rich error + * information returned by the service. + */ + public void exampleStorageError() throws MalformedURLException { + ContainerURL containerURL = new ContainerURL(new URL("http://myaccount.blob.core.windows.net/mycontainer"), + StorageURL.createPipeline(new AnonymousCredentials(), new PipelineOptions())); + + containerURL.create(null, null) + // An error occurred. + .onErrorResumeNext(throwable -> { + // Check if this error is from the service. + if (throwable instanceof StorageException) { + StorageException exception = (StorageException) throwable; + // StorageErrorCode defines constants corresponding to all error codes returned by the service. + if (exception.errorCode() + == StorageErrorCode.CONTAINER_BEING_DELETED) { + // Log more detailed information. + System.out.println("Extended details: " + exception.message()); + + // Examine the raw response. + HttpResponse response = exception.response(); + } + else if (exception.errorCode() + == StorageErrorCode.CONTAINER_ALREADY_EXISTS) { + // Process the error + } + } + // We just fake a successful response to prevent the example from crashing. + return Single.just( + new ContainerCreateResponse(null,200, null, null, + null)); + }) + /* + This will synchronize all the above operations. This is strongly discouraged for use in production as + it eliminates the benefits of asynchronous IO. We use it here to enable the sample to complete and + demonstrate its effectiveness. + */ + .blockingGet(); } /* @@ -487,7 +607,7 @@ public void exampleContainerURL_SetPermissions() throws InvalidKeyException, Mal blobURL.upload(Flowable.just(ByteBuffer.wrap(data.getBytes())), data.length(), null, null, null) ) - .flatMap(blockBlobsUploadResponse -> + .flatMap(blockBlobUploadResponse -> // Attempt to read the blob with anonymous credentials. anonymousURL.download(null, null, false) ) @@ -515,7 +635,7 @@ public void exampleContainerURL_SetPermissions() throws InvalidKeyException, Mal // Now this will work. .andThen(anonymousURL.download(null, null, false)) - .flatMap(blobsDownloadResponse -> + .flatMap(blobDownloadResponse -> // Delete the container and the blob within in. containerURL.delete(null)) /* @@ -546,14 +666,14 @@ public void exampleBlobAccessConditions() throws MalformedURLException, InvalidK // Create the blob (unconditionally; succeeds) blobURL.upload(Flowable.just(ByteBuffer.wrap("Text-1".getBytes())), "Text-1".length(), null, null, null)) - .flatMap(blockBlobsUploadResponse -> { - System.out.println("Success: " + blockBlobsUploadResponse.statusCode()); + .flatMap(blockBlobUploadResponse -> { + System.out.println("Success: " + blockBlobUploadResponse.statusCode()); // Download blob content if the blob has been modified since we uploaded it (fails). return blobURL.download(null, new BlobAccessConditions( new HTTPAccessConditions( - blockBlobsUploadResponse.headers().lastModified(), + blockBlobUploadResponse.headers().lastModified(), null, null, null), @@ -615,8 +735,8 @@ public void exampleBlobAccessConditions() throws MalformedURLException, InvalidK null, null)) ) - .flatMap(blockBlobsUploadResponse -> { - System.out.println("Success: " + blockBlobsUploadResponse.statusCode()); + .flatMap(blockBlobUploadResponse -> { + System.out.println("Success: " + blockBlobUploadResponse.statusCode()); // Download content if it has changed since the version identified by ETag (fails): return blobURL.download(null, @@ -625,7 +745,7 @@ public void exampleBlobAccessConditions() throws MalformedURLException, InvalidK null, null, null, - new ETag(blockBlobsUploadResponse.headers().eTag()) + new ETag(blockBlobUploadResponse.headers().eTag()) ), null, null, @@ -655,8 +775,8 @@ public void exampleBlobAccessConditions() throws MalformedURLException, InvalidK null) ) ) - .flatMap(blobsDeleteResponse -> { - System.out.println("Success: " + blobsDeleteResponse.statusCode()); + .flatMap(blobDeleteResponse -> { + System.out.println("Success: " + blobDeleteResponse.statusCode()); return containerURL.delete(null); }) /* @@ -788,6 +908,7 @@ public void exampleBlobHTTPHeaders() throws MalformedURLException, InvalidKeyExc URL u = new URL(String.format(Locale.ROOT, "https://%s.blob.core.windows.net/", accountName)); ServiceURL s = new ServiceURL(u, StorageURL.createPipeline(new SharedKeyCredentials(accountName, accountKey), new PipelineOptions())); + ContainerURL containerURL = s.createContainerURL("myjavacontainerheaders"); BlockBlobURL blobURL = containerURL.createBlockBlobURL("Data.txt"); @@ -867,18 +988,17 @@ public void exampleBlockBlobURL() throws MalformedURLException, InvalidKeyExcept URL u = new URL(String.format(Locale.ROOT, "https://%s.blob.core.windows.net/", accountName)); ServiceURL s = new ServiceURL(u, StorageURL.createPipeline(new SharedKeyCredentials(accountName, accountKey), new PipelineOptions())); + ContainerURL containerURL = s.createContainerURL("myjavacontainerblock"); BlockBlobURL blobURL = containerURL.createBlockBlobURL("Data.txt"); String[] data = {"Michael", "Gabriel", "Raphael", "John"}; // Create the container. We convert to an Observable to be able to work with the block list effectively. - containerURL.create(null, null).toObservable() - .flatMap(response -> + containerURL.create(null, null) + .flatMapObservable(response -> // Create an Observable that will yield each of the Strings one at a time. - Observable.fromIterable(Arrays.asList(data)) - ) - // Items emitted by an Observable that results from a concatMap call will preserve the original order. + Observable.fromIterable(Arrays.asList(data))) .concatMap(block -> { /* Generate a base64 encoded blockID. Note that all blockIDs must be the same length. It is generally @@ -902,43 +1022,22 @@ public void exampleBlockBlobURL() throws MalformedURLException, InvalidKeyExcept }) // Gather all of the IDs emitted by the previous observable into a single list. .collectInto(new ArrayList<>(data.length), (BiConsumer, String>) ArrayList::add) - .flatMap(idList -> + .flatMap(idList -> { /* By this point, all the blocks are upload and we have an ordered list of their IDs. Here, we atomically commit the whole list. NOTE: The block list order need not match the order in which the blocks were uploaded. The order of IDs in the commitBlockList call will determine the structure of the blob. */ - blobURL.commitBlockList(idList, null, null, null)) + return blobURL.commitBlockList(idList, null, null, null); + }) .flatMap(response -> /* For the blob, show each block (ID and size) that is a committed part of it. It is also possible to include blocks that have been staged but not committed. */ blobURL.getBlockList(BlockListType.ALL, null)) - .flatMap(response -> { - for (Block block : response.body().committedBlocks()) { - System.out.println(String.format(Locale.ROOT, "Block ID=%s, Size=%d", block.name(), - block.size())); - } - - /* - Download the blob in its entirety; download operations do not take blocks into account. - NOTE: For really large blobs, downloading them like this allocates a lot of memory. - */ - return blobURL.download(null, null, false); - }) - .flatMap(response -> - // Print out the data. - FlowableUtil.collectBytesInBuffer(response.body()) - .doOnSuccess(bytes -> - System.out.println(new String(bytes.array()))) - ) - .flatMap(response -> - // Delete the container. - containerURL.delete(null) - ) - /* + /* This will synchronize all the above operations. This is strongly discouraged for use in production as it eliminates the benefits of asynchronous IO. We use it here to enable the sample to complete and demonstrate its effectiveness. @@ -952,7 +1051,7 @@ This example shows how to append data (in blocks) to an append blob. An append b 4.75TB (100MB X 50,000 blocks). */ @Test - public void exmapleAppendBlobURL() throws MalformedURLException, InvalidKeyException { + public void exampleAppendBlobURL() throws MalformedURLException, InvalidKeyException { // From the Azure portal, get your Storage account's name and account key. String accountName = getAccountName(); String accountKey = getAccountKey(); @@ -961,6 +1060,7 @@ public void exmapleAppendBlobURL() throws MalformedURLException, InvalidKeyExcep URL u = new URL(String.format(Locale.ROOT, "https://%s.blob.core.windows.net/", accountName)); ServiceURL s = new ServiceURL(u, StorageURL.createPipeline(new SharedKeyCredentials(accountName, accountKey), new PipelineOptions())); + ContainerURL containerURL = s.createContainerURL("myjavacontainerappend"); AppendBlobURL blobURL = containerURL.createAppendBlobURL("Data.txt"); @@ -1100,6 +1200,7 @@ public void example_blobSnapshot() throws MalformedURLException, InvalidKeyExcep URL u = new URL(String.format(Locale.ROOT, "https://%s.blob.core.windows.net/", accountName)); ServiceURL s = new ServiceURL(u, StorageURL.createPipeline(new SharedKeyCredentials(accountName, accountKey), new PipelineOptions())); + ContainerURL containerURL = s.createContainerURL("myjavacontainersnapshot"); BlockBlobURL blobURL = containerURL.createBlockBlobURL("Original.txt"); @@ -1148,7 +1249,7 @@ public void example_blobSnapshot() throws MalformedURLException, InvalidKeyExcep The asynchronous requests require we use recursion to continue our listing. */ - listBlobsHelper(containerURL, response2)) + listBlobsFlatHelper(containerURL, response2)) .flatMap(response2 -> blobURL.startCopyFromURL(snapshotURL.toURL(), null, null, null)); @@ -1180,12 +1281,14 @@ public void exampleBlobURL_startCopy() throws MalformedURLException, InvalidKeyE URL u = new URL(String.format(Locale.ROOT, "https://%s.blob.core.windows.net/", accountName)); ServiceURL s = new ServiceURL(u, StorageURL.createPipeline(new SharedKeyCredentials(accountName, accountKey), new PipelineOptions())); + ContainerURL containerURL = s.createContainerURL("myjavacontainercopy"); BlockBlobURL blobURL = containerURL.createBlockBlobURL("CopiedBlob.bin"); // Create the container. containerURL.create(null, null) .flatMap(response -> + // Start the copy from the source url to the destination, which is the url pointed to by blobURL blobURL.startCopyFromURL( new URL("https://cdn2.auth0.com/docs/media/addons/azure_blob.svg"), null, null, null)) @@ -1205,7 +1308,8 @@ public void exampleBlobURL_startCopy() throws MalformedURLException, InvalidKeyE } - public Single waitForCopyHelper(BlobURL blobURL, BlobsGetPropertiesResponse response) + // + public Single waitForCopyHelper(BlobURL blobURL, BlobGetPropertiesResponse response) throws InterruptedException { System.out.println(response.headers().copyStatus()); if (response.headers().copyStatus() == CopyStatusType.SUCCESS) { @@ -1218,6 +1322,7 @@ public Single waitForCopyHelper(BlobURL blobURL, Blo waitForCopyHelper(blobURL, response1)); } + // // This example shows how to copy a large file in blocks (chunks) to a block blob. @Test @@ -1247,7 +1352,7 @@ public void exampleUploadFileToBlockBlob() throws IOException, InvalidKeyExcepti .flatMap(response -> { FileChannel channel = FileChannel.open(tempFile.toPath(), StandardOpenOption.READ); return TransferManager.uploadFileToBlockBlob(channel, blobURL, - BlockBlobURL.MAX_PUT_BLOCK_BYTES, null) + BlockBlobURL.MAX_STAGE_BLOCK_BYTES, null) .doAfterTerminate(channel::close); }) .flatMap(response -> @@ -1298,7 +1403,7 @@ Passing RetryReaderOptions to a call to body() will ensure the download stream i .flatMap(response -> // Upload some data to a blob TransferManager.uploadByteBufferToBlockBlob(ByteBuffer.wrap("Data".getBytes()), blobURL, - BlockBlobURL.MAX_PUT_BLOCK_BYTES, TransferManager.UploadToBlockBlobOptions.DEFAULT)) + BlockBlobURL.MAX_STAGE_BLOCK_BYTES, TransferManager.UploadToBlockBlobOptions.DEFAULT)) .flatMap(response -> blobURL.download(null, null, false)) .flatMapPublisher(response -> @@ -1422,24 +1527,24 @@ public void exampleLazyEnumeration() throws MalformedURLException, InvalidKeyExc .blockingGet(); } - public static Observable listBlobsLazy(ContainerURL containerURL, ListBlobsOptions listBlobsOptions) + public static Observable listBlobsLazy(ContainerURL containerURL, ListBlobsOptions listBlobsOptions) { return containerURL.listBlobsFlatSegment(null, listBlobsOptions) .flatMapObservable((r) -> listContainersResultToContainerObservable(containerURL, listBlobsOptions, r)); } - private static Observable listContainersResultToContainerObservable( + private static Observable listContainersResultToContainerObservable( ContainerURL containerURL, ListBlobsOptions listBlobsOptions, - ContainersListBlobFlatSegmentResponse response) + ContainerListBlobFlatSegmentResponse response) { - Observable result = Observable.fromIterable(response.body().blobs().blob()); + Observable result = Observable.fromIterable(response.body().segment().blobItems()); - System.out.println("!!! count: " + response.body().blobs().blob().size()); + System.out.println("!!! count: " + response.body().segment().blobItems()); if (response.body().nextMarker() != null) { - System.out.println("Hit continuation in listing at " + response.body().blobs().blob().get( - response.body().blobs().blob().size()-1).name()); + System.out.println("Hit continuation in listing at " + response.body().segment().blobItems().get( + response.body().segment().blobItems().size()-1).name()); // Recursively add the continuation items to the observable. result = result.concatWith(containerURL.listBlobsFlatSegment(response.body().nextMarker(), listBlobsOptions) .flatMapObservable((r) -> @@ -1449,5 +1554,640 @@ private static Observable listContainersResultToContainerObservable( return result; } + /* + The following is just used a place for quick code snippets that will be included in online documentation. This + is not meant to serve as a comprehensive example as the above examples are. + */ + public void apiRefs() throws IOException, InvalidKeyException { + // + // From the Azure portal, get your Storage account's name and account key. + String accountName = getAccountName(); + String accountKey = getAccountKey(); + + // Use your Storage account's name and key to create a credential object; this is used to access your account. + SharedKeyCredentials sharedKeyCredentials = new SharedKeyCredentials(accountName, accountKey); + + /* + Create a request pipeline that is used to process HTTP(S) requests and responses. It requires your account + credentials. In more advanced scenarios, you can configure telemetry, retry policies, logging, and other + options. Also you can configure multiple pipelines for different scenarios. + */ + HttpPipeline pipeline = StorageURL.createPipeline(sharedKeyCredentials, new PipelineOptions()); + + /* + From the Azure portal, get your Storage account blob service URL endpoint. + The URL typically looks like this: + */ + URL urlToBlob = new URL(String.format(Locale.ROOT, "https://%s.blob.core.windows.net", accountName)); + + // Create a ServiceURL objet that wraps the service URL and a request pipeline. + ServiceURL serviceURL = new ServiceURL(urlToBlob, pipeline); + // + + // + LoggingOptions loggingOptions = new LoggingOptions(2000); + RequestRetryOptions requestRetryOptions = new RequestRetryOptions(RetryPolicyType.EXPONENTIAL, 5, + 4, 1000L, 10000L, "secondary-host"); + PipelineOptions customOptions = new PipelineOptions(); + customOptions.loggingOptions = loggingOptions; + customOptions.requestRetryOptions = requestRetryOptions; + StorageURL.createPipeline(new AnonymousCredentials(), customOptions); + // + + // + ContainerURL containerURL = serviceURL.createContainerURL("myjavacontainerbasic"); + + BlockBlobURL blobURL = containerURL.createBlockBlobURL("HelloWorld.txt"); + AppendBlobURL appendBlobURL = containerURL.createAppendBlobURL("Data.txt"); + PageBlobURL pageBlobURL = containerURL.createPageBlobURL("pageBlob"); + + String data = "Hello world!"; + + // Create the container on the service (with no metadata and no public access) + Single downloadResponse = containerURL.create(null, null) + .flatMap(containersCreateResponse -> + /* + Create the blob with string (plain text) content. + NOTE: It is imperative that the provided length matches the actual length exactly. + */ + blobURL.upload(Flowable.just(ByteBuffer.wrap(data.getBytes())), data.length(), + null, null, null)) + .flatMap(blobUploadResponse -> + // Download the blob's content. + blobURL.download(null, null, false)); + downloadResponse.flatMap(blobDownloadResponse -> + // Verify that the blob data round-tripped correctly. + FlowableUtil.collectBytesInBuffer(blobDownloadResponse.body()) + .doOnSuccess(byteBuffer -> { + if (byteBuffer.compareTo(ByteBuffer.wrap(data.getBytes())) != 0) { + throw new Exception("The downloaded data does not match the uploaded data."); + } + })); + downloadResponse.subscribe(); + // + + // + containerURL.create(null, null) + // An error occurred. + .onErrorResumeNext(throwable -> { + // Check if this error is from the service. + if (throwable instanceof StorageException) { + StorageException exception = (StorageException) throwable; + // StorageErrorCode defines constants corresponding to all error codes returned by the service. + if (exception.errorCode() + == StorageErrorCode.CONTAINER_BEING_DELETED) { + // Log more detailed information. + System.out.println("Extended details: " + exception.message()); + + // Examine the raw response. + HttpResponse response = exception.response(); + } + else if (exception.errorCode() + == StorageErrorCode.CONTAINER_ALREADY_EXISTS) { + // Process the error + } + } + // We just fake a successful response to prevent the example from crashing. + return Single.just( + new ContainerCreateResponse(null,200, null, null, + null)); + }).subscribe(); + // + + // + /* + Start with a URL that identifies a snapshot of a blob in a container and includes a Shared Access Signature + (SAS). + */ + URL u = new URL("https://myaccount.blob.core.windows.net/mycontainter/ReadMe.txt?" + + "snapshot=2011-03-09T01:42:34.9360000Z" + + "&sv=2015-02-21&sr=b&st=2111-01-09T01:42:34Z&se=2222-03-09T01:42:34Z&sp=rw" + + "&sip=168.1.5.60-168.1.5.70&spr=https,http&si=myIdentifier&ss=bf&srt=s" + + "&sig=92836758923659283652983562=="); + + // You can parse this URL into its constituent parts: + BlobURLParts parts = URLParser.parse(u); + + // Now, we access the parts (this example prints them). + System.out.println(String.join("\n", + parts.host, + parts.containerName, + parts.blobName, + parts.snapshot)); + System.out.println(""); + SASQueryParameters sas = parts.sasQueryParameters; + System.out.println(String.join("\n", + sas.getVersion(), + sas.getResource(), + sas.getStartTime().toString(), + sas.getExpiryTime().toString(), + sas.getPermissions(), + sas.getIpRange().toString(), + sas.getProtocol().toString(), + sas.getIdentifier(), + sas.getServices(), + sas.getSignature())); + + // You can then change some of the fields and construct a new URL. + parts.sasQueryParameters = null; // Remove the SAS query parameters. + parts.snapshot = null; // Remove the snapshot timestamp. + parts.containerName = "othercontainer"; // Change the container name. + // In this example, we'll keep the blob name as it is. + + // Construct a new URL from the parts: + URL newURL = parts.toURL(); + System.out.println(newURL); + // NOTE: You can pass the new URL to the constructor for any XxxURL to manipulate the resource. + // + + // + // Use your Storage account's name and key to create a credential object; this is required to sign a SAS. + SharedKeyCredentials credential = new SharedKeyCredentials(getAccountName(), getAccountKey()); + + /* + Set the desired SAS signature values and sign them with the shared key credentials to get the SAS query + parameters. + */ + AccountSASSignatureValues values = new AccountSASSignatureValues(); + values.protocol = SASProtocol.HTTPS_ONLY; // Users MUST use HTTPS (not HTTP). + values.expiryTime = OffsetDateTime.now().plusDays(2); // 2 days before expiration. + + AccountSASPermission permission = new AccountSASPermission(); + permission.read = true; + permission.list = true; + values.permissions = permission.toString(); + + AccountSASService service = new AccountSASService(); + service.blob = true; + values.services = service.toString(); + + AccountSASResourceType resourceType = new AccountSASResourceType(); + resourceType.container = true; + resourceType.object = true; + values.resourceTypes = resourceType.toString(); + + SASQueryParameters params = values.generateSASQueryParameters(credential); + + // Calling encode will generate the query string. + String encodedParams = params.encode(); + + String urlToSendToSomeone = String.format(Locale.ROOT, "https://%s.blob.core.windows.net?%s", + getAccountName(), encodedParams); + // At this point, you can send the urlToSendSomeone to someone via email or any other mechanism you choose. + + // *************************************************************************************************** + + // When someone receives the URL, the access the SAS-protected resource with code like this: + u = new URL(urlToSendToSomeone); + + /* + Create a ServiceURL object that wraps the serviceURL (and its SAS) and a pipeline. When using SAS URLs, + AnonymousCredentials are required. + */ + ServiceURL sURL = new ServiceURL(u, + StorageURL.createPipeline(new AnonymousCredentials(), new PipelineOptions())); + // Now, you can use this serviceURL just like any other to make requests of the resource. + // + + // + // Use your Storage account's name and key to create a credential object; this is required to sign a SAS. + credential = new SharedKeyCredentials(getAccountName(), getAccountKey()); + + // This is the name of the container and blob that we're creating a SAS to. + String containerName = "mycontainer"; // Container names require lowercase. + String blobName = "HelloWorld.txt"; // Blob names can be mixed case. + + /* + Set the desired SAS signature values and sign them with the shared key credentials to get the SAS query + parameters. + */ + ServiceSASSignatureValues blobValues = new ServiceSASSignatureValues(); + blobValues.protocol = SASProtocol.HTTPS_ONLY; // Users MUST use HTTPS (not HTTP). + blobValues.expiryTime = OffsetDateTime.now().plusDays(2); // 2 days before expiration. + blobValues.containerName = containerName; + blobValues.blobName = blobName; + + /* + To produce a container SAS (as opposed to a blob SAS), assign to Permissions using ContainerSASPermissions, and + make sure the blobName field is null (the default). + */ + BlobSASPermission blobPermission = new BlobSASPermission(); + blobPermission.read = true; + blobPermission.add = true; + blobPermission.write = true; + values.permissions = blobPermission.toString(); + + SASQueryParameters serviceParams = values.generateSASQueryParameters(credential); + + // Calling encode will generate the query string. + encodedParams = serviceParams.encode(); + + urlToSendToSomeone = String.format(Locale.ROOT, "https://%s.blob.core.windows.net/%s/%s?%s", + getAccountName(), containerName, blobName, encodedParams); + // At this point, you can send the urlToSendSomeone to someone via email or any other mechanism you choose. + + // *************************************************************************************************** + + // When someone receives the URL, the access the SAS-protected resource with code like this: + u = new URL(urlToSendToSomeone); + + /* + Create a BlobURL object that wraps the blobURL (and its SAS) and a pipeline. When using SAS URLs, + AnonymousCredentials are required. + */ + BlobURL bURL = new BlobURL(u, + StorageURL.createPipeline(new AnonymousCredentials(), new PipelineOptions())); + // Now, you can use this blobURL just like any other to make requests of the resource. + // + + // + BlockBlobURL blockBlobURL = containerURL.createBlockBlobURL("Data.txt"); + + String[] blockData = {"Michael", "Gabriel", "Raphael", "John"}; + String initialBlockID = Base64.getEncoder().encodeToString( + UUID.randomUUID().toString().getBytes()); + + // Create the container. We convert to an Observable to be able to work with the block list effectively. + containerURL.create(null, null) + .flatMapObservable(response -> + // Create an Observable that will yield each of the Strings one at a time. + Observable.fromIterable(Arrays.asList(blockData)) + ) + // Items emitted by an Observable that results from a concatMap call will preserve the original order. + .concatMap(block -> { + /* + Generate a base64 encoded blockID. Note that all blockIDs must be the same length. It is generally + considered best practice to use UUIDs for the blockID. + */ + String blockId = Base64.getEncoder().encodeToString( + UUID.randomUUID().toString().getBytes()); + + /* + Upload a block to this blob specifying the BlockID and its content (up to 100MB); this block is + uncommitted. + NOTE: It is imperative that the provided length match the actual length of the data exactly. + */ + return blockBlobURL.stageBlock(blockId, Flowable.just(ByteBuffer.wrap(block.getBytes())), + block.length(), null) + /* + We do not care for any data on the response object, but we do want to keep track of the + ID. + */ + .map(x -> blockId).toObservable(); + }) + // Gather all of the IDs emitted by the previous observable into a single list. + .collectInto(new ArrayList<>(blockData.length), (BiConsumer, String>) ArrayList::add) + .flatMap(idList -> { + /* + By this point, all the blocks are upload and we have an ordered list of their IDs. Here, we + atomically commit the whole list. + NOTE: The block list order need not match the order in which the blocks were uploaded. The order + of IDs in the commitBlockList call will determine the structure of the blob. + */ + idList.add(0, initialBlockID); + return blockBlobURL.commitBlockList(idList, null, null, null); + }) + .flatMap(response -> + /* + For the blob, show each block (ID and size) that is a committed part of it. It is also possible + to include blocks that have been staged but not committed. + */ + blockBlobURL.getBlockList(BlockListType.ALL, null)) + .subscribe(); + // + + // + String blockID = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes()); + blockBlobURL.stageBlockFromURL(blockID, blobURL.toURL(), null, null, + null) + .flatMap(response -> + blockBlobURL.commitBlockList(Arrays.asList(blockID), null, null, + null)) + .subscribe(); + // + + // + + // Create the container. + containerURL.create(null, null) + .flatMap(response -> + // Create the append blob. This creates a zero-length blob that we can now append to. + appendBlobURL.create(null, null, null)) + .toObservable() + .flatMap(response -> + // This range will act as our for loop to create 5 blocks + Observable.range(0, 5)) + .concatMapCompletable(i -> { + String text = String.format(Locale.ROOT, "Appending block #%d\n", i); + return appendBlobURL.appendBlock(Flowable.just(ByteBuffer.wrap(text.getBytes())), text.length(), + null).toCompletable(); + }).subscribe(); + // + + + // + // Create the container. + containerURL.create(null, null) + .flatMap(response -> + // Create the original blob. + blobURL.upload(Flowable.just(ByteBuffer.wrap("Some text".getBytes())), "Some text".length(), + null, null, null)) + .flatMap(response -> + // Create a snapshot of the original blob. + blobURL.createSnapshot(null, null)) + .flatMap(response -> { + BlobURL snapshotURL = blobURL.withSnapshot(response.headers().snapshot()); + return snapshotURL.getProperties(null); + }).subscribe(); + // + + // + // Create the container. + containerURL.create(null, null) + .flatMap(response -> + // Start the copy from the source url to the destination, which is the url pointed to by blobURL + blobURL.startCopyFromURL( + new URL("https://cdn2.auth0.com/docs/media/addons/azure_blob.svg"), + null, null, null)) + .flatMap(response -> + blobURL.getProperties(null)) + .flatMap(response -> + waitForCopyHelper(blobURL, response)) + .subscribe(); + // + + // + containerURL.create(null, null) + .flatMap(response -> + // Start the copy from the source url to the destination, which is the url pointed to by blobURL + blobURL.startCopyFromURL( + new URL("https://cdn2.auth0.com/docs/media/addons/azure_blob.svg"), + null, null, null)) + .flatMap(response -> + blobURL.getProperties(null)) + .flatMap(response -> + blobURL.abortCopyFromURL(response.headers().copyId(), null)) + .subscribe(); + // + + // + blobURL.delete(null, null) + .subscribe(); + // + + // + // This sample assumes that the account has a delete retention policy set. + blobURL.delete(null, null) + .flatMap(response -> + blobURL.undelete()) + .subscribe(); + // + + // + // BlockBlobs and PageBlobs have different sets of tiers. + blockBlobURL.setTier(AccessTier.HOT) + .subscribe(); + pageBlobURL.setTier(AccessTier.P6) + .subscribe(); + // + + // + containerURL.create(null, null) + .flatMap(containersCreateResponse -> + /* + Create the blob with string (plain text) content. + NOTE: It is imperative that the provided length matches the actual length exactly. + */ + blobURL.upload(Flowable.just(ByteBuffer.wrap(data.getBytes())), data.length(), + null, null, null)) + .flatMap(response -> + blobURL.getProperties(null)) + .flatMap(response-> { + Metadata newMetadata = new Metadata(response.headers().metadata()); + // If one of the HTTP properties is set, all must be set again or they will be cleared. + BlobHTTPHeaders newHeaders = new BlobHTTPHeaders(response.headers().cacheControl(), + response.headers().contentDisposition(), response.headers().contentEncoding(), + "new language", response.headers().contentMD5(), "new content"); + return blobURL.setMetadata(newMetadata, null) + .flatMap(nextResponse -> blobURL.setHTTPHeaders(newHeaders, null)); + }) + .subscribe(); + // + + // + containerURL.create(null, null) + .flatMap(response -> + containerURL.getProperties(null)) + .flatMap(response -> { + Metadata metadata = new Metadata(); + metadata.put("key", "value"); + return containerURL.setMetadata(metadata, null); + }) + .flatMap(response -> + containerURL.delete(null)) + .subscribe(); + // + + // + containerURL.create(null, null) + .flatMap(response -> { + /* + Create a SignedIdentifier that gives read permissions and expires one day for now. This means that + any SAS associated with this policy has these properties. + */ + BlobSASPermission perms = new BlobSASPermission(); + perms.read = true; + SignedIdentifier id = new SignedIdentifier().withId("policy1").withAccessPolicy( + new AccessPolicy().withPermission(perms.toString()).withExpiry(OffsetDateTime.now() + .plusDays(1))); + // Give public access to the blobs in this container and apply the SignedIdentifier. + return containerURL.setAccessPolicy(PublicAccessType.BLOB, Arrays.asList(id), null); + }) + .subscribe(); + // + + // + containerURL.listBlobsFlatSegment(null, new ListBlobsOptions(null, null, + 1)) + .flatMap(containersListBlobFlatSegmentResponse -> + // The asynchronous requests require we use recursion to continue our listing. + listBlobsFlatHelper(containerURL, containersListBlobFlatSegmentResponse)) + .subscribe(); + // + + // + containerURL.listBlobsHierarchySegment(null, "my_delimiter", + new ListBlobsOptions(null, null,1)) + .flatMap(containersListBlobHierarchySegmentResponse -> + // The asynchronous requests require we use recursion to continue our listing. + listBlobsHierarchyHelper(containerURL, containersListBlobHierarchySegmentResponse)) + .subscribe(); + // + + // + containerURL.create(null, null) + .flatMap(response -> + // Create the page blob with 4 512-byte pages. + pageBlobURL.create(4 * PageBlobURL.PAGE_BYTES, null, null, + null, null)) + .flatMap(response -> { + /* + Upload data to a page. + NOTE: The page range must start on a multiple of the page size and end on + (multiple of page size) - 1. + */ + byte[] pageData = new byte[PageBlobURL.PAGE_BYTES]; + for (int i = 0; i < PageBlobURL.PAGE_BYTES; i++) { + pageData[i] = 'a'; + } + return pageBlobURL.uploadPages(new PageRange().withStart(0).withEnd(PageBlobURL.PAGE_BYTES - 1), + Flowable.just(ByteBuffer.wrap(pageData)), null); + }) + .flatMap(response -> + // Get the page ranges which have valid data. + pageBlobURL.getPageRanges(null, null)) + .flatMap(response -> { + // Print the pages that are valid. + for (PageRange range : response.body().pageRange()) { + System.out.println(String.format(Locale.ROOT, "Start=%d, End=%d\n", range.start(), + range.end())); + } + + // Clear and invalidate the first range. + return pageBlobURL.clearPages(new PageRange().withStart(0).withEnd(PageBlobURL.PAGE_BYTES - 1), + null); + }) + .flatMap(response -> + pageBlobURL.resize(1024, null)) + .flatMap(rsponse -> + pageBlobURL.updateSequenceNumber(SequenceNumberActionType.INCREMENT, null, + null)) + .subscribe(); + // + + // + pageBlobURL.create(4 * PageBlobURL.PAGE_BYTES, null, null, + null, null) + .flatMap(response -> + pageBlobURL.createSnapshot(null, null)) + .flatMap(response -> { + /* + Upload data to a page. + NOTE: The page range must start on a multiple of the page size and end on + (multiple of page size) - 1. + */ + byte[] pageData = new byte[PageBlobURL.PAGE_BYTES]; + for (int i = 0; i < PageBlobURL.PAGE_BYTES; i++) { + pageData[i] = 'a'; + } + return pageBlobURL.uploadPages(new PageRange().withStart(0).withEnd(PageBlobURL.PAGE_BYTES - 1), + Flowable.just(ByteBuffer.wrap(pageData)), null) + // We still need access to the snapshotResponse. + .flatMap(uploadResponse -> + pageBlobURL.getPageRangesDiff(null, response.headers().snapshot(), + null)); + }); + // + + // + PageBlobURL incrementalCopy = containerURL.createPageBlobURL("incremental"); + pageBlobURL.createSnapshot(null, null) + .flatMap(response -> + incrementalCopy.copyIncremental(pageBlobURL.toURL(), response.headers().snapshot(), + null)) + .flatMap(response -> { + byte[] pageData = new byte[PageBlobURL.PAGE_BYTES]; + for (int i = 0; i < PageBlobURL.PAGE_BYTES; i++) { + pageData[i] = 'a'; + } + return pageBlobURL.uploadPages(new PageRange().withStart(0).withEnd(PageBlobURL.PAGE_BYTES - 1), + Flowable.just(ByteBuffer.wrap(pageData)), null); + }) + .flatMap(response -> + pageBlobURL.createSnapshot(null, null)) + .flatMap(response -> + incrementalCopy.copyIncremental(pageBlobURL.toURL(), response.headers().snapshot(), + null)) + .subscribe(); + /* + The result is a new blob with two new snapshots that correspond to the source blob snapshots but with different + IDs. These snapshots may be read from like normal snapshots. + */ + // + + // + blobURL.acquireLease(null, 20, null) + .flatMap(response -> + blobURL.changeLease(response.headers().leaseId(), "proposed", null)) + .flatMap(response -> + blobURL.renewLease(response.headers().leaseId(), null)) + .flatMap(response -> + blobURL.breakLease(null, null) + .flatMap(breakResponse -> + blobURL.releaseLease(response.headers().leaseId(), null))) + .subscribe(); + // + + // + containerURL.acquireLease(null, 20, null) + .flatMap(response -> + containerURL.changeLease(response.headers().leaseId(), "proposed", + null)) + .flatMap(response -> + containerURL.renewLease(response.headers().leaseId(), null)) + .flatMap(response -> + containerURL.breakLease(null, null) + .flatMap(breakResponse -> + containerURL.releaseLease(response.headers().leaseId(), null))) + .subscribe(); + // + + // + List dataList = + Arrays.asList(ByteBuffer.wrap("Data1".getBytes()), ByteBuffer.wrap("Data2".getBytes())); + TransferManager.uploadByteBuffersToBlockBlob(dataList, blockBlobURL, null) + .subscribe(); + // + + // + ByteBuffer largeData = ByteBuffer.wrap("LargeData".getBytes()); + TransferManager.uploadByteBufferToBlockBlob(largeData, blockBlobURL, BlockBlobURL.MAX_STAGE_BLOCK_BYTES, + null) + .subscribe(); + // + + // + FileChannel fileChannel = FileChannel.open(Paths.get("file\\path"), StandardOpenOption.READ); + TransferManager.uploadFileToBlockBlob(fileChannel, blockBlobURL, BlockBlobURL.MAX_STAGE_BLOCK_BYTES, + null) + .subscribe(); + // + + // + serviceURL.getProperties() + .flatMap(response -> { + StorageServiceProperties newProps = response.body(); + + // Remove the delete retention policy to disable soft delete. + newProps.withDeleteRetentionPolicy(null); + + return serviceURL.setProperties(newProps); + }) + .subscribe(); + // + + // + serviceURL.getStatistics() + .subscribe(); + // + + // + serviceURL.listContainersSegment(null, ListContainersOptions.DEFAULT) + .flatMap(listContainersSegmentResponse -> + // The asynchronous requests require we use recursion to continue our listing. + listContainersHelper(serviceURL, listContainersSegmentResponse)) + .subscribe(); + // + } } diff --git a/src/test/java/com/microsoft/azure/storage/ServiceAPITest.groovy b/src/test/java/com/microsoft/azure/storage/ServiceAPITest.groovy index a88c2c434..73e7bcb6a 100644 --- a/src/test/java/com/microsoft/azure/storage/ServiceAPITest.groovy +++ b/src/test/java/com/microsoft/azure/storage/ServiceAPITest.groovy @@ -25,7 +25,7 @@ import com.microsoft.azure.storage.blob.ServiceURL import com.microsoft.azure.storage.blob.StorageException import com.microsoft.azure.storage.blob.StorageURL import com.microsoft.azure.storage.blob.URLParser -import com.microsoft.azure.storage.blob.models.Container +import com.microsoft.azure.storage.blob.models.ContainerItem import com.microsoft.azure.storage.blob.models.CorsRule import com.microsoft.azure.storage.blob.models.Logging import com.microsoft.azure.storage.blob.models.Metrics @@ -36,6 +36,8 @@ import com.microsoft.azure.storage.blob.models.ServiceSetPropertiesHeaders import com.microsoft.azure.storage.blob.models.StorageServiceProperties import spock.lang.Unroll +import java.lang.annotation.Retention + class ServiceAPITest extends APISpec { StorageServiceProperties originalProps = primaryServiceURL.getProperties().blockingGet().body() @@ -43,64 +45,69 @@ class ServiceAPITest extends APISpec { primaryServiceURL.setProperties(originalProps).blockingGet() } - def "Service list containers"() { + def "List containers"() { setup: ServiceListContainersSegmentResponse response = primaryServiceURL.listContainersSegment(null, new ListContainersOptions(null, - containerPrefix, null)).blockingGet() + containerPrefix, null)).blockingGet() expect: - for (Container c : response.body().containers()) { + for (ContainerItem c : response.body().containerItems()) { c.name().startsWith(containerPrefix) } response.headers().requestId() != null response.headers().version() != null } - def "Service list containers marker"() { + def "List containers marker"() { setup: - for (int i=0; i<10; i++) { + for (int i = 0; i < 10; i++) { ContainerURL cu = primaryServiceURL.createContainerURL(generateContainerName()) cu.create(null, null).blockingGet() } ServiceListContainersSegmentResponse response = primaryServiceURL.listContainersSegment(null, - new ListContainersOptions(null, null, 5)).blockingGet() + new ListContainersOptions(null, null, 5)).blockingGet() String marker = response.body().nextMarker() - String firstContainerName = response.body().containers().get(0).name() + String firstContainerName = response.body().containerItems().get(0).name() response = primaryServiceURL.listContainersSegment(marker, new ListContainersOptions(null, null, 5)).blockingGet() expect: // Assert that the second segment is indeed after the first alphabetically - firstContainerName < response.body().containers().get(0).name() + firstContainerName < response.body().containerItems().get(0).name() } - def "Service list containers details"() { + def "List containers details"() { setup: Metadata metadata = new Metadata() metadata.put("foo", "bar") - cu = primaryServiceURL.createContainerURL("aaa"+generateContainerName()) + cu = primaryServiceURL.createContainerURL("aaa" + generateContainerName()) cu.create(metadata, null).blockingGet() expect: primaryServiceURL.listContainersSegment(null, new ListContainersOptions(new ContainerListingDetails(true), - "aaa"+containerPrefix, null)).blockingGet().body().containers() + "aaa"+containerPrefix, null)).blockingGet().body().containerItems() .get(0).metadata() == metadata // Container with prefix "aaa" will not be cleaned up by normal test cleanup. cu.delete(null).blockingGet().statusCode() == 202 } - def "Service list containers maxResults"() { + def "List containers maxResults"() { + setup: + for (int i=0; i<11; i++) { + primaryServiceURL.createContainerURL(generateContainerName()).create(null, null) + .blockingGet() + } expect: primaryServiceURL.listContainersSegment(null, new ListContainersOptions(null, null, 10)) - .blockingGet().body().containers().size() == 10 + .blockingGet().body().containerItems().size() == 10 } - def "Service list containers error"() { + def "List containers error"() { when: primaryServiceURL.listContainersSegment("garbage", null).blockingGet() @@ -110,38 +117,41 @@ class ServiceAPITest extends APISpec { def validatePropsSet(ServiceSetPropertiesHeaders headers, StorageServiceProperties receivedProperties) { return headers.requestId() != null && - headers.version() != null && - - receivedProperties.logging().read() && - !receivedProperties.logging().delete() && - !receivedProperties.logging().write() && - receivedProperties.logging().version() == "1.0" && - receivedProperties.logging().retentionPolicy().days() == 5 && - receivedProperties.logging().retentionPolicy().enabled() && - - receivedProperties.cors().size() == 1 && - receivedProperties.cors().get(0).allowedMethods() == "GET,PUT,HEAD" && - receivedProperties.cors().get(0).allowedHeaders() == "x-ms-version" && - receivedProperties.cors().get(0).allowedOrigins() == "*" && - receivedProperties.cors().get(0).exposedHeaders() == "x-ms-client-request-id" && - receivedProperties.cors().get(0).maxAgeInSeconds() == 10 && - - receivedProperties.defaultServiceVersion() == "2016-05-31" && - - receivedProperties.hourMetrics().enabled() && - receivedProperties.hourMetrics().includeAPIs() && - receivedProperties.hourMetrics().retentionPolicy().enabled() && - receivedProperties.hourMetrics().retentionPolicy().days() == 5 && - receivedProperties.hourMetrics().version() == "1.0" && - - receivedProperties.minuteMetrics().enabled() && - receivedProperties.minuteMetrics().includeAPIs() && - receivedProperties.minuteMetrics().retentionPolicy().enabled() && - receivedProperties.minuteMetrics().retentionPolicy().days() == 5 && - receivedProperties.minuteMetrics().version() == "1.0" + headers.version() != null && + + receivedProperties.logging().read() && + !receivedProperties.logging().delete() && + !receivedProperties.logging().write() && + receivedProperties.logging().version() == "1.0" && + receivedProperties.logging().retentionPolicy().days() == 5 && + receivedProperties.logging().retentionPolicy().enabled() && + + receivedProperties.cors().size() == 1 && + receivedProperties.cors().get(0).allowedMethods() == "GET,PUT,HEAD" && + receivedProperties.cors().get(0).allowedHeaders() == "x-ms-version" && + receivedProperties.cors().get(0).allowedOrigins() == "*" && + receivedProperties.cors().get(0).exposedHeaders() == "x-ms-client-request-id" && + receivedProperties.cors().get(0).maxAgeInSeconds() == 10 && + + receivedProperties.defaultServiceVersion() == "2016-05-31" && + + receivedProperties.hourMetrics().enabled() && + receivedProperties.hourMetrics().includeAPIs() && + receivedProperties.hourMetrics().retentionPolicy().enabled() && + receivedProperties.hourMetrics().retentionPolicy().days() == 5 && + receivedProperties.hourMetrics().version() == "1.0" && + + receivedProperties.minuteMetrics().enabled() && + receivedProperties.minuteMetrics().includeAPIs() && + receivedProperties.minuteMetrics().retentionPolicy().enabled() && + receivedProperties.minuteMetrics().retentionPolicy().days() == 5 && + receivedProperties.minuteMetrics().version() == "1.0" && + + receivedProperties.deleteRetentionPolicy().enabled() && + receivedProperties.deleteRetentionPolicy().days() == 5 } - def "Service set get properties"() { + def "Set get properties"() { when: RetentionPolicy retentionPolicy = new RetentionPolicy().withDays(5).withEnabled(true) Logging logging = new Logging().withRead(true).withVersion("1.0") @@ -158,21 +168,25 @@ class ServiceAPITest extends APISpec { Metrics minuteMetrics = new Metrics().withEnabled(true).withVersion("1.0") .withRetentionPolicy(retentionPolicy).withIncludeAPIs(true) + ServiceSetPropertiesHeaders headers = primaryServiceURL.setProperties(new StorageServiceProperties() .withLogging(logging).withCors(corsRules).withDefaultServiceVersion(defaultServiceVersion) - .withMinuteMetrics(minuteMetrics).withHourMetrics(hourMetrics)).blockingGet().headers() + .withMinuteMetrics(minuteMetrics).withHourMetrics(hourMetrics) + .withDeleteRetentionPolicy(retentionPolicy)).blockingGet().headers() StorageServiceProperties receivedProperties = primaryServiceURL.getProperties() .blockingGet().body() then: if (!validatePropsSet(headers, receivedProperties)) { // Service properties may take up to 30s to take effect. If they weren't already in place, wait. - sleep(30*1000) + sleep(30 * 1000) validatePropsSet(headers, receivedProperties) } } - def "Service set props error"() { + // In java, we don't have support from the validator for checking the bounds on days. The service will catch these. + + def "Set props error"() { when: new ServiceURL(new URL("https://error.blob.core.windows.net"), StorageURL.createPipeline(primaryCreds, new PipelineOptions())) @@ -182,7 +196,7 @@ class ServiceAPITest extends APISpec { thrown(StorageException) } - def "service get props error"() { + def "Get props error"() { when: new ServiceURL(new URL("https://error.blob.core.windows.net"), StorageURL.createPipeline(primaryCreds, new PipelineOptions())).getProperties().blockingGet() @@ -191,7 +205,7 @@ class ServiceAPITest extends APISpec { thrown(StorageException) } - def "Service get stats"() { + def "Get stats"() { setup: BlobURLParts parts = URLParser.parse(primaryServiceURL.toURL()) parts.host = "xclientdev3-secondary.blob.core.windows.net" @@ -207,7 +221,7 @@ class ServiceAPITest extends APISpec { response.body().geoReplication().lastSyncTime() != null } - def "Service get stats error"() { + def "Get stats error"() { when: primaryServiceURL.getStatistics().blockingGet() diff --git a/src/test/java/com/microsoft/azure/storage/TransferManagerTest.groovy b/src/test/java/com/microsoft/azure/storage/TransferManagerTest.groovy index 5e83f59f9..a4184087d 100644 --- a/src/test/java/com/microsoft/azure/storage/TransferManagerTest.groovy +++ b/src/test/java/com/microsoft/azure/storage/TransferManagerTest.groovy @@ -14,9 +14,9 @@ import com.microsoft.azure.storage.blob.ServiceURL import com.microsoft.azure.storage.blob.StorageException import com.microsoft.azure.storage.blob.StorageURL import com.microsoft.azure.storage.blob.TransferManager -import com.microsoft.azure.storage.blob.models.BlobsGetPropertiesResponse -import com.microsoft.azure.storage.blob.models.BlockBlobsCommitBlockListResponse -import com.microsoft.azure.storage.blob.models.BlockBlobsUploadResponse +import com.microsoft.azure.storage.blob.models.BlobGetPropertiesResponse +import com.microsoft.azure.storage.blob.models.BlockBlobCommitBlockListResponse +import com.microsoft.azure.storage.blob.models.BlockBlobUploadResponse import com.microsoft.azure.storage.blob.models.StorageErrorCode import com.microsoft.rest.v2.http.HttpPipeline import com.microsoft.rest.v2.util.FlowableUtil @@ -32,10 +32,6 @@ import java.nio.ReadOnlyBufferException import java.nio.channels.FileChannel import java.security.MessageDigest -import static org.junit.Assert.assertEquals -import static org.junit.Assert.assertEquals -import static org.junit.Assert.assertEquals - class TransferManagerTest extends APISpec { BlockBlobURL bu @@ -56,7 +52,7 @@ class TransferManagerTest extends APISpec { null, null)).blockingGet() then: - response.response() instanceof BlockBlobsUploadResponse // Ensure we did a single put for a small blob. + response.response() instanceof BlockBlobUploadResponse // Ensure we did a single put for a small blob. validateBasicHeaders(response) FlowableUtil.collectBytesInBuffer(bu.download(null, null, false) .blockingGet().body()).blockingGet() == defaultData @@ -73,7 +69,7 @@ class TransferManagerTest extends APISpec { then: // Ensure we did a commitBlockList for large blobs. - response.response() instanceof BlockBlobsCommitBlockListResponse + response.response() instanceof BlockBlobCommitBlockListResponse validateBasicHeaders(response) compareBufferListToFlowable(buffers, bu.download(null, null, false) .blockingGet().body()) @@ -162,7 +158,7 @@ class TransferManagerTest extends APISpec { contentDisposition, contentEncoding, contentLanguage, contentMD5, contentType), null, null, null)).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: validateBlobHeaders(response.headers(), cacheControl, contentDisposition, contentEncoding, contentLanguage, @@ -195,7 +191,7 @@ class TransferManagerTest extends APISpec { TransferManager.uploadByteBuffersToBlockBlob(data, bu, new TransferManager.UploadToBlockBlobOptions(null, null, metadata, null, null)).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: response.statusCode() == 200 @@ -290,7 +286,7 @@ class TransferManagerTest extends APISpec { when: // Block length will be ignored for single shot. CommonRestResponse response = TransferManager.uploadByteBufferToBlockBlob(data, bu, - (int)(BlockBlobURL.MAX_PUT_BLOCK_BYTES/10), + (int)(BlockBlobURL.MAX_STAGE_BLOCK_BYTES/10), new TransferManager.UploadToBlockBlobOptions(null, null, null, null, 20)).blockingGet() @@ -302,8 +298,8 @@ class TransferManagerTest extends APISpec { where: data | responseType - defaultData | BlockBlobsUploadResponse - getRandomData(BlockBlobURL.MAX_PUT_BLOB_BYTES + 1) | BlockBlobsCommitBlockListResponse + defaultData | BlockBlobUploadResponse + getRandomData(BlockBlobURL.MAX_PUT_BLOB_BYTES + 1) | BlockBlobCommitBlockListResponse } @Unroll @@ -329,9 +325,9 @@ class TransferManagerTest extends APISpec { thrown(IllegalArgumentException) where: - blockLength | _ - -1 | _ - BlockBlobURL.MAX_PUT_BLOCK_BYTES + 1 | _ + blockLength | _ + -1 | _ + BlockBlobURL.MAX_STAGE_BLOCK_BYTES + 1 | _ } @Unroll @@ -342,7 +338,7 @@ class TransferManagerTest extends APISpec { contentDisposition, contentEncoding, contentLanguage, contentMD5, contentType), null, null, null)).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: validateBlobHeaders(response.headers(), cacheControl, contentDisposition, contentEncoding, contentLanguage, @@ -372,7 +368,7 @@ class TransferManagerTest extends APISpec { TransferManager.uploadByteBufferToBlockBlob(defaultData, bu, 5, new TransferManager.UploadToBlockBlobOptions(null, null, metadata, null, null)).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: response.statusCode() == 200 @@ -442,7 +438,7 @@ class TransferManagerTest extends APISpec { when: // Block length will be ignored for single shot. CommonRestResponse response = TransferManager.uploadFileToBlockBlob(FileChannel.open(file.toPath()), bu, - (int)(BlockBlobURL.MAX_PUT_BLOCK_BYTES/10), + (int)(BlockBlobURL.MAX_STAGE_BLOCK_BYTES/10), new TransferManager.UploadToBlockBlobOptions(null, null, null, null, 20)).blockingGet() @@ -454,8 +450,8 @@ class TransferManagerTest extends APISpec { where: file | responseType - getRandomFile(10) | BlockBlobsUploadResponse - getRandomFile(BlockBlobURL.MAX_PUT_BLOB_BYTES + 1) | BlockBlobsCommitBlockListResponse + getRandomFile(10) | BlockBlobUploadResponse + getRandomFile(BlockBlobURL.MAX_PUT_BLOB_BYTES + 1) | BlockBlobCommitBlockListResponse } def compareDataToFile(Flowable data, File file) { @@ -498,9 +494,9 @@ class TransferManagerTest extends APISpec { thrown(IllegalArgumentException) where: - blockLength | _ - -1 | _ - BlockBlobURL.MAX_PUT_BLOCK_BYTES + 1 | _ + blockLength | _ + -1 | _ + BlockBlobURL.MAX_STAGE_BLOCK_BYTES + 1 | _ } @Unroll @@ -519,7 +515,7 @@ class TransferManagerTest extends APISpec { contentDisposition, contentEncoding, contentLanguage, contentMD5, contentType), null, null, null)).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: validateBlobHeaders(response.headers(), cacheControl, contentDisposition, contentEncoding, contentLanguage, @@ -549,7 +545,7 @@ class TransferManagerTest extends APISpec { TransferManager.uploadFileToBlockBlob(FileChannel.open(getRandomFile(10).toPath()), bu, 5, new TransferManager.UploadToBlockBlobOptions(null, null, metadata, null, null)).blockingGet() - BlobsGetPropertiesResponse response = bu.getProperties(null).blockingGet() + BlobGetPropertiesResponse response = bu.getProperties(null).blockingGet() then: response.statusCode() == 200 @@ -623,61 +619,4 @@ class TransferManagerTest extends APISpec { then: thrown(IllegalArgumentException) } - - /* - We are simply testing for no errors here. There has historically been a problem with Netty that caused it to - crash when uploading multiple medium size files in parallel over https. Here we validate that behavior is - fixed. We will test for correctness of the parallel upload elsewhere. - */ - - def "Https parallel file upload"() { - setup: - PipelineOptions po = new PipelineOptions() - RequestRetryOptions retryOptions = new RequestRetryOptions(null, null, 300, - null, null, null) - po.requestRetryOptions = retryOptions - po.client = getHttpClient() - - HttpPipeline pipeline = StorageURL.createPipeline(primaryCreds, po) - - // This test requires https. - ServiceURL surl = new ServiceURL(new URL("https://" + primaryCreds.getAccountName() + ".blob.core.windows.net"), - pipeline) - - ContainerURL containerURL = surl.createContainerURL(generateContainerName()) - containerURL.create(null, null).blockingGet() - - when: - Observable.range(0, 4000) - .flatMap(new Function() { - @Override - ObservableSource apply(@NonNull Integer i) throws Exception { - BlockBlobURL asyncblob = containerURL.createBlockBlobURL("asyncblob" + i) - TransferManager.UploadToBlockBlobOptions asyncOptions = new TransferManager.UploadToBlockBlobOptions( - null, null, null, null, 1) - - return TransferManager.uploadFileToBlockBlob( - FileChannel.open(new File(getClass().getClassLoader().getResource("15mb.txt").getFile()) - .toPath()), asyncblob, BlockBlobURL.MAX_PUT_BLOCK_BYTES, asyncOptions).toObservable() - } - }, 2000) - .onErrorReturn((new Function() { - @Override - Object apply(Throwable throwable) throws Exception { - /* - We only care about the ReadOnlyBufferException as an indication of the netty failure with memory mapped - files. Everything else, like throttling, is fine here. - */ - if (throwable instanceof ReadOnlyBufferException) { - throw throwable - } - // This value is not meaningful. We just want the observable to continue. - return new Object() - } - })).blockingSubscribe() - containerURL.delete(null).blockingGet() - - then: - notThrown(ReadOnlyBufferException) - } } diff --git a/swagger/README.md b/swagger/README.md index b810fb18c..136e6f8b5 100644 --- a/swagger/README.md +++ b/swagger/README.md @@ -9,7 +9,7 @@ namespace: com.microsoft.azure.storage license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../ input-file: -- path/to/swagger +- path\to\json directive: # removes the x-ms-error-code from default response headers where: $..default.headers["x-ms-error-code"] diff --git a/swagger/generate.bat b/swagger/generate.bat index 807d8af51..a4fd197ac 100644 --- a/swagger/generate.bat +++ b/swagger/generate.bat @@ -1,3 +1,3 @@ -set version=2.0.19 +set version=2.0.23 set url=https://github.com/Azure/autorest.java/releases/download/v%version%/microsoft.azure-autorest.java-%version%.tgz autorest %~dp0README.md --use=%url% --reset --preview --implementation-subpackage=blob.implementation --models-subpackage=blob.models --generate-client-interfaces=false --required-parameter-client-methods=false --client-type-prefix=Generated \ No newline at end of file