Skip to content

Commit

Permalink
Get page ranges continuation (#28390)
Browse files Browse the repository at this point in the history
* Generated code

* Fixed nextMarker

* Tried to reformat the xml tags

* Tried to add a segment type to reformat xml tags

* Tried another thing

* Got it generating

* Finished feature

* Changelog

* Some apiview feedback

* Starting an attempt to pass context to method

* Sorted out adding context to sync method

* Wrote some tests

* Wrote tests

* Test fixes and recordings

* Added samples

* ci fix

* imports fixes

* Added PageListHelper

* Fixed merge conflict
  • Loading branch information
rickle-msft authored Apr 29, 2022
1 parent bb4cb25 commit 1431830
Show file tree
Hide file tree
Showing 79 changed files with 6,888 additions and 32 deletions.
2 changes: 2 additions & 0 deletions sdk/storage/azure-storage-blob/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## 12.17.0-beta.1 (Unreleased)

### Features Added
- Added support for 2021-04-10 service version.
- Added the ability to list PageRanges and PageRangesDiff by page.

### Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ Mono<PageBlobsGetPageRangesResponse> getPageRanges(
@HeaderParam("x-ms-if-tags") String ifTags,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-client-request-id") String requestId,
@QueryParam("marker") String marker,
@QueryParam("maxresults") Integer maxresults,
@HeaderParam("Accept") String accept,
Context context);

Expand All @@ -254,6 +256,8 @@ Mono<PageBlobsGetPageRangesDiffResponse> getPageRangesDiff(
@HeaderParam("x-ms-if-tags") String ifTags,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-client-request-id") String requestId,
@QueryParam("marker") String marker,
@QueryParam("maxresults") Integer maxresults,
@HeaderParam("Accept") String accept,
Context context);

Expand Down Expand Up @@ -890,6 +894,16 @@ public Mono<PageBlobsUploadPagesFromURLResponse> uploadPagesFromURLWithResponseA
* @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
* @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 marker A string value that identifies the portion of the list of containers to be returned with the next
* listing operation. The operation returns the NextMarker value within the response body if the listing
* operation did not return all containers remaining to be listed with the current page. The NextMarker value
* can be used as the value for the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param maxresults Specifies the maximum number of containers to return. If the request does not specify
* maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the
* listing operation crosses a partition boundary, then the service will return a continuation token for
* retrieving the remainder of the results. For this reason, it is possible that the service will return fewer
* results than specified by maxresults, or than the default of 5000.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws BlobStorageException thrown if the request is rejected by server.
Expand All @@ -910,6 +924,8 @@ public Mono<PageBlobsGetPageRangesResponse> getPageRangesWithResponseAsync(
String ifNoneMatch,
String ifTags,
String requestId,
String marker,
Integer maxresults,
Context context) {
final String comp = "pagelist";
final String accept = "application/xml";
Expand All @@ -933,6 +949,8 @@ public Mono<PageBlobsGetPageRangesResponse> getPageRangesWithResponseAsync(
ifTags,
this.client.getVersion(),
requestId,
marker,
maxresults,
accept,
context);
}
Expand Down Expand Up @@ -969,6 +987,16 @@ public Mono<PageBlobsGetPageRangesResponse> getPageRangesWithResponseAsync(
* @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
* @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 marker A string value that identifies the portion of the list of containers to be returned with the next
* listing operation. The operation returns the NextMarker value within the response body if the listing
* operation did not return all containers remaining to be listed with the current page. The NextMarker value
* can be used as the value for the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param maxresults Specifies the maximum number of containers to return. If the request does not specify
* maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the
* listing operation crosses a partition boundary, then the service will return a continuation token for
* retrieving the remainder of the results. For this reason, it is possible that the service will return fewer
* results than specified by maxresults, or than the default of 5000.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws BlobStorageException thrown if the request is rejected by server.
Expand All @@ -991,6 +1019,8 @@ public Mono<PageBlobsGetPageRangesDiffResponse> getPageRangesDiffWithResponseAsy
String ifNoneMatch,
String ifTags,
String requestId,
String marker,
Integer maxresults,
Context context) {
final String comp = "pagelist";
final String accept = "application/xml";
Expand All @@ -1016,6 +1046,8 @@ public Mono<PageBlobsGetPageRangesDiffResponse> getPageRangesDiffWithResponseAsy
ifTags,
this.client.getVersion(),
requestId,
marker,
maxresults,
accept,
context);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.storage.blob.implementation.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/** Defines values for BlobCopySourceTags. */
public enum BlobCopySourceTags {
/** Enum value REPLACE. */
REPLACE("REPLACE"),

/** Enum value COPY. */
COPY("COPY");

/** The actual serialized value for a BlobCopySourceTags instance. */
private final String value;

BlobCopySourceTags(String value) {
this.value = value;
}

/**
* Parses a serialized value to a BlobCopySourceTags instance.
*
* @param value the serialized value to parse.
* @return the parsed BlobCopySourceTags object, or null if unable to parse.
*/
@JsonCreator
public static BlobCopySourceTags fromString(String value) {
BlobCopySourceTags[] items = BlobCopySourceTags.values();
for (BlobCopySourceTags item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public static BlobDeleteType fromString(String name) {
return fromString(name, BlobDeleteType.class);
}

/** @return known BlobDeleteType values. */
/**
* Gets known BlobDeleteType values.
*
* @return known BlobDeleteType values.
*/
public static Collection<BlobDeleteType> values() {
return values(BlobDeleteType.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ public static BlobExpiryOptions fromString(String name) {
return fromString(name, BlobExpiryOptions.class);
}

/** @return known BlobExpiryOptions values. */
/**
* Gets known BlobExpiryOptions values.
*
* @return known BlobExpiryOptions values.
*/
public static Collection<BlobExpiryOptions> values() {
return values(BlobExpiryOptions.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public BlobsGetTagsResponse(
super(request, statusCode, rawHeaders, value, headers);
}

/** @return the deserialized response body. */
/**
* Gets the deserialized response body.
*
* @return the deserialized response body.
*/
@Override
public BlobTags getValue() {
return super.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public BlockBlobsGetBlockListResponse(
super(request, statusCode, rawHeaders, value, headers);
}

/** @return the deserialized response body. */
/**
* Gets the deserialized response body.
*
* @return the deserialized response body.
*/
@Override
public BlockList getValue() {
return super.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ public ContainersFilterBlobsResponse(
super(request, statusCode, rawHeaders, value, headers);
}

/** @return the deserialized response body. */
/**
* Gets the deserialized response body.
*
* @return the deserialized response body.
*/
@Override
public FilterBlobSegment getValue() {
return super.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public ContainersGetAccessPolicyResponse(
super(request, statusCode, rawHeaders, value, headers);
}

/** @return the deserialized response body. */
/**
* Gets the deserialized response body.
*
* @return the deserialized response body.
*/
@Override
public List<BlobSignedIdentifier> getValue() {
return super.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public ContainersListBlobFlatSegmentResponse(
super(request, statusCode, rawHeaders, value, headers);
}

/** @return the deserialized response body. */
/**
* Gets the deserialized response body.
*
* @return the deserialized response body.
*/
@Override
public ListBlobsFlatSegmentResponse getValue() {
return super.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public ContainersListBlobHierarchySegmentResponse(
super(request, statusCode, rawHeaders, value, headers);
}

/** @return the deserialized response body. */
/**
* Gets the deserialized response body.
*
* @return the deserialized response body.
*/
@Override
public ListBlobsHierarchySegmentResponse getValue() {
return super.getValue();
Expand Down
Loading

0 comments on commit 1431830

Please sign in to comment.