Skip to content

Commit

Permalink
Generated off latest version of blob swagger (#21644)
Browse files Browse the repository at this point in the history
  • Loading branch information
gapra-msft authored May 19, 2021
1 parent 768e313 commit 8b49136
Show file tree
Hide file tree
Showing 24 changed files with 1,631 additions and 479 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.azure.storage.blob.implementation.models.AppendBlobsAppendBlockResponse;
import com.azure.storage.blob.implementation.models.AppendBlobsCreateResponse;
import com.azure.storage.blob.implementation.models.AppendBlobsSealResponse;
import com.azure.storage.blob.implementation.models.BlobImmutabilityPolicyMode;
import com.azure.storage.blob.implementation.models.EncryptionScope;
import com.azure.storage.blob.implementation.models.StorageErrorException;
import com.azure.storage.blob.models.BlobHttpHeaders;
Expand Down Expand Up @@ -92,6 +93,9 @@ Mono<AppendBlobsCreateResponse> create(
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("x-ms-tags") String blobTagsString,
@HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
@HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
@HeaderParam("x-ms-legal-hold") Boolean legalHold,
@HeaderParam("Accept") String accept,
Context context);

Expand Down Expand Up @@ -208,6 +212,9 @@ Mono<AppendBlobsSealResponse> seal(
* @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 blobTagsString Optional. Used to set blob tags in various blob operations.
* @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire.
* @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob.
* @param legalHold Specified if a legal hold should be set on the blob.
* @param blobHttpHeaders Parameter group.
* @param cpkInfo Parameter group.
* @param encryptionScope Parameter group.
Expand All @@ -232,6 +239,9 @@ public Mono<AppendBlobsCreateResponse> createWithResponseAsync(
String ifTags,
String requestId,
String blobTagsString,
OffsetDateTime immutabilityPolicyExpiry,
BlobImmutabilityPolicyMode immutabilityPolicyMode,
Boolean legalHold,
BlobHttpHeaders blobHttpHeaders,
CpkInfo cpkInfo,
EncryptionScope encryptionScope,
Expand Down Expand Up @@ -293,6 +303,8 @@ public Mono<AppendBlobsCreateResponse> createWithResponseAsync(
ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
DateTimeRfc1123 ifUnmodifiedSinceConverted =
ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
DateTimeRfc1123 immutabilityPolicyExpiryConverted =
immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry);
return service.create(
this.client.getUrl(),
blobType,
Expand Down Expand Up @@ -320,6 +332,9 @@ public Mono<AppendBlobsCreateResponse> createWithResponseAsync(
this.client.getVersion(),
requestId,
blobTagsString,
immutabilityPolicyExpiryConverted,
immutabilityPolicyMode,
legalHold,
accept,
context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public AzureBlobStorageImplBuilder addPolicy(HttpPipelinePolicy customPolicy) {
*/
public AzureBlobStorageImpl buildClient() {
if (version == null) {
this.version = "2020-08-04";
this.version = "2020-10-02";
}
if (pipeline == null) {
this.pipeline = createHttpPipeline();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.azure.core.util.Base64Util;
import com.azure.core.util.Context;
import com.azure.core.util.DateTimeRfc1123;
import com.azure.storage.blob.implementation.models.BlobImmutabilityPolicyMode;
import com.azure.storage.blob.implementation.models.BlockBlobsCommitBlockListResponse;
import com.azure.storage.blob.implementation.models.BlockBlobsGetBlockListResponse;
import com.azure.storage.blob.implementation.models.BlockBlobsPutBlobFromUrlResponse;
Expand Down Expand Up @@ -100,6 +101,9 @@ Mono<BlockBlobsUploadResponse> upload(
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("x-ms-tags") String blobTagsString,
@HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
@HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
@HeaderParam("x-ms-legal-hold") Boolean legalHold,
@BodyParam("application/octet-stream") Flux<ByteBuffer> body,
@HeaderParam("Accept") String accept,
Context context);
Expand Down Expand Up @@ -232,6 +236,9 @@ Mono<BlockBlobsCommitBlockListResponse> commitBlockList(
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("x-ms-tags") String blobTagsString,
@HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
@HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
@HeaderParam("x-ms-legal-hold") Boolean legalHold,
@BodyParam("application/xml") BlockLookupList blocks,
@HeaderParam("Accept") String accept,
Context context);
Expand Down Expand Up @@ -287,6 +294,9 @@ Mono<BlockBlobsGetBlockListResponse> getBlockList(
* @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 blobTagsString Optional. Used to set blob tags in various blob operations.
* @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire.
* @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob.
* @param legalHold Specified if a legal hold should be set on the blob.
* @param blobHttpHeaders Parameter group.
* @param cpkInfo Parameter group.
* @param encryptionScope Parameter group.
Expand Down Expand Up @@ -314,6 +324,9 @@ public Mono<BlockBlobsUploadResponse> uploadWithResponseAsync(
String ifTags,
String requestId,
String blobTagsString,
OffsetDateTime immutabilityPolicyExpiry,
BlobImmutabilityPolicyMode immutabilityPolicyMode,
Boolean legalHold,
BlobHttpHeaders blobHttpHeaders,
CpkInfo cpkInfo,
EncryptionScope encryptionScope,
Expand Down Expand Up @@ -376,6 +389,8 @@ public Mono<BlockBlobsUploadResponse> uploadWithResponseAsync(
ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
DateTimeRfc1123 ifUnmodifiedSinceConverted =
ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
DateTimeRfc1123 immutabilityPolicyExpiryConverted =
immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry);
return service.upload(
this.client.getUrl(),
blobType,
Expand Down Expand Up @@ -405,6 +420,9 @@ public Mono<BlockBlobsUploadResponse> uploadWithResponseAsync(
this.client.getVersion(),
requestId,
blobTagsString,
immutabilityPolicyExpiryConverted,
immutabilityPolicyMode,
legalHold,
body,
accept,
context);
Expand Down Expand Up @@ -828,6 +846,9 @@ public Mono<BlockBlobsStageBlockFromURLResponse> stageBlockFromURLWithResponseAs
* @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 blobTagsString Optional. Used to set blob tags in various blob operations.
* @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire.
* @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob.
* @param legalHold Specified if a legal hold should be set on the blob.
* @param blobHttpHeaders Parameter group.
* @param cpkInfo Parameter group.
* @param encryptionScope Parameter group.
Expand Down Expand Up @@ -855,6 +876,9 @@ public Mono<BlockBlobsCommitBlockListResponse> commitBlockListWithResponseAsync(
String ifTags,
String requestId,
String blobTagsString,
OffsetDateTime immutabilityPolicyExpiry,
BlobImmutabilityPolicyMode immutabilityPolicyMode,
Boolean legalHold,
BlobHttpHeaders blobHttpHeaders,
CpkInfo cpkInfo,
EncryptionScope encryptionScope,
Expand Down Expand Up @@ -918,6 +942,8 @@ public Mono<BlockBlobsCommitBlockListResponse> commitBlockListWithResponseAsync(
ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
DateTimeRfc1123 ifUnmodifiedSinceConverted =
ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
DateTimeRfc1123 immutabilityPolicyExpiryConverted =
immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry);
return service.commitBlockList(
this.client.getUrl(),
comp,
Expand Down Expand Up @@ -947,6 +973,9 @@ public Mono<BlockBlobsCommitBlockListResponse> commitBlockListWithResponseAsync(
this.client.getVersion(),
requestId,
blobTagsString,
immutabilityPolicyExpiryConverted,
immutabilityPolicyMode,
legalHold,
blocks,
accept,
context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.azure.core.util.Base64Util;
import com.azure.core.util.Context;
import com.azure.core.util.DateTimeRfc1123;
import com.azure.storage.blob.implementation.models.BlobImmutabilityPolicyMode;
import com.azure.storage.blob.implementation.models.EncryptionScope;
import com.azure.storage.blob.implementation.models.PageBlobsClearPagesResponse;
import com.azure.storage.blob.implementation.models.PageBlobsCopyIncrementalResponse;
Expand Down Expand Up @@ -103,6 +104,9 @@ Mono<PageBlobsCreateResponse> create(
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("x-ms-tags") String blobTagsString,
@HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
@HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
@HeaderParam("x-ms-legal-hold") Boolean legalHold,
@HeaderParam("Accept") String accept,
Context context);

Expand Down Expand Up @@ -352,6 +356,9 @@ Mono<PageBlobsCopyIncrementalResponse> copyIncremental(
* @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 blobTagsString Optional. Used to set blob tags in various blob operations.
* @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire.
* @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob.
* @param legalHold Specified if a legal hold should be set on the blob.
* @param blobHttpHeaders Parameter group.
* @param cpkInfo Parameter group.
* @param encryptionScope Parameter group.
Expand Down Expand Up @@ -379,6 +386,9 @@ public Mono<PageBlobsCreateResponse> createWithResponseAsync(
Long blobSequenceNumber,
String requestId,
String blobTagsString,
OffsetDateTime immutabilityPolicyExpiry,
BlobImmutabilityPolicyMode immutabilityPolicyMode,
Boolean legalHold,
BlobHttpHeaders blobHttpHeaders,
CpkInfo cpkInfo,
EncryptionScope encryptionScope,
Expand Down Expand Up @@ -440,6 +450,8 @@ public Mono<PageBlobsCreateResponse> createWithResponseAsync(
ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
DateTimeRfc1123 ifUnmodifiedSinceConverted =
ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
DateTimeRfc1123 immutabilityPolicyExpiryConverted =
immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry);
return service.create(
this.client.getUrl(),
blobType,
Expand Down Expand Up @@ -470,6 +482,9 @@ public Mono<PageBlobsCreateResponse> createWithResponseAsync(
this.client.getVersion(),
requestId,
blobTagsString,
immutabilityPolicyExpiryConverted,
immutabilityPolicyMode,
legalHold,
accept,
context);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// 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 BlobImmutabilityPolicyMode. */
public enum BlobImmutabilityPolicyMode {
/** Enum value Unlocked. */
UNLOCKED("Unlocked"),

/** Enum value Locked. */
LOCKED("Locked"),

/** Enum value Mutable. */
MUTABLE("Mutable");

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

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

/**
* Parses a serialized value to a BlobImmutabilityPolicyMode instance.
*
* @param value the serialized value to parse.
* @return the parsed BlobImmutabilityPolicyMode object, or null if unable to parse.
*/
@JsonCreator
public static BlobImmutabilityPolicyMode fromString(String value) {
BlobImmutabilityPolicyMode[] items = BlobImmutabilityPolicyMode.values();
for (BlobImmutabilityPolicyMode 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 @@ -246,6 +246,24 @@ public final class BlobItemPropertiesInternal {
@JsonProperty(value = "LastAccessTime")
private DateTimeRfc1123 lastAccessedOn;

/*
* The ImmutabilityPolicyUntilDate property.
*/
@JsonProperty(value = "ImmutabilityPolicyUntilDate")
private DateTimeRfc1123 immutabilityPolicyExpiresOn;

/*
* The ImmutabilityPolicyMode property.
*/
@JsonProperty(value = "ImmutabilityPolicyMode")
private BlobImmutabilityPolicyMode immutabilityPolicyMode;

/*
* The LegalHold property.
*/
@JsonProperty(value = "LegalHold")
private Boolean legalHold;

/**
* Get the creationTime property: The Creation-Time property.
*
Expand Down Expand Up @@ -1036,4 +1054,71 @@ public BlobItemPropertiesInternal setLastAccessedOn(OffsetDateTime lastAccessedO
}
return this;
}

/**
* Get the immutabilityPolicyExpiresOn property: The ImmutabilityPolicyUntilDate property.
*
* @return the immutabilityPolicyExpiresOn value.
*/
public OffsetDateTime getImmutabilityPolicyExpiresOn() {
if (this.immutabilityPolicyExpiresOn == null) {
return null;
}
return this.immutabilityPolicyExpiresOn.getDateTime();
}

/**
* Set the immutabilityPolicyExpiresOn property: The ImmutabilityPolicyUntilDate property.
*
* @param immutabilityPolicyExpiresOn the immutabilityPolicyExpiresOn value to set.
* @return the BlobItemPropertiesInternal object itself.
*/
public BlobItemPropertiesInternal setImmutabilityPolicyExpiresOn(OffsetDateTime immutabilityPolicyExpiresOn) {
if (immutabilityPolicyExpiresOn == null) {
this.immutabilityPolicyExpiresOn = null;
} else {
this.immutabilityPolicyExpiresOn = new DateTimeRfc1123(immutabilityPolicyExpiresOn);
}
return this;
}

/**
* Get the immutabilityPolicyMode property: The ImmutabilityPolicyMode property.
*
* @return the immutabilityPolicyMode value.
*/
public BlobImmutabilityPolicyMode getImmutabilityPolicyMode() {
return this.immutabilityPolicyMode;
}

/**
* Set the immutabilityPolicyMode property: The ImmutabilityPolicyMode property.
*
* @param immutabilityPolicyMode the immutabilityPolicyMode value to set.
* @return the BlobItemPropertiesInternal object itself.
*/
public BlobItemPropertiesInternal setImmutabilityPolicyMode(BlobImmutabilityPolicyMode immutabilityPolicyMode) {
this.immutabilityPolicyMode = immutabilityPolicyMode;
return this;
}

/**
* Get the legalHold property: The LegalHold property.
*
* @return the legalHold value.
*/
public Boolean isLegalHold() {
return this.legalHold;
}

/**
* Set the legalHold property: The LegalHold property.
*
* @param legalHold the legalHold value to set.
* @return the BlobItemPropertiesInternal object itself.
*/
public BlobItemPropertiesInternal setLegalHold(Boolean legalHold) {
this.legalHold = legalHold;
return this;
}
}
Loading

0 comments on commit 8b49136

Please sign in to comment.