Skip to content

Commit

Permalink
implementation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrandes committed Sep 23, 2024
1 parent e6d4cfc commit 7678d76
Show file tree
Hide file tree
Showing 21 changed files with 1,795 additions and 346 deletions.
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-file-share/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/storage/azure-storage-file-share",
"Tag": "java/storage/azure-storage-file-share_4152d3ba84"
"Tag": "java/storage/azure-storage-file-share_076ef47a13"
}
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ Mono<Response<ShareInfo>> createWithResponse(ShareCreateOptions options, Context
.createNoCustomHeadersWithResponseAsync(shareName, null, options.getMetadata(), options.getQuotaInGb(),
options.getAccessTier(), enabledProtocol, options.getRootSquash(),
options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(),
options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), context)
options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(),
options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), context)
.map(ModelHelper::mapToShareInfoResponse);
}

Expand Down Expand Up @@ -940,8 +941,9 @@ Mono<Response<ShareInfo>> setPropertiesWithResponse(ShareSetPropertiesOptions op
return azureFileStorageClient.getShares().setPropertiesNoCustomHeadersWithResponseAsync(shareName, null,
options.getQuotaInGb(), options.getAccessTier(), requestConditions.getLeaseId(), options.getRootSquash(),
options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(),
options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), context)
.map(ModelHelper::mapToShareInfoResponse);
options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(),
options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), context)
.map(ModelHelper::mapToShareInfoResponse);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ public Response<ShareInfo> createWithResponse(ShareCreateOptions options, Durati
.createNoCustomHeadersWithResponse(shareName, null, finalOptions.getMetadata(), finalOptions.getQuotaInGb(),
finalOptions.getAccessTier(), finalEnabledProtocol, finalOptions.getRootSquash(),
finalOptions.isSnapshotVirtualDirectoryAccessEnabled(), finalOptions.isPaidBurstingEnabled(),
finalOptions.getPaidBurstingMaxBandwidthMibps(), finalOptions.getPaidBurstingMaxIops(), finalContext);
finalOptions.getPaidBurstingMaxBandwidthMibps(), finalOptions.getPaidBurstingMaxIops(),
finalOptions.getProvisionedMaxIops(), finalOptions.getProvisionedMaxBandwidthMibps(), finalContext);

return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class));
}
Expand Down Expand Up @@ -891,7 +892,8 @@ public Response<ShareInfo> setPropertiesWithResponse(ShareSetPropertiesOptions o
.setPropertiesNoCustomHeadersWithResponse(shareName, null, options.getQuotaInGb(), options.getAccessTier(),
requestConditions.getLeaseId(), options.getRootSquash(),
options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(),
options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), finalContext);
options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(),
options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), finalContext);

return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class));
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,26 @@ public final class SharePropertiesInternal implements XmlSerializable<SharePrope
*/
private Long paidBurstingMaxBandwidthMibps;

/*
* The IncludedBurstIops property.
*/
private Long includedBurstIops;

/*
* The MaxBurstCreditsForIops property.
*/
private Long maxBurstCreditsForIops;

/*
* The NextAllowedProvisionedIopsDowngradeTime property.
*/
private DateTimeRfc1123 nextAllowedProvisionedIopsDowngradeTime;

/*
* The NextAllowedProvisionedBandwidthDowngradeTime property.
*/
private DateTimeRfc1123 nextAllowedProvisionedBandwidthDowngradeTime;

/*
* Dictionary of <string>
*/
Expand Down Expand Up @@ -619,6 +639,106 @@ public SharePropertiesInternal setPaidBurstingMaxBandwidthMibps(Long paidBurstin
return this;
}

/**
* Get the includedBurstIops property: The IncludedBurstIops property.
*
* @return the includedBurstIops value.
*/
public Long getIncludedBurstIops() {
return this.includedBurstIops;
}

/**
* Set the includedBurstIops property: The IncludedBurstIops property.
*
* @param includedBurstIops the includedBurstIops value to set.
* @return the SharePropertiesInternal object itself.
*/
public SharePropertiesInternal setIncludedBurstIops(Long includedBurstIops) {
this.includedBurstIops = includedBurstIops;
return this;
}

/**
* Get the maxBurstCreditsForIops property: The MaxBurstCreditsForIops property.
*
* @return the maxBurstCreditsForIops value.
*/
public Long getMaxBurstCreditsForIops() {
return this.maxBurstCreditsForIops;
}

/**
* Set the maxBurstCreditsForIops property: The MaxBurstCreditsForIops property.
*
* @param maxBurstCreditsForIops the maxBurstCreditsForIops value to set.
* @return the SharePropertiesInternal object itself.
*/
public SharePropertiesInternal setMaxBurstCreditsForIops(Long maxBurstCreditsForIops) {
this.maxBurstCreditsForIops = maxBurstCreditsForIops;
return this;
}

/**
* Get the nextAllowedProvisionedIopsDowngradeTime property: The NextAllowedProvisionedIopsDowngradeTime property.
*
* @return the nextAllowedProvisionedIopsDowngradeTime value.
*/
public OffsetDateTime getNextAllowedProvisionedIopsDowngradeTime() {
if (this.nextAllowedProvisionedIopsDowngradeTime == null) {
return null;
}
return this.nextAllowedProvisionedIopsDowngradeTime.getDateTime();
}

/**
* Set the nextAllowedProvisionedIopsDowngradeTime property: The NextAllowedProvisionedIopsDowngradeTime property.
*
* @param nextAllowedProvisionedIopsDowngradeTime the nextAllowedProvisionedIopsDowngradeTime value to set.
* @return the SharePropertiesInternal object itself.
*/
public SharePropertiesInternal
setNextAllowedProvisionedIopsDowngradeTime(OffsetDateTime nextAllowedProvisionedIopsDowngradeTime) {
if (nextAllowedProvisionedIopsDowngradeTime == null) {
this.nextAllowedProvisionedIopsDowngradeTime = null;
} else {
this.nextAllowedProvisionedIopsDowngradeTime = new DateTimeRfc1123(nextAllowedProvisionedIopsDowngradeTime);
}
return this;
}

/**
* Get the nextAllowedProvisionedBandwidthDowngradeTime property: The NextAllowedProvisionedBandwidthDowngradeTime
* property.
*
* @return the nextAllowedProvisionedBandwidthDowngradeTime value.
*/
public OffsetDateTime getNextAllowedProvisionedBandwidthDowngradeTime() {
if (this.nextAllowedProvisionedBandwidthDowngradeTime == null) {
return null;
}
return this.nextAllowedProvisionedBandwidthDowngradeTime.getDateTime();
}

/**
* Set the nextAllowedProvisionedBandwidthDowngradeTime property: The NextAllowedProvisionedBandwidthDowngradeTime
* property.
*
* @param nextAllowedProvisionedBandwidthDowngradeTime the nextAllowedProvisionedBandwidthDowngradeTime value to
* set.
* @return the SharePropertiesInternal object itself.
*/
public SharePropertiesInternal
setNextAllowedProvisionedBandwidthDowngradeTime(OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime) {
if (nextAllowedProvisionedBandwidthDowngradeTime == null) {
this.nextAllowedProvisionedBandwidthDowngradeTime = null;
} else {
this.nextAllowedProvisionedBandwidthDowngradeTime
= new DateTimeRfc1123(nextAllowedProvisionedBandwidthDowngradeTime);
}
return this;
}

/**
* Get the metadata property: Dictionary of &lt;string&gt;.
*
Expand Down Expand Up @@ -673,6 +793,12 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt
xmlWriter.writeBooleanElement("PaidBurstingEnabled", this.paidBurstingEnabled);
xmlWriter.writeNumberElement("PaidBurstingMaxIops", this.paidBurstingMaxIops);
xmlWriter.writeNumberElement("PaidBurstingMaxBandwidthMibps", this.paidBurstingMaxBandwidthMibps);
xmlWriter.writeNumberElement("IncludedBurstIops", this.includedBurstIops);
xmlWriter.writeNumberElement("MaxBurstCreditsForIops", this.maxBurstCreditsForIops);
xmlWriter.writeStringElement("NextAllowedProvisionedIopsDowngradeTime",
Objects.toString(this.nextAllowedProvisionedIopsDowngradeTime, null));
xmlWriter.writeStringElement("NextAllowedProvisionedBandwidthDowngradeTime",
Objects.toString(this.nextAllowedProvisionedBandwidthDowngradeTime, null));
if (this.metadata != null) {
xmlWriter.writeStartElement("Metadata");
for (Map.Entry<String, String> entry : this.metadata.entrySet()) {
Expand Down Expand Up @@ -774,6 +900,17 @@ public static SharePropertiesInternal fromXml(XmlReader xmlReader, String rootEl
} else if ("PaidBurstingMaxBandwidthMibps".equals(elementName.getLocalPart())) {
deserializedSharePropertiesInternal.paidBurstingMaxBandwidthMibps
= reader.getNullableElement(Long::parseLong);
} else if ("IncludedBurstIops".equals(elementName.getLocalPart())) {
deserializedSharePropertiesInternal.includedBurstIops = reader.getNullableElement(Long::parseLong);
} else if ("MaxBurstCreditsForIops".equals(elementName.getLocalPart())) {
deserializedSharePropertiesInternal.maxBurstCreditsForIops
= reader.getNullableElement(Long::parseLong);
} else if ("NextAllowedProvisionedIopsDowngradeTime".equals(elementName.getLocalPart())) {
deserializedSharePropertiesInternal.nextAllowedProvisionedIopsDowngradeTime
= reader.getNullableElement(DateTimeRfc1123::new);
} else if ("NextAllowedProvisionedBandwidthDowngradeTime".equals(elementName.getLocalPart())) {
deserializedSharePropertiesInternal.nextAllowedProvisionedBandwidthDowngradeTime
= reader.getNullableElement(DateTimeRfc1123::new);
} else if ("Metadata".equals(elementName.getLocalPart())) {
while (reader.nextElement() != XmlToken.END_ELEMENT) {
if (deserializedSharePropertiesInternal.metadata == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,31 @@
*/
@Fluent
public final class SharesCreateHeaders {
/*
* The x-ms-share-provisioned-bandwidth-mibps property.
*/
private Long xMsShareProvisionedBandwidthMibps;

/*
* The x-ms-share-provisioned-iops property.
*/
private Long xMsShareProvisionedIops;

/*
* The x-ms-share-included-burst-iops property.
*/
private Long xMsShareIncludedBurstIops;

/*
* The x-ms-version property.
*/
private String xMsVersion;

/*
* The x-ms-share-quota property.
*/
private Integer xMsShareQuota;

/*
* The ETag property.
*/
Expand All @@ -40,16 +60,43 @@ public final class SharesCreateHeaders {
*/
private DateTimeRfc1123 date;

private static final HttpHeaderName X_MS_SHARE_PROVISIONED_BANDWIDTH_MIBPS
= HttpHeaderName.fromString("x-ms-share-provisioned-bandwidth-mibps");

private static final HttpHeaderName X_MS_SHARE_PROVISIONED_IOPS
= HttpHeaderName.fromString("x-ms-share-provisioned-iops");

private static final HttpHeaderName X_MS_SHARE_INCLUDED_BURST_IOPS
= HttpHeaderName.fromString("x-ms-share-included-burst-iops");

private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version");

private static final HttpHeaderName X_MS_SHARE_QUOTA = HttpHeaderName.fromString("x-ms-share-quota");

// HttpHeaders containing the raw property values.
/**
* Creates an instance of SharesCreateHeaders class.
*
* @param rawHeaders The raw HttpHeaders that will be used to create the property values.
*/
public SharesCreateHeaders(HttpHeaders rawHeaders) {
String xMsShareProvisionedBandwidthMibps = rawHeaders.getValue(X_MS_SHARE_PROVISIONED_BANDWIDTH_MIBPS);
if (xMsShareProvisionedBandwidthMibps != null) {
this.xMsShareProvisionedBandwidthMibps = Long.parseLong(xMsShareProvisionedBandwidthMibps);
}
String xMsShareProvisionedIops = rawHeaders.getValue(X_MS_SHARE_PROVISIONED_IOPS);
if (xMsShareProvisionedIops != null) {
this.xMsShareProvisionedIops = Long.parseLong(xMsShareProvisionedIops);
}
String xMsShareIncludedBurstIops = rawHeaders.getValue(X_MS_SHARE_INCLUDED_BURST_IOPS);
if (xMsShareIncludedBurstIops != null) {
this.xMsShareIncludedBurstIops = Long.parseLong(xMsShareIncludedBurstIops);
}
this.xMsVersion = rawHeaders.getValue(X_MS_VERSION);
String xMsShareQuota = rawHeaders.getValue(X_MS_SHARE_QUOTA);
if (xMsShareQuota != null) {
this.xMsShareQuota = Integer.parseInt(xMsShareQuota);
}
this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG);
String lastModified = rawHeaders.getValue(HttpHeaderName.LAST_MODIFIED);
if (lastModified != null) {
Expand All @@ -62,6 +109,66 @@ public SharesCreateHeaders(HttpHeaders rawHeaders) {
}
}

/**
* Get the xMsShareProvisionedBandwidthMibps property: The x-ms-share-provisioned-bandwidth-mibps property.
*
* @return the xMsShareProvisionedBandwidthMibps value.
*/
public Long getXMsShareProvisionedBandwidthMibps() {
return this.xMsShareProvisionedBandwidthMibps;
}

/**
* Set the xMsShareProvisionedBandwidthMibps property: The x-ms-share-provisioned-bandwidth-mibps property.
*
* @param xMsShareProvisionedBandwidthMibps the xMsShareProvisionedBandwidthMibps value to set.
* @return the SharesCreateHeaders object itself.
*/
public SharesCreateHeaders setXMsShareProvisionedBandwidthMibps(Long xMsShareProvisionedBandwidthMibps) {
this.xMsShareProvisionedBandwidthMibps = xMsShareProvisionedBandwidthMibps;
return this;
}

/**
* Get the xMsShareProvisionedIops property: The x-ms-share-provisioned-iops property.
*
* @return the xMsShareProvisionedIops value.
*/
public Long getXMsShareProvisionedIops() {
return this.xMsShareProvisionedIops;
}

/**
* Set the xMsShareProvisionedIops property: The x-ms-share-provisioned-iops property.
*
* @param xMsShareProvisionedIops the xMsShareProvisionedIops value to set.
* @return the SharesCreateHeaders object itself.
*/
public SharesCreateHeaders setXMsShareProvisionedIops(Long xMsShareProvisionedIops) {
this.xMsShareProvisionedIops = xMsShareProvisionedIops;
return this;
}

/**
* Get the xMsShareIncludedBurstIops property: The x-ms-share-included-burst-iops property.
*
* @return the xMsShareIncludedBurstIops value.
*/
public Long getXMsShareIncludedBurstIops() {
return this.xMsShareIncludedBurstIops;
}

/**
* Set the xMsShareIncludedBurstIops property: The x-ms-share-included-burst-iops property.
*
* @param xMsShareIncludedBurstIops the xMsShareIncludedBurstIops value to set.
* @return the SharesCreateHeaders object itself.
*/
public SharesCreateHeaders setXMsShareIncludedBurstIops(Long xMsShareIncludedBurstIops) {
this.xMsShareIncludedBurstIops = xMsShareIncludedBurstIops;
return this;
}

/**
* Get the xMsVersion property: The x-ms-version property.
*
Expand All @@ -82,6 +189,26 @@ public SharesCreateHeaders setXMsVersion(String xMsVersion) {
return this;
}

/**
* Get the xMsShareQuota property: The x-ms-share-quota property.
*
* @return the xMsShareQuota value.
*/
public Integer getXMsShareQuota() {
return this.xMsShareQuota;
}

/**
* Set the xMsShareQuota property: The x-ms-share-quota property.
*
* @param xMsShareQuota the xMsShareQuota value to set.
* @return the SharesCreateHeaders object itself.
*/
public SharesCreateHeaders setXMsShareQuota(Integer xMsShareQuota) {
this.xMsShareQuota = xMsShareQuota;
return this;
}

/**
* Get the eTag property: The ETag property.
*
Expand Down
Loading

0 comments on commit 7678d76

Please sign in to comment.