From 14f497f2a3af1450d580a5f699a9d228c7bf543a Mon Sep 17 00:00:00 2001 From: Local Merge Date: Wed, 8 Jul 2026 15:39:28 +0530 Subject: [PATCH 01/13] typespec migration --- .../azure-storage-queue/customization/pom.xml | 21 + .../main/java/QueueStorageCustomizations.java | 530 ++++ .../azure/storage/queue/QueueAsyncClient.java | 128 +- .../com/azure/storage/queue/QueueClient.java | 164 +- .../storage/queue/QueueClientBuilder.java | 6 +- .../queue/QueueServiceAsyncClient.java | 45 +- .../storage/queue/QueueServiceClient.java | 62 +- .../queue/QueueServiceClientBuilder.java | 2 +- .../implementation/AzureQueueStorageImpl.java | 43 +- .../queue/implementation/MessageIdsImpl.java | 778 ++--- .../queue/implementation/MessagesImpl.java | 1604 +++-------- .../queue/implementation/QueuesImpl.java | 1930 +++---------- .../queue/implementation/ServicesImpl.java | 2556 +++++------------ .../queue/implementation/models/KeyInfo.java | 83 +- .../models/ListOfSentMessage.java | 114 + .../models/ListQueuesIncludeType.java | 51 + .../models/PeekedMessageItemInternal.java | 170 +- .../implementation/models/PeekedMessages.java | 113 + .../implementation/models/QueueMessage.java | 47 +- .../models/QueueMessageItemInternal.java | 238 +- .../models/ReceivedMessages.java | 113 + .../models/SignedIdentifiers.java | 114 + .../implementation/models/package-info.java | 8 +- .../queue/implementation/package-info.java | 6 +- .../implementation/util/ModelHelper.java | 176 ++ .../storage/queue/models/GeoReplication.java | 52 +- .../queue/models/GeoReplicationStatus.java | 18 +- .../queue/models/QueueAccessPolicy.java | 50 +- .../queue/models/QueueAnalyticsLogging.java | 90 +- .../storage/queue/models/QueueCorsRule.java | 105 +- .../azure/storage/queue/models/QueueItem.java | 47 +- .../storage/queue/models/QueueMetrics.java | 78 +- .../queue/models/QueueRetentionPolicy.java | 52 +- .../queue/models/QueueServiceProperties.java | 136 +- .../queue/models/QueueServiceStatistics.java | 27 +- .../queue/models/QueueSignedIdentifier.java | 44 +- .../queue/models/SendMessageResult.java | 104 +- .../queue/models/UserDelegationKey.java | 254 +- .../storage/queue/models/package-info.java | 6 +- .../com/azure/storage/queue/package-info.java | 4 +- .../azure-storage-queue-tsp_metadata.json | 1 + .../azure-storage-queue_metadata.json | 1 + .../azure-storage-queue-tsp.properties | 2 + .../azure/storage/queue/QueueTestBase.java | 19 +- .../azure-storage-queue/tsp-location.yaml | 5 + 45 files changed, 4065 insertions(+), 6132 deletions(-) create mode 100644 sdk/storage/azure-storage-queue/customization/pom.xml create mode 100644 sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListQueuesIncludeType.java create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java create mode 100644 sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue-tsp_metadata.json create mode 100644 sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json create mode 100644 sdk/storage/azure-storage-queue/src/main/resources/azure-storage-queue-tsp.properties create mode 100644 sdk/storage/azure-storage-queue/tsp-location.yaml diff --git a/sdk/storage/azure-storage-queue/customization/pom.xml b/sdk/storage/azure-storage-queue/customization/pom.xml new file mode 100644 index 000000000000..2a4b2b8b06e7 --- /dev/null +++ b/sdk/storage/azure-storage-queue/customization/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.azure + azure-code-customization-parent + 1.0.0-beta.1 + ../../../parents/azure-code-customization-parent + + + Microsoft Azure Queue Storage client customization for Java + This package contains client customization for Microsoft Azure Queue Storage + + com.azure.tools + azure-storage-queue-customization + 1.0.0-beta.1 + jar + diff --git a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java new file mode 100644 index 000000000000..68ff6231778b --- /dev/null +++ b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.Editor; +import com.azure.autorest.customization.LibraryCustomization; +import com.azure.autorest.customization.PackageCustomization; +import com.github.javaparser.ParseProblemException; +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.Modifier; +import com.github.javaparser.ast.Node; +import com.github.javaparser.ast.NodeList; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import com.github.javaparser.ast.body.ConstructorDeclaration; +import com.github.javaparser.ast.body.FieldDeclaration; +import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.body.VariableDeclarator; +import com.github.javaparser.ast.expr.NormalAnnotationExpr; +import com.github.javaparser.ast.expr.ObjectCreationExpr; +import com.github.javaparser.ast.expr.SingleMemberAnnotationExpr; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.stmt.CatchClause; +import com.github.javaparser.ast.stmt.ReturnStmt; +import com.github.javaparser.ast.stmt.Statement; +import com.github.javaparser.ast.stmt.TryStmt; +import com.github.javaparser.ast.type.ClassOrInterfaceType; +import com.github.javaparser.ast.type.Type; +import org.slf4j.Logger; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +/** + * TypeSpec customization for azure-storage-queue. + * + *

Two responsibilities, replacing what the AutoRest setup did via {@code swagger/README.md} + * directives plus the old {@code QueueStorageCustomization} post-processor:

+ * + *
    + *
  1. Remove the generated public client surface. typespec-java emits a public + * convenience client/builder per operation group (QueueClient, QueueAsyncClient, + * ServiceClient, MessagesClient, MessageIdsClient, AzureQueueStorageBuilder, ...) plus a + * QueuesServiceVersion. The shipped library hand-writes that surface + * (QueueClient/QueueAsyncClient/QueueServiceClient/QueueServiceAsyncClient/builders/ + * QueueServiceVersion in {@code com.azure.storage.queue}). We drop the codegen copies so the + * hand-written versions are not overwritten by {@code tsp-client update}. The generated + * implementation layer ({@code com.azure.storage.queue.implementation.AzureQueueStorageImpl} + * and the *Impl operation groups) is preserved and used by the hand-written clients. No impl + * rename is needed because Q1 ({@code @@clientName(Storage.Queues,"AzureQueueStorage","java")}) + * already keeps the impl named AzureQueueStorageImpl, which the hand-written layer references.
  2. + * + *
  3. Map the internal exception type. Wrap every impl proxy method so + * {@code QueueStorageExceptionInternal} is mapped to the public {@code QueueStorageException} + * (async: {@code .onErrorMap(QueueStorageExceptionInternal.class, + * ModelHelper::mapToQueueStorageException)}; sync: try/catch rethrowing + * {@code ModelHelper.mapToQueueStorageException(e)}). Ported verbatim from the AutoRest + * {@code QueueStorageCustomization}.
  4. + *
+ */ +public class QueueStorageCustomizations extends Customization { + + private static final String ROOT_FILE_PATH = "src/main/java/com/azure/storage/queue/"; + + // Generated public client surface to drop so the hand-written equivalents survive regeneration. + // QueueClient / QueueAsyncClient collide by name with the hand-written clients (the emitter + // would otherwise overwrite them); the rest are net-new generated clients/builders/version that + // the hand-written convenience layer replaces. + private static final String[] FILES_TO_REMOVE = new String[] { + "QueueClient.java", + "QueueAsyncClient.java", + "ServiceClient.java", + "ServiceAsyncClient.java", + "MessagesClient.java", + "MessagesAsyncClient.java", + "MessageIdsClient.java", + "MessageIdsAsyncClient.java", + "AzureQueueStorageBuilder.java", + "QueuesServiceVersion.java" + }; + + // Public models the emitter renders immutable (required-args or private constructor, final fields, no setters) + // that the shipped library exposes as @Fluent (no-arg constructor + setters). See restoreFluentModels. + private static final List FLUENT_MODELS = Arrays.asList( + "QueueRetentionPolicy", "QueueMetrics", "QueueCorsRule", "QueueAnalyticsLogging", "QueueSignedIdentifier", + "GeoReplication", "QueueItem", "QueueServiceStatistics", "SendMessageResult", "UserDelegationKey"); + + @Override + public void customize(LibraryCustomization customization, Logger logger) { + Editor editor = customization.getRawEditor(); + removeGeneratedPublicClients(editor, logger); + preserveHandwrittenModuleInfo(editor, logger); + retargetServiceVersionReferences(editor, logger); + restoreAccessPolicyDateTimeType(editor, logger); + restoreFluentModels(customization, logger); + exposeRawListQueuesResponse(customization.getPackage("com.azure.storage.queue.implementation"), logger); + updateImplToMapInternalException(customization.getPackage("com.azure.storage.queue.implementation"), logger); + } + + // AccessPolicy.start/expiry are utcDateTime in the spec but carry @encode("rfc3339-fixed-width") (a non-standard + // encoding present so the Rust emitter forces exactly 7 fractional-second digits). The typespec-java emitter does + // not recognize that encoding and degrades the two properties to String, whereas the same emitter correctly emits + // OffsetDateTime for a plain utcDateTime (see KeyInfo.expiry). The shipped public model + // com.azure.storage.queue.models.QueueAccessPolicy exposes OffsetDateTime getStartsOn()/getExpiresOn() (and .NET's + // migration keeps DateTimeOffset), and the hand-written setAccessPolicy path relies on OffsetDateTime (it truncates + // to seconds before serializing). Restore the OffsetDateTime type using the exact serialization the emitter already + // produces for utcDateTime (ISO_OFFSET_DATE_TIME on write, CoreUtils.parseBestOffsetDateTime on read); the second + // truncation in the hand-written layer means no fractional-second precision is emitted, so the fixed-width concern + // that motivated the encode does not arise on the Java write path. + private static void restoreAccessPolicyDateTimeType(Editor editor, Logger logger) { + String path = "src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java"; + String content = editor.getContents().get(path); + if (content == null) { + logger.info("QueueAccessPolicy.java not present; skipping date-time type restoration."); + return; + } + if (content.contains("private OffsetDateTime startsOn;")) { + logger.info("QueueAccessPolicy already uses OffsetDateTime; skipping."); + return; + } + String updated = content + .replace("import com.azure.core.annotation.Generated;", + "import com.azure.core.annotation.Generated;\n" + + "import com.azure.core.util.CoreUtils;\n" + + "import java.time.OffsetDateTime;\n" + + "import java.time.format.DateTimeFormatter;") + .replace("private String startsOn;", "private OffsetDateTime startsOn;") + .replace("private String expiresOn;", "private OffsetDateTime expiresOn;") + .replace("public String getStartsOn() {", "public OffsetDateTime getStartsOn() {") + .replace("public String getExpiresOn() {", "public OffsetDateTime getExpiresOn() {") + .replace("public QueueAccessPolicy setStartsOn(String startsOn) {", + "public QueueAccessPolicy setStartsOn(OffsetDateTime startsOn) {") + .replace("public QueueAccessPolicy setExpiresOn(String expiresOn) {", + "public QueueAccessPolicy setExpiresOn(OffsetDateTime expiresOn) {") + .replace("xmlWriter.writeStringElement(\"Start\", this.startsOn);", + "xmlWriter.writeStringElement(\"Start\",\n" + + " this.startsOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startsOn));") + .replace("xmlWriter.writeStringElement(\"Expiry\", this.expiresOn);", + "xmlWriter.writeStringElement(\"Expiry\",\n" + + " this.expiresOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiresOn));") + .replace("deserializedQueueAccessPolicy.startsOn = reader.getStringElement();", + "deserializedQueueAccessPolicy.startsOn = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString));") + .replace("deserializedQueueAccessPolicy.expiresOn = reader.getStringElement();", + "deserializedQueueAccessPolicy.expiresOn = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString));"); + editor.replaceFile(path, updated); + logger.info("Restored OffsetDateTime type for QueueAccessPolicy startsOn/expiresOn."); + } + + // The typespec-java emitter makes every model that has a required spec property immutable: input models + // (required @@usage) get a public required-args constructor + final fields + no setters, and output-only + // models get a private constructor + final fields + no setters (@Immutable). The shipped Storage public + // models are uniformly @Fluent (no-arg constructor + fluent setters); all four hand-written clients, the + // SAS helpers, the samples and the recorded tests build against that fluent shape, and .NET's migration + // keeps the same mutable models. Restore the fluent shape so the migration stays 100% source-compatible + // (no revapi break). The transform per model is uniform: swap @Immutable -> @Fluent, drop `final` from the + // instance fields, replace the generated constructor with a public no-arg constructor, add a fluent setter + // for every property that lost one, and rewrite fromXml to build via the no-arg constructor + field + // assignment. DateTimeRfc1123 backing fields (GeoReplication.lastSyncTime, SendMessageResult.*Time) keep + // their OffsetDateTime public accessors, reusing the exact OffsetDateTime<->DateTimeRfc1123 conversion the + // emitter already generates on those fields. + private static void restoreFluentModels(LibraryCustomization customization, Logger logger) { + PackageCustomization models = customization.getPackage("com.azure.storage.queue.models"); + for (String className : FLUENT_MODELS) { + if (models.getClass(className) == null) { + logger.info("Model {} not present; skipping fluent restoration.", className); + continue; + } + models.getClass(className).customizeAst(ast -> { + ast.addImport("com.azure.core.annotation.Fluent"); + ast.getImports().removeIf(i -> i.getNameAsString().equals("com.azure.core.annotation.Immutable")); + ast.getClassByName(className).ifPresent(clazz -> makeModelFluent(clazz, logger)); + }); + logger.info("Restored @Fluent shape for {}.", className); + } + } + + private static void makeModelFluent(ClassOrInterfaceDeclaration clazz, Logger logger) { + String className = clazz.getNameAsString(); + + // @Immutable -> @Fluent (QueueRetentionPolicy/QueueMetrics are already @Fluent). + clazz.getAnnotationByName("Immutable").ifPresent(a -> a.remove()); + if (!clazz.isAnnotationPresent("Fluent")) { + clazz.addMarkerAnnotation("Fluent"); + } + + // Drop `final` from the instance fields so they can be set after construction. + clazz.getFields().forEach(field -> { + if (!field.isStatic()) { + field.setFinal(false); + } + }); + + // Replace the generated constructor(s) with a single public no-arg constructor. + new ArrayList<>(clazz.getConstructors()).forEach(ConstructorDeclaration::remove); + ConstructorDeclaration ctor = clazz.addConstructor(Modifier.Keyword.PUBLIC); + ctor.addMarkerAnnotation("Generated"); + ctor.setBody(new BlockStmt()); + + // Add a fluent setter for every property that lost one. The setter's parameter type mirrors the + // property's public accessor return type (which differs from the backing field for DateTimeRfc1123). + for (FieldDeclaration field : clazz.getFields()) { + if (field.isStatic()) { + continue; + } + String fieldName = field.getVariable(0).getNameAsString(); + String setterName = "set" + capitalize(fieldName); + if (!clazz.getMethodsByName(setterName).isEmpty()) { + continue; + } + String fieldType = field.getElementType().asString(); + // Clone so the parameter does not steal the accessor/field's live Type node from the AST. + Type accessorType = accessorReturnType(clazz, fieldName).orElse(field.getElementType()).clone(); + String body; + if ("DateTimeRfc1123".equals(fieldType) && "OffsetDateTime".equals(accessorType.asString())) { + body = "{ if (" + fieldName + " == null) { this." + fieldName + " = null; } else { this." + + fieldName + " = new DateTimeRfc1123(" + fieldName + "); } return this; }"; + } else { + body = "{ this." + fieldName + " = " + fieldName + "; return this; }"; + } + MethodDeclaration setter = clazz.addMethod(setterName, Modifier.Keyword.PUBLIC); + setter.addMarkerAnnotation("Generated"); + setter.setType(className); + setter.addParameter(new Parameter(accessorType, fieldName)); + setter.setBody(StaticJavaParser.parseBlock(body)); + } + + // Rewrite fromXml: the emitter builds the instance with the (now removed) generated constructor, e.g. + // `return new X(a, b);` or `X d = new X(a); d.opt = opt;`. Rebuild via the no-arg constructor and assign + // each former constructor argument to its field (converting OffsetDateTime -> DateTimeRfc1123 where the + // backing field requires it), matching how the emitter already assigns the optional fields. + clazz.findAll(ObjectCreationExpr.class).stream() + .filter(oce -> oce.getType().getNameAsString().equals(className) && !oce.getArguments().isEmpty()) + .forEach(oce -> rewriteFromXmlConstruction(clazz, oce)); + } + + private static void rewriteFromXmlConstruction(ClassOrInterfaceDeclaration clazz, ObjectCreationExpr oce) { + String className = clazz.getNameAsString(); + List argNames = new ArrayList<>(); + oce.getArguments().forEach(arg -> argNames.add(arg.toString())); + oce.setArguments(new NodeList<>()); // new X() + + Optional asInitializer = oce.getParentNode() + .filter(p -> p instanceof VariableDeclarator).map(p -> (VariableDeclarator) p); + if (asInitializer.isPresent()) { + // Shape: `X deserializedX = new X(args); ` + String localName = asInitializer.get().getNameAsString(); + Statement declStmt = findAncestor(oce, Statement.class).orElseThrow( + () -> new IllegalStateException("No enclosing statement for " + className + " construction.")); + BlockStmt block = (BlockStmt) declStmt.getParentNode().orElseThrow( + () -> new IllegalStateException("No enclosing block for " + className + " construction.")); + int idx = block.getStatements().indexOf(declStmt); + int offset = 1; + for (String argName : argNames) { + block.addStatement(idx + offset, StaticJavaParser.parseStatement( + fieldAssignment(clazz, localName, argName))); + offset++; + } + } else { + // Shape: `return new X(args);` -> introduce a local, assign, and return it. + ReturnStmt ret = findAncestor(oce, ReturnStmt.class).orElseThrow( + () -> new IllegalStateException("Unexpected " + className + " construction context.")); + String localName = "deserialized" + className; + BlockStmt rebuilt = new BlockStmt(); + rebuilt.addStatement(StaticJavaParser.parseStatement(className + " " + localName + " = new " + className + "();")); + for (String argName : argNames) { + rebuilt.addStatement(StaticJavaParser.parseStatement(fieldAssignment(clazz, localName, argName))); + } + rebuilt.addStatement(new ReturnStmt(StaticJavaParser.parseExpression(localName))); + ret.replace(rebuilt); + } + } + + // Assignment for a former constructor argument (local var name == field name). OffsetDateTime locals feeding + // a DateTimeRfc1123 field are converted, mirroring the emitter's own constructor logic for those fields. + private static String fieldAssignment(ClassOrInterfaceDeclaration clazz, String localName, String fieldName) { + boolean rfc1123 = clazz.getFieldByName(fieldName) + .map(f -> "DateTimeRfc1123".equals(f.getElementType().asString())).orElse(false); + if (rfc1123) { + return localName + "." + fieldName + " = " + fieldName + " == null ? null : new DateTimeRfc1123(" + + fieldName + ");"; + } + return localName + "." + fieldName + " = " + fieldName + ";"; + } + + private static Optional accessorReturnType(ClassOrInterfaceDeclaration clazz, String fieldName) { + String suffix = capitalize(fieldName); + for (String prefix : new String[] { "get", "is" }) { + List getters = clazz.getMethodsByName(prefix + suffix); + for (MethodDeclaration getter : getters) { + if (getter.getParameters().isEmpty()) { + return Optional.of(getter.getType()); + } + } + } + return Optional.empty(); + } + + private static String capitalize(String value) { + return Character.toUpperCase(value.charAt(0)) + value.substring(1); + } + + private static Optional findAncestor(Node node, Class type) { + Optional parent = node.getParentNode(); + while (parent.isPresent()) { + Node current = parent.get(); + if (type.isInstance(current)) { + return Optional.of(type.cast(current)); + } + parent = current.getParentNode(); + } + return Optional.empty(); + } + + // The emitter models "List Queues" with @list + a body-sourced @continuationToken (NextMarker), but the + // typespec-java protocol paging path (see ServicesImpl.getQueuesSinglePage[Async]) discards that marker + // (continuation token hard-coded to null) and JSON-parses the XML body, so it cannot drive the hand-written + // PagedFlux/PagedIterable continuation loop. Until the emitter honors body @continuationToken (tracked + // against @azure-tools/typespec-java; Go's azqueue and .NET's Azure.Storage.Queues both preserve NextMarker from + // the same spec), expose a raw single-response accessor over the existing proxy call so the hand-written service + // clients can deserialize ListQueuesSegmentResponse (getQueueItems + getNextMarker) themselves. This mirrors the + // shape .NET's generator emits by default (GetQueuesSegment). The two injected methods are intentionally left + // without exception mapping here so updateImplToMapInternalException wraps them identically to every other + // WithResponse accessor. The accessor lives in the non-exported implementation package, so it is not public API. + private static void exposeRawListQueuesResponse(PackageCustomization implPackage, Logger logger) { + if (implPackage.getClass("ServicesImpl") == null) { + logger.info("ServicesImpl not present; skipping raw list-queues accessor injection."); + return; + } + implPackage.getClass("ServicesImpl").customizeAst(ast -> ast.getClassByName("ServicesImpl").ifPresent(clazz -> { + clazz.addMember(StaticJavaParser.parseMethodDeclaration( + "@ServiceMethod(returns = ReturnType.SINGLE)\n" + + "public Mono> getQueuesWithResponseAsync(RequestOptions requestOptions) {\n" + + " final String accept = \"application/xml\";\n" + + " return FluxUtil.withContext(context -> service.getQueues(this.client.getUrl(),\n" + + " this.client.getServiceVersion().getVersion(), accept, requestOptions, context));\n" + + "}")); + clazz.addMember(StaticJavaParser.parseMethodDeclaration( + "@ServiceMethod(returns = ReturnType.SINGLE)\n" + + "public Response getQueuesWithResponse(RequestOptions requestOptions) {\n" + + " final String accept = \"application/xml\";\n" + + " return service.getQueuesSync(this.client.getUrl(),\n" + + " this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);\n" + + "}")); + logger.info("Injected raw getQueuesWithResponse[Async] accessors into ServicesImpl."); + })); + } + + // The emitter derives the service-version enum name from the "Queues" service namespace, emitting + // QueuesServiceVersion (and referencing it from every impl proxy). The hand-written public layer + // (builders/clients) uses the shipped QueueServiceVersion. We drop the generated QueuesServiceVersion.java + // (in FILES_TO_REMOVE) and rewrite the impl references to the hand-written QueueServiceVersion, mirroring + // the service-version retarget AppConfiguration does in its customization. + private static void retargetServiceVersionReferences(Editor editor, Logger logger) { + String implDir = "src/main/java/com/azure/storage/queue/implementation/"; + for (String fileName : new String[] { + "AzureQueueStorageImpl.java", "ServicesImpl.java", "QueuesImpl.java", + "MessagesImpl.java", "MessageIdsImpl.java" }) { + String path = implDir + fileName; + String content = editor.getContents().get(path); + if (content == null || !content.contains("QueuesServiceVersion")) { + continue; + } + // Rewrite both the import (com.azure.storage.queue.QueuesServiceVersion) and every bare reference. + String updated = content.replace("QueuesServiceVersion", "QueueServiceVersion"); + editor.replaceFile(path, updated); + logger.info("Retargeted QueuesServiceVersion -> QueueServiceVersion in {}.", fileName); + } + } + + // The emitter emits a generic module-info.java that drops the Storage-specific module directives + // (requires transitive com.azure.storage.common, exports com.azure.storage.queue.sas, + // opens com.azure.storage.queue.implementation). The shipped module-info is hand-written and is the + // authoritative superset, so drop the generated copy to avoid overwriting it. + private static void preserveHandwrittenModuleInfo(Editor editor, Logger logger) { + String path = "src/main/java/module-info.java"; + if (editor.getContents().containsKey(path)) { + editor.removeFile(path); + logger.info("Removed generated module-info.java to preserve the hand-written module descriptor."); + } else { + logger.info("Generated module-info.java not present; nothing to remove."); + } + } + + private static void removeGeneratedPublicClients(Editor editor, Logger logger) { + for (String fileName : FILES_TO_REMOVE) { + String path = ROOT_FILE_PATH + fileName; + if (editor.getContents().containsKey(path)) { + editor.removeFile(path); + logger.info("Removed generated public client {}", path); + } else { + logger.info("Generated file {} not present; skipping removal.", path); + } + } + } + + /** + * Customizes the implementation classes that will perform calls to the service. The following logic is used: + *

+ * - Check for the return of the method not equaling to PagedFlux, PagedIterable, PollerFlux, or SyncPoller. Those + * types wrap other APIs and those APIs being update is the correct change. + * - For asynchronous methods, add a call to + * {@code .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException)} to handle + * mapping QueueStorageExceptionInternal to QueueStorageException. + * - For synchronous methods, wrap the return statement in a try-catch block that catches + * QueueStorageExceptionInternal and rethrows {@code ModelHelper.mapToQueueStorageException(e)}. Or, for void + * methods wrap the last statement. + * + * @param implPackage The implementation package. + */ + private static void updateImplToMapInternalException(PackageCustomization implPackage, Logger logger) { + // The operation-group set depends on the @@clientLocation split in client.tsp. Guard each + // class so the customization is robust whether the impl is the 4-group AutoRest topology + // (MessageIds/Messages/Queues/Services) or a reduced set. + List implsToUpdate = Arrays.asList("MessageIdsImpl", "MessagesImpl", "QueuesImpl", "ServicesImpl"); + for (String implToUpdate : implsToUpdate) { + if (implPackage.getClass(implToUpdate) == null) { + logger.info("Impl class {} not present; skipping exception mapping.", implToUpdate); + continue; + } + implPackage.getClass(implToUpdate).customizeAst(ast -> { + ast.addImport("com.azure.storage.queue.implementation.util.ModelHelper"); + ast.addImport("com.azure.storage.queue.models.QueueStorageException"); + ast.addImport("com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal"); + // The emitter annotates the @ServiceInterface methods with a default + // @UnexpectedResponseExceptionType(HttpResponseException.class) plus per-status-code entries mapping + // 401/404/409 to generic azure-core exceptions (ClientAuthenticationException, ResourceNotFoundException, + // ResourceModifiedException). AutoRest emitted only the single default. Two problems with the per-code + // entries: (1) their getValue() returns Object, so azure-core cannot deserialize the XML error body via + // azure-xml and falls back to Jackson; (2) they would surface a non-QueueStorageException type to callers + // for those status codes, breaking public behavior. Remove every per-code entry (any + // @UnexpectedResponseExceptionType carrying a 'code' member) so all unexpected responses route through + // the single default, matching AutoRest. + ast.findAll(NormalAnnotationExpr.class).stream() + .filter(anno -> anno.getNameAsString().equals("UnexpectedResponseExceptionType") + && anno.getPairs().stream().anyMatch(p -> p.getNameAsString().equals("code"))) + .collect(java.util.stream.Collectors.toList()) + .forEach(Node::remove); + // Retarget the remaining default annotation to the internal exception type so the pipeline throws + // QueueStorageExceptionInternal (a subtype of HttpResponseException), which the error mapping below maps + // to the public QueueStorageException. The durable fix is the tspconfig 'default-http-exception-type' + // option; this keeps the customization self-sufficient regardless of that setting. + ast.findAll(SingleMemberAnnotationExpr.class).forEach(anno -> { + if (anno.getNameAsString().equals("UnexpectedResponseExceptionType") + && "HttpResponseException.class".equals(anno.getMemberValue().toString())) { + anno.setMemberValue(StaticJavaParser.parseExpression("QueueStorageExceptionInternal.class")); + } + }); + ast.getClassByName(implToUpdate).ifPresent(clazz -> { + clazz.getMethods().forEach(methodDeclaration -> { + Type returnType = methodDeclaration.getType(); + // The way code generation works we only need to update the methods that have a class return type. + // As non-class return types, such as "void", call into the Response methods. + if (!returnType.isClassOrInterfaceType()) { + return; + } + + ClassOrInterfaceType returnTypeClass = returnType.asClassOrInterfaceType(); + String returnTypeName = returnTypeClass.getNameAsString(); + if (returnTypeName.equals("PagedFlux") || returnTypeName.equals("PagedIterable") + || returnTypeName.equals("PollerFlux") || returnTypeName.equals("SyncPoller")) { + return; + } + + if (returnTypeName.equals("Mono") || returnTypeName.equals("Flux")) { + addErrorMappingToAsyncMethod(methodDeclaration); + } else { + addErrorMappingToSyncMethod(methodDeclaration); + } + }); + }); + }); + logger.info("Applied QueueStorageExceptionInternal -> QueueStorageException mapping to {}.", implToUpdate); + } + } + + private static void addErrorMappingToAsyncMethod(MethodDeclaration method) { + BlockStmt body = method.getBody().get(); + + // Bit of hack to insert the 'onErrorMap' in the right location. + // Unfortunately, 'onErrorMap' returns which for some calls breaks typing, such as Void -> Object or + // PagedResponse -> PagedResponseBase. So, 'onErrorMap' needs to be inserted after the first method call. + // To do this, we track the first found '(' and the associated closing ')' to insert 'onErrorMap' after the ')'. + // So, 'service.methodCall(parameters).map()' becomes 'service.methodCall(parameters).onErrorMap().map()'. + String originalReturnStatement = body.getStatement(body.getStatements().size() - 1).asReturnStmt() + .getExpression().get().toString(); + int insertionPoint = findAsyncOnErrorMapInsertionPoint(originalReturnStatement); + String newReturnStatement = "return " + originalReturnStatement.substring(0, insertionPoint) + + ".onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException)" + + originalReturnStatement.substring(insertionPoint) + ";"; + try { + Statement newReturn = StaticJavaParser.parseStatement(newReturnStatement); + body.getStatements().set(body.getStatements().size() - 1, newReturn); + } catch (ParseProblemException ex) { + throw new RuntimeException("Failed to parse: " + newReturnStatement, ex); + } + } + + private static int findAsyncOnErrorMapInsertionPoint(String returnStatement) { + int openParenthesis = 0; + int closeParenthesis = 0; + for (int i = 0; i < returnStatement.length(); i++) { + char c = returnStatement.charAt(i); + if (c == '(') { + openParenthesis++; + } else if (c == ')') { + closeParenthesis++; + if (openParenthesis == closeParenthesis) { + return i + 1; + } + } + } + return -1; + } + + private static void addErrorMappingToSyncMethod(MethodDeclaration method) { + // Turn the entire method into a BlockStmt that will be used as the try block. + BlockStmt tryBlock = method.getBody().get(); + BlockStmt catchBlock = new BlockStmt(new NodeList<>(StaticJavaParser.parseStatement( + "throw ModelHelper.mapToQueueStorageException(internalException);"))); + Parameter catchParameter = new Parameter().setType("QueueStorageExceptionInternal") + .setName("internalException"); + CatchClause catchClause = new CatchClause(catchParameter, catchBlock); + TryStmt tryCatchMap = new TryStmt(tryBlock, new NodeList<>(catchClause), null); + + // Replace the last statement with the try-catch block. + method.setBody(new BlockStmt(new NodeList<>(tryCatchMap))); + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java index 57ef891385dd..138f20d0e2e1 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java @@ -10,8 +10,8 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; @@ -20,6 +20,7 @@ import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.implementation.SasImplUtils; import com.azure.storage.queue.implementation.AzureQueueStorageImpl; +import com.azure.storage.queue.implementation.models.MessageIdsUpdateHeaders; import com.azure.storage.queue.implementation.models.MessagesDequeueHeaders; import com.azure.storage.queue.implementation.models.MessagesPeekHeaders; import com.azure.storage.queue.implementation.models.PeekedMessageItemInternal; @@ -27,6 +28,10 @@ import com.azure.storage.queue.implementation.models.QueueMessage; import com.azure.storage.queue.implementation.models.QueueMessageItemInternal; import com.azure.storage.queue.implementation.models.QueueMessageItemInternalWrapper; +import com.azure.storage.queue.implementation.models.QueueSignedIdentifierWrapper; +import com.azure.storage.queue.implementation.models.QueuesGetAccessPolicyHeaders; +import com.azure.storage.queue.implementation.models.QueuesGetPropertiesHeaders; +import com.azure.storage.queue.implementation.models.SendMessageResultWrapper; import com.azure.storage.queue.implementation.util.ModelHelper; import com.azure.storage.queue.implementation.util.QueueSasImplUtil; import com.azure.storage.queue.models.PeekedMessageItem; @@ -130,7 +135,8 @@ public final class QueueAsyncClient { * @return the URL of the storage queue */ public String getQueueUrl() { - return client.getUrl() + "/" + queueName; + // The implementation's base URL is already queue-qualified (endpoint + "/" + queueName), so it is the queue URL. + return client.getUrl(); } /** @@ -224,8 +230,9 @@ public Mono> createWithResponse(Map metadata) { } Mono> createWithResponse(Map metadata, Context context) { - context = context == null ? Context.NONE : context; - return client.getQueues().createNoCustomHeadersWithResponseAsync(queueName, null, metadata, null, context); + RequestOptions requestOptions = ModelHelper.requestOptions(context); + ModelHelper.addMetadataHeaders(requestOptions, metadata); + return client.getQueues().createWithResponseAsync(requestOptions); } /** @@ -360,8 +367,7 @@ public Mono> deleteWithResponse() { } Mono> deleteWithResponse(Context context) { - context = context == null ? Context.NONE : context; - return client.getQueues().deleteNoCustomHeadersWithResponseAsync(queueName, null, null, context); + return client.getQueues().deleteWithResponseAsync(ModelHelper.requestOptions(context)); } /** @@ -494,9 +500,9 @@ public Mono getProperties() { public Mono> getPropertiesWithResponse() { try { return withContext(context -> client.getQueues() - .getPropertiesWithResponseAsync(queueName, null, null, context) + .getPropertiesWithResponseAsync(ModelHelper.requestOptions(context)) .map(response -> new SimpleResponse<>(response, - ModelHelper.transformQueueProperties(response.getDeserializedHeaders())))); + ModelHelper.transformQueueProperties(new QueuesGetPropertiesHeaders(response.getHeaders()))))); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -576,8 +582,11 @@ public Mono setMetadata(Map metadata) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setMetadataWithResponse(Map metadata) { try { - return withContext(context -> client.getQueues() - .setMetadataNoCustomHeadersWithResponseAsync(queueName, null, metadata, null, context)); + return withContext(context -> { + RequestOptions requestOptions = ModelHelper.requestOptions(context); + ModelHelper.addMetadataHeaders(requestOptions, metadata); + return client.getQueues().setMetadataWithResponseAsync(requestOptions); + }); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -608,9 +617,11 @@ public Mono> setMetadataWithResponse(Map metadata public PagedFlux getAccessPolicy() { try { Function>> retriever = marker -> this.client.getQueues() - .getAccessPolicyWithResponseAsync(queueName, null, null, Context.NONE) + .getAccessPolicyWithResponseAsync(ModelHelper.requestOptions(Context.NONE)) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), response.getValue().items(), null, response.getDeserializedHeaders())); + response.getHeaders(), + ModelHelper.deserializeXmlBody(response.getValue(), QueueSignedIdentifierWrapper::fromXml).items(), + null, new QueuesGetAccessPolicyHeaders(response.getHeaders()))); return new PagedFlux<>(() -> retriever.apply(null), retriever); } catch (RuntimeException ex) { @@ -710,8 +721,9 @@ Mono> setAccessPolicyWithResponse(Iterable .stream(permissions != null ? permissions.spliterator() : Spliterators.emptySpliterator(), false) .collect(Collectors.toList()); - return client.getQueues() - .setAccessPolicyNoCustomHeadersWithResponseAsync(queueName, null, null, permissionsList, context); + RequestOptions requestOptions = ModelHelper.requestOptions(context); + requestOptions.setBody(ModelHelper.serializeXmlBody(new QueueSignedIdentifierWrapper(permissionsList))); + return client.getQueues().setAccessPolicyWithResponseAsync(requestOptions); } /** @@ -764,7 +776,7 @@ public Mono clearMessages() { public Mono> clearMessagesWithResponse() { try { return withContext( - context -> client.getMessages().clearNoCustomHeadersWithResponseAsync(queueName, null, null, context)); + context -> client.getMessages().clearWithResponseAsync(ModelHelper.requestOptions(context))); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -946,11 +958,19 @@ public Mono> sendMessageWithResponse(BinaryData mess try { return withContext(context -> Mono.fromCallable(() -> ModelHelper.encodeMessage(message, messageEncoding)) .flatMap(messageText -> { - QueueMessage queueMessage = new QueueMessage().setMessageText(messageText); + QueueMessage queueMessage = new QueueMessage(messageText); + // Protocol mapping (see MessagesImpl.enqueueWithResponseAsync Javadoc): the message body is the + // XML-serialized QueueMessage; visibility timeout and time-to-live are the "visibilitytimeout" and + // "messagettl" query parameters; the response body is a QueueMessagesList of SendMessageResult. + RequestOptions requestOptions = ModelHelper.requestOptions(context); + ModelHelper.addOptionalQueryParam(requestOptions, "visibilitytimeout", visibilityTimeoutInSeconds); + ModelHelper.addOptionalQueryParam(requestOptions, "messagettl", timeToLiveInSeconds); return client.getMessages() - .enqueueWithResponseAsync(queueName, queueMessage, visibilityTimeoutInSeconds, - timeToLiveInSeconds, null, null, context) - .map(response -> new SimpleResponse<>(response, response.getValue().items().get(0))); + .enqueueWithResponseAsync(ModelHelper.serializeXmlBody(queueMessage), requestOptions) + .map(response -> new SimpleResponse<>(response, + ModelHelper.deserializeXmlBody(response.getValue(), SendMessageResultWrapper::fromXml) + .items() + .get(0))); })); } catch (RuntimeException ex) { return monoError(LOGGER, ex); @@ -1063,10 +1083,12 @@ public PagedFlux receiveMessages(Integer maxMessages) { public PagedFlux receiveMessages(Integer maxMessages, Duration visibilityTimeout) { Integer visibilityTimeoutInSeconds = (visibilityTimeout == null) ? null : (int) visibilityTimeout.getSeconds(); try { - Function>> retriever - = marker -> withContext(context -> this.client.getMessages() - .dequeueWithResponseAsync(queueName, maxMessages, visibilityTimeoutInSeconds, null, null, context)) - .flatMap(this::transformMessagesDequeueResponse); + Function>> retriever = marker -> withContext(context -> { + RequestOptions requestOptions = ModelHelper.requestOptions(context); + ModelHelper.addOptionalQueryParam(requestOptions, "numofmessages", maxMessages); + ModelHelper.addOptionalQueryParam(requestOptions, "visibilitytimeout", visibilityTimeoutInSeconds); + return this.client.getMessages().dequeueWithResponseAsync(requestOptions); + }).flatMap(this::transformMessagesDequeueResponse); return new PagedFlux<>(() -> retriever.apply(null), retriever); } catch (RuntimeException ex) { @@ -1074,12 +1096,12 @@ public PagedFlux receiveMessages(Integer maxMessages, Duration } } - private Mono> transformMessagesDequeueResponse( - ResponseBase response) { - List queueMessageInternalItems = response.getValue().items(); - if (queueMessageInternalItems == null) { - queueMessageInternalItems = Collections.emptyList(); - } + private Mono> + transformMessagesDequeueResponse(Response response) { + QueueMessageItemInternalWrapper wrapper + = ModelHelper.deserializeXmlBody(response.getValue(), QueueMessageItemInternalWrapper::fromXml); + List queueMessageInternalItems + = (wrapper == null || wrapper.items() == null) ? Collections.emptyList() : wrapper.items(); return Flux.fromIterable(queueMessageInternalItems) .flatMapSequential(queueMessageItemInternal -> Mono @@ -1109,7 +1131,7 @@ private Mono> transf })) .collectList() .map(queueMessageItems -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), queueMessageItems, null, response.getDeserializedHeaders())); + response.getHeaders(), queueMessageItems, null, new MessagesDequeueHeaders(response.getHeaders()))); } /** @@ -1177,10 +1199,13 @@ public Mono peekMessage() { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux peekMessages(Integer maxMessages) { try { - Function>> retriever - = marker -> withContext(context -> this.client.getMessages() - .peekWithResponseAsync(queueName, maxMessages, null, null, context) - .flatMap(this::transformMessagesPeekResponse)); + Function>> retriever = marker -> withContext(context -> { + RequestOptions requestOptions = ModelHelper.requestOptions(context); + ModelHelper.addOptionalQueryParam(requestOptions, "numofmessages", maxMessages); + return this.client.getMessages() + .peekWithResponseAsync(requestOptions) + .flatMap(this::transformMessagesPeekResponse); + }); return new PagedFlux<>(() -> retriever.apply(null), retriever); } catch (RuntimeException ex) { @@ -1189,11 +1214,11 @@ public PagedFlux peekMessages(Integer maxMessages) { } private Mono> - transformMessagesPeekResponse(ResponseBase response) { - List peekedMessageInternalItems = response.getValue().items(); - if (peekedMessageInternalItems == null) { - peekedMessageInternalItems = Collections.emptyList(); - } + transformMessagesPeekResponse(Response response) { + PeekedMessageItemInternalWrapper wrapper + = ModelHelper.deserializeXmlBody(response.getValue(), PeekedMessageItemInternalWrapper::fromXml); + List peekedMessageInternalItems + = (wrapper == null || wrapper.items() == null) ? Collections.emptyList() : wrapper.items(); return Flux.fromIterable(peekedMessageInternalItems) .flatMapSequential(peekedMessageItemInternal -> Mono @@ -1223,7 +1248,7 @@ public PagedFlux peekMessages(Integer maxMessages) { })) .collectList() .map(peekedMessageItems -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), peekedMessageItems, null, response.getDeserializedHeaders())); + response.getHeaders(), peekedMessageItems, null, new MessagesPeekHeaders(response.getHeaders()))); } /** @@ -1318,18 +1343,25 @@ public Mono> updateMessageWithResponse(String mess QueueMessage message; if (messageText != null) { String finalMessage = ModelHelper.encodeMessage(BinaryData.fromString(messageText), messageEncoding); - message = new QueueMessage().setMessageText(finalMessage); + message = new QueueMessage(finalMessage); } else { message = null; } Duration visTimeout = visibilityTimeout == null ? Duration.ZERO : visibilityTimeout; try { - return withContext(context -> client.getMessageIds() - .updateWithResponseAsync(queueName, messageId, popReceipt, (int) visTimeout.getSeconds(), null, null, - message, context) - .map(response -> new SimpleResponse<>(response, - new UpdateMessageResult(response.getDeserializedHeaders().getXMsPopreceipt(), - response.getDeserializedHeaders().getXMsTimeNextVisible())))); + return withContext(context -> { + RequestOptions requestOptions = ModelHelper.requestOptions(context); + if (message != null) { + requestOptions.setBody(ModelHelper.serializeXmlBody(message)); + } + return client.getMessageIds() + .updateWithResponseAsync(messageId, popReceipt, (int) visTimeout.getSeconds(), requestOptions) + .map(response -> { + MessageIdsUpdateHeaders headers = new MessageIdsUpdateHeaders(response.getHeaders()); + return new SimpleResponse<>(response, + new UpdateMessageResult(headers.getXMsPopreceipt(), headers.getXMsTimeNextVisible())); + }); + }); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -1411,7 +1443,7 @@ public Mono deleteMessage(String messageId, String popReceipt) { public Mono> deleteMessageWithResponse(String messageId, String popReceipt) { try { return withContext(context -> client.getMessageIds() - .deleteNoCustomHeadersWithResponseAsync(queueName, messageId, popReceipt, null, null, context)); + .deleteWithResponseAsync(messageId, popReceipt, ModelHelper.requestOptions(context))); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java index 6bd3751a4328..dc26f75cd6a2 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java @@ -10,8 +10,8 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; @@ -21,7 +21,6 @@ import com.azure.storage.queue.implementation.AzureQueueStorageImpl; import com.azure.storage.queue.implementation.models.MessageIdsUpdateHeaders; import com.azure.storage.queue.implementation.models.MessagesDequeueHeaders; -import com.azure.storage.queue.implementation.models.MessagesEnqueueHeaders; import com.azure.storage.queue.implementation.models.MessagesPeekHeaders; import com.azure.storage.queue.implementation.models.PeekedMessageItemInternal; import com.azure.storage.queue.implementation.models.PeekedMessageItemInternalWrapper; @@ -128,7 +127,8 @@ public final class QueueClient { * @return the URL of the storage queue. */ public String getQueueUrl() { - return azureQueueStorage.getUrl() + "/" + queueName; + // The implementation's base URL is already queue-qualified (endpoint + "/" + queueName), so it is the queue URL. + return azureQueueStorage.getUrl(); } /** @@ -214,8 +214,11 @@ public void create() { public Response createWithResponse(Map metadata, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; try { - Supplier> operation = () -> this.azureQueueStorage.getQueues() - .createNoCustomHeadersWithResponse(queueName, null, metadata, null, finalContext); + Supplier> operation = () -> { + RequestOptions requestOptions = ModelHelper.requestOptions(finalContext); + ModelHelper.addMetadataHeaders(requestOptions, metadata); + return this.azureQueueStorage.getQueues().createWithResponse(requestOptions); + }; return submitThreadPool(operation, LOGGER, timeout); } catch (RuntimeException e) { @@ -282,8 +285,11 @@ public Response createIfNotExistsWithResponse(Map metad Context context) { Context finalContext = context == null ? Context.NONE : context; try { - Supplier> operation = () -> this.azureQueueStorage.getQueues() - .createNoCustomHeadersWithResponse(queueName, null, metadata, null, finalContext); + Supplier> operation = () -> { + RequestOptions requestOptions = ModelHelper.requestOptions(finalContext); + ModelHelper.addMetadataHeaders(requestOptions, metadata); + return this.azureQueueStorage.getQueues().createWithResponse(requestOptions); + }; Response response = submitThreadPool(operation, LOGGER, timeout); return new SimpleResponse<>(response, true); } catch (QueueStorageException e) { @@ -347,8 +353,8 @@ public void delete() { @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = () -> this.azureQueueStorage.getQueues() - .deleteNoCustomHeadersWithResponse(queueName, null, null, finalContext); + Supplier> operation + = () -> this.azureQueueStorage.getQueues().deleteWithResponse(ModelHelper.requestOptions(finalContext)); return submitThreadPool(operation, LOGGER, timeout); } @@ -407,8 +413,8 @@ public boolean deleteIfExists() { public Response deleteIfExistsWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; try { - Supplier> operation = () -> this.azureQueueStorage.getQueues() - .deleteNoCustomHeadersWithResponse(queueName, null, null, finalContext); + Supplier> operation + = () -> this.azureQueueStorage.getQueues().deleteWithResponse(ModelHelper.requestOptions(finalContext)); Response response = submitThreadPool(operation, LOGGER, timeout); return new SimpleResponse<>(response, true); @@ -479,11 +485,12 @@ public QueueProperties getProperties() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation - = () -> this.azureQueueStorage.getQueues().getPropertiesWithResponse(queueName, null, null, finalContext); + Supplier> operation = () -> this.azureQueueStorage.getQueues() + .getPropertiesWithResponse(ModelHelper.requestOptions(finalContext)); - ResponseBase response = submitThreadPool(operation, LOGGER, timeout); - return new SimpleResponse<>(response, ModelHelper.transformQueueProperties(response.getDeserializedHeaders())); + Response response = submitThreadPool(operation, LOGGER, timeout); + return new SimpleResponse<>(response, + ModelHelper.transformQueueProperties(new QueuesGetPropertiesHeaders(response.getHeaders()))); } /** @@ -563,8 +570,11 @@ public void setMetadata(Map metadata) { @ServiceMethod(returns = ReturnType.SINGLE) public Response setMetadataWithResponse(Map metadata, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = () -> this.azureQueueStorage.getQueues() - .setMetadataNoCustomHeadersWithResponse(queueName, null, metadata, null, finalContext); + Supplier> operation = () -> { + RequestOptions requestOptions = ModelHelper.requestOptions(finalContext); + ModelHelper.addMetadataHeaders(requestOptions, metadata); + return this.azureQueueStorage.getQueues().setMetadataWithResponse(requestOptions); + }; return submitThreadPool(operation, LOGGER, timeout); } @@ -593,13 +603,14 @@ public Response setMetadataWithResponse(Map metadata, Dura */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getAccessPolicy() { - ResponseBase responseBase - = azureQueueStorage.getQueues().getAccessPolicyWithResponse(queueName, null, null, Context.NONE); + Response responseBase + = azureQueueStorage.getQueues().getAccessPolicyWithResponse(ModelHelper.requestOptions(Context.NONE)); Supplier> response = () -> new PagedResponseBase<>(responseBase.getRequest(), responseBase.getStatusCode(), - responseBase.getHeaders(), responseBase.getValue().items(), null, - responseBase.getDeserializedHeaders()); + responseBase.getHeaders(), + ModelHelper.deserializeXmlBody(responseBase.getValue(), QueueSignedIdentifierWrapper::fromXml).items(), + null, new QueuesGetAccessPolicyHeaders(responseBase.getHeaders())); return new PagedIterable<>(response); } @@ -669,8 +680,11 @@ public void setAccessPolicy(List permissions) { public Response setAccessPolicyWithResponse(List permissions, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = () -> this.azureQueueStorage.getQueues() - .setAccessPolicyNoCustomHeadersWithResponse(queueName, null, null, permissions, finalContext); + Supplier> operation = () -> { + RequestOptions requestOptions = ModelHelper.requestOptions(finalContext); + requestOptions.setBody(ModelHelper.serializeXmlBody(new QueueSignedIdentifierWrapper(permissions))); + return this.azureQueueStorage.getQueues().setAccessPolicyWithResponse(requestOptions); + }; return submitThreadPool(operation, LOGGER, timeout); } @@ -726,8 +740,8 @@ public void clearMessages() { @ServiceMethod(returns = ReturnType.SINGLE) public Response clearMessagesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = () -> this.azureQueueStorage.getMessages() - .clearNoCustomHeadersWithResponse(queueName, null, null, finalContext); + Supplier> operation + = () -> this.azureQueueStorage.getMessages().clearWithResponse(ModelHelper.requestOptions(finalContext)); return submitThreadPool(operation, LOGGER, timeout); } @@ -898,17 +912,20 @@ public Response sendMessageWithResponse(BinaryData message, D Integer timeToLiveInSeconds = (timeToLive == null) ? null : (int) timeToLive.getSeconds(); Context finalContext = context == null ? Context.NONE : context; String finalMessage = ModelHelper.encodeMessage(message, messageEncoding); - QueueMessage queueMessage = new QueueMessage().setMessageText(finalMessage); + QueueMessage queueMessage = new QueueMessage(finalMessage); - Supplier> operation - = () -> this.azureQueueStorage.getMessages() - .enqueueWithResponse(queueName, queueMessage, visibilityTimeoutInSeconds, timeToLiveInSeconds, null, - null, finalContext); + Supplier> operation = () -> { + RequestOptions requestOptions = ModelHelper.requestOptions(finalContext); + ModelHelper.addOptionalQueryParam(requestOptions, "visibilitytimeout", visibilityTimeoutInSeconds); + ModelHelper.addOptionalQueryParam(requestOptions, "messagettl", timeToLiveInSeconds); + return this.azureQueueStorage.getMessages() + .enqueueWithResponse(ModelHelper.serializeXmlBody(queueMessage), requestOptions); + }; - ResponseBase response - = submitThreadPool(operation, LOGGER, timeout); + Response response = submitThreadPool(operation, LOGGER, timeout); - return new SimpleResponse<>(response, response.getValue().items().get(0)); + return new SimpleResponse<>(response, + ModelHelper.deserializeXmlBody(response.getValue(), SendMessageResultWrapper::fromXml).items().get(0)); } /** @@ -1022,28 +1039,31 @@ PagedIterable receiveMessagesWithOptionalTimeout(Integer maxMe Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; Integer visibilityTimeoutInSeconds = (visibilityTimeout == null) ? null : (int) visibilityTimeout.getSeconds(); - Supplier> operation - = () -> this.azureQueueStorage.getMessages() - .dequeueWithResponse(queueName, maxMessages, visibilityTimeoutInSeconds, null, null, finalContext); + Supplier> operation = () -> { + RequestOptions requestOptions = ModelHelper.requestOptions(finalContext); + ModelHelper.addOptionalQueryParam(requestOptions, "numofmessages", maxMessages); + ModelHelper.addOptionalQueryParam(requestOptions, "visibilitytimeout", visibilityTimeoutInSeconds); + return this.azureQueueStorage.getMessages().dequeueWithResponse(requestOptions); + }; - ResponseBase response - = submitThreadPool(operation, LOGGER, timeout); + Response response = submitThreadPool(operation, LOGGER, timeout); PagedResponseBase transformedMessages = transformMessagesDequeueResponse(response); - Supplier> res = () -> new PagedResponseBase<>(response.getRequest(), - response.getStatusCode(), response.getHeaders(), transformedMessages, response.getDeserializedHeaders()); + Supplier> res + = () -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + transformedMessages, new MessagesDequeueHeaders(response.getHeaders())); return new PagedIterable<>(res); } - private PagedResponseBase transformMessagesDequeueResponse( - ResponseBase response) { - List queueMessageInternalItems = response.getValue().items(); - if (queueMessageInternalItems == null) { - queueMessageInternalItems = Collections.emptyList(); - } + private PagedResponseBase + transformMessagesDequeueResponse(Response response) { + QueueMessageItemInternalWrapper wrapper + = ModelHelper.deserializeXmlBody(response.getValue(), QueueMessageItemInternalWrapper::fromXml); + List queueMessageInternalItems + = (wrapper == null || wrapper.items() == null) ? Collections.emptyList() : wrapper.items(); List messageItems = new ArrayList<>(); for (QueueMessageItemInternal queueMessageInternalItem : queueMessageInternalItems) { @@ -1073,7 +1093,7 @@ private PagedResponseBase transformMes } } return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - messageItems, null, response.getDeserializedHeaders()); + messageItems, null, new MessagesDequeueHeaders(response.getHeaders())); } /** @@ -1146,26 +1166,28 @@ public PagedIterable peekMessages(Integer maxMessages, Durati PagedIterable peekMessagesWithOptionalTimeout(Integer maxMessages, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation - = () -> this.azureQueueStorage.getMessages() - .peekWithResponse(queueName, maxMessages, null, null, finalContext); + Supplier> operation = () -> { + RequestOptions requestOptions = ModelHelper.requestOptions(finalContext); + ModelHelper.addOptionalQueryParam(requestOptions, "numofmessages", maxMessages); + return this.azureQueueStorage.getMessages().peekWithResponse(requestOptions); + }; - ResponseBase response - = submitThreadPool(operation, LOGGER, timeout); + Response response = submitThreadPool(operation, LOGGER, timeout); PagedResponseBase transformedMessages = transformMessagesPeekResponse(response); - Supplier> res = () -> new PagedResponseBase<>(response.getRequest(), - response.getStatusCode(), response.getHeaders(), transformedMessages, response.getDeserializedHeaders()); + Supplier> res + = () -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + transformedMessages, new MessagesPeekHeaders(response.getHeaders())); return new PagedIterable<>(res); } private PagedResponseBase - transformMessagesPeekResponse(ResponseBase response) { - List peekedMessageInternalItems = response.getValue().items(); - if (peekedMessageInternalItems == null) { - peekedMessageInternalItems = Collections.emptyList(); - } + transformMessagesPeekResponse(Response response) { + PeekedMessageItemInternalWrapper wrapper + = ModelHelper.deserializeXmlBody(response.getValue(), PeekedMessageItemInternalWrapper::fromXml); + List peekedMessageInternalItems + = (wrapper == null || wrapper.items() == null) ? Collections.emptyList() : wrapper.items(); List messageItems = new ArrayList<>(); for (PeekedMessageItemInternal peekedMessageInternalItem : peekedMessageInternalItems) { @@ -1195,7 +1217,7 @@ PagedIterable peekMessagesWithOptionalTimeout(Integer maxMess } } return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - messageItems, null, response.getDeserializedHeaders()); + messageItems, null, new MessagesPeekHeaders(response.getHeaders())); } /** @@ -1276,20 +1298,26 @@ public Response updateMessageWithResponse(String messageId, QueueMessage message; if (messageText != null) { String finalMessage = ModelHelper.encodeMessage(BinaryData.fromString(messageText), messageEncoding); - message = new QueueMessage().setMessageText(finalMessage); + message = new QueueMessage(finalMessage); } else { message = null; } Context finalContext = context == null ? Context.NONE : context; Duration finalVisibilityTimeout = visibilityTimeout == null ? Duration.ZERO : visibilityTimeout; - Supplier> operation = () -> this.azureQueueStorage.getMessageIds() - .updateWithResponse(queueName, messageId, popReceipt, (int) finalVisibilityTimeout.getSeconds(), null, null, - message, finalContext); + Supplier> operation = () -> { + RequestOptions requestOptions = ModelHelper.requestOptions(finalContext); + if (message != null) { + requestOptions.setBody(ModelHelper.serializeXmlBody(message)); + } + return this.azureQueueStorage.getMessageIds() + .updateWithResponse(messageId, popReceipt, (int) finalVisibilityTimeout.getSeconds(), requestOptions); + }; - ResponseBase response = submitThreadPool(operation, LOGGER, timeout); + Response response = submitThreadPool(operation, LOGGER, timeout); - UpdateMessageResult result = new UpdateMessageResult(response.getDeserializedHeaders().getXMsPopreceipt(), - response.getDeserializedHeaders().getXMsTimeNextVisible()); + MessageIdsUpdateHeaders headers = new MessageIdsUpdateHeaders(response.getHeaders()); + UpdateMessageResult result + = new UpdateMessageResult(headers.getXMsPopreceipt(), headers.getXMsTimeNextVisible()); return new SimpleResponse<>(response, result); } @@ -1355,7 +1383,7 @@ public Response deleteMessageWithResponse(String messageId, String popRece Context context) { Context finalContext = context == null ? Context.NONE : context; Supplier> operation = () -> this.azureQueueStorage.getMessageIds() - .deleteNoCustomHeadersWithResponse(queueName, messageId, popReceipt, null, null, finalContext); + .deleteWithResponse(messageId, popReceipt, ModelHelper.requestOptions(finalContext)); return submitThreadPool(operation, LOGGER, timeout); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java index f7e6d6f724ed..26d539bcca30 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java @@ -721,7 +721,11 @@ private AzureQueueStorageImpl createAzureQueueStorageImpl(QueueServiceVersion ve endpoint, retryOptions, coreRetryOptions, logOptions, clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); - return new AzureQueueStorageImpl(pipeline, endpoint, version.getVersion()); + // The generated protocol implementation addresses every queue-scoped operation relative to the base URL + // (for example @Put("/"), @Get("?comp=metadata"), @Get("/messages")) with no queueName parameter. The queue + // name is therefore carried in the implementation's base URL rather than passed per call, matching the + // per-queue endpoint semantics of the TypeSpec-generated client. + return new AzureQueueStorageImpl(pipeline, endpoint + "/" + queueName, version); } /** diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java index d7abba61026f..b6f035421ee5 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java @@ -9,6 +9,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; @@ -22,6 +23,7 @@ import com.azure.storage.common.sas.AccountSasSignatureValues; import com.azure.storage.queue.implementation.AzureQueueStorageImpl; import com.azure.storage.queue.implementation.models.KeyInfo; +import com.azure.storage.queue.implementation.util.ModelHelper; import com.azure.storage.queue.models.QueueCorsRule; import com.azure.storage.queue.models.QueueGetUserDelegationKeyOptions; import com.azure.storage.queue.models.QueueItem; @@ -132,9 +134,14 @@ public QueueMessageEncoding getMessageEncoding() { * @return QueueAsyncClient that interacts with the specified queue */ public QueueAsyncClient getQueueAsyncClient(String queueName) { - QueueClient queueClient = new QueueClient(client, queueName, accountName, serviceVersion, messageEncoding, + // The service-level implementation's base URL is the account endpoint. A queue client addresses a specific + // queue, so build a new implementation whose base URL is queue-qualified (endpoint + "/" + queueName), + // matching the per-queue endpoint semantics of the generated protocol layer. + AzureQueueStorageImpl queueStorage = new AzureQueueStorageImpl(client.getHttpPipeline(), + client.getSerializerAdapter(), client.getUrl() + "/" + queueName, client.getServiceVersion()); + QueueClient queueClient = new QueueClient(queueStorage, queueName, accountName, serviceVersion, messageEncoding, processMessageDecodingErrorAsyncHandler, processMessageDecodingErrorHandler, null); - return new QueueAsyncClient(client, queueName, accountName, serviceVersion, messageEncoding, + return new QueueAsyncClient(queueStorage, queueName, accountName, serviceVersion, messageEncoding, processMessageDecodingErrorAsyncHandler, processMessageDecodingErrorHandler, queueClient); } @@ -349,9 +356,9 @@ PagedFlux listQueuesWithOptionalTimeout(String marker, QueuesSegmentO BiFunction>> retriever = (nextMarker, pageSize) -> StorageImplUtils.applyOptionalTimeout(this.client.getServices() - .listQueuesSegmentSinglePageAsync(prefix, nextMarker, pageSize == null ? maxResultsPerPage : pageSize, - include, null, null, context), - timeout); + .getQueuesWithResponseAsync(ModelHelper.listQueuesRequestOptions(context, prefix, nextMarker, + pageSize == null ? maxResultsPerPage : pageSize, include)) + .map(ModelHelper::toQueueItemPage), timeout); return new PagedFlux<>(pageSize -> retriever.apply(marker, pageSize), retriever); } @@ -420,10 +427,10 @@ public Mono> getPropertiesWithResponse() { } Mono> getPropertiesWithResponse(Context context) { - context = context == null ? Context.NONE : context; return client.getServices() - .getPropertiesWithResponseAsync(null, null, context) - .map(response -> new SimpleResponse<>(response, response.getValue())); + .getPropertiesWithResponseAsync(ModelHelper.requestOptions(context)) + .map(response -> new SimpleResponse<>(response, + ModelHelper.deserializeXmlBody(response.getValue(), QueueServiceProperties::fromXml))); } /** @@ -545,8 +552,9 @@ public Mono> setPropertiesWithResponse(QueueServiceProperties pro } Mono> setPropertiesWithResponse(QueueServiceProperties properties, Context context) { - context = context == null ? Context.NONE : context; - return client.getServices().setPropertiesNoCustomHeadersWithResponseAsync(properties, null, null, context); + return client.getServices() + .setPropertiesWithResponseAsync(ModelHelper.serializeXmlBody(properties), + ModelHelper.requestOptions(context)); } /** @@ -609,10 +617,10 @@ public Mono> getStatisticsWithResponse() { } Mono> getStatisticsWithResponse(Context context) { - context = context == null ? Context.NONE : context; return client.getServices() - .getStatisticsWithResponseAsync(null, null, context) - .map(response -> new SimpleResponse<>(response, response.getValue())); + .getStatisticsWithResponseAsync(ModelHelper.requestOptions(context)) + .map(response -> new SimpleResponse<>(response, + ModelHelper.deserializeXmlBody(response.getValue(), QueueServiceStatistics::fromXml))); } /** @@ -788,12 +796,11 @@ Mono> getUserDelegationKeyWithResponse(OffsetDateTim new IllegalArgumentException("`start` must be null or a datetime before `expiry`.")); } + KeyInfo keyInfo = new KeyInfo(expiry).setStart(start).setDelegatedUserTenantId(delegatedUserTenantId); return client.getServices() - .getUserDelegationKeyWithResponseAsync( - new KeyInfo().setStart(start == null ? "" : Constants.ISO_8601_UTC_DATE_FORMATTER.format(start)) - .setExpiry(Constants.ISO_8601_UTC_DATE_FORMATTER.format(expiry)) - .setDelegatedUserTenantId(delegatedUserTenantId), - null, null, context) - .map(rb -> new SimpleResponse<>(rb, rb.getValue())); + .getUserDelegationKeyWithResponseAsync(ModelHelper.serializeXmlBody(keyInfo), + ModelHelper.requestOptions(context)) + .map(rb -> new SimpleResponse<>(rb, + ModelHelper.deserializeXmlBody(rb.getValue(), UserDelegationKey::fromXml))); } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java index b7a630025160..7b36dda108c1 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java @@ -12,6 +12,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.StorageSharedKeyCredential; @@ -21,6 +22,7 @@ import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.sas.AccountSasSignatureValues; import com.azure.storage.queue.implementation.AzureQueueStorageImpl; +import com.azure.storage.queue.implementation.util.ModelHelper; import com.azure.storage.queue.implementation.models.KeyInfo; import com.azure.storage.queue.implementation.models.ServicesGetStatisticsHeaders; import com.azure.storage.queue.implementation.models.ServicesGetUserDelegationKeyHeaders; @@ -141,10 +143,15 @@ public QueueMessageEncoding getMessageEncoding() { * @return QueueClient that interacts with the specified queue */ public QueueClient getQueueClient(String queueName) { - QueueAsyncClient queueAsyncClient - = new QueueAsyncClient(this.azureQueueStorage, queueName, accountName, serviceVersion, messageEncoding, - processMessageDecodingErrorAsyncHandler, processMessageDecodingErrorHandler, null); - return new QueueClient(this.azureQueueStorage, queueName, accountName, serviceVersion, messageEncoding, + // The service-level implementation's base URL is the account endpoint. A queue client addresses a specific + // queue, so build a new implementation whose base URL is queue-qualified (endpoint + "/" + queueName), + // matching the per-queue endpoint semantics of the generated protocol layer. + AzureQueueStorageImpl queueStorage = new AzureQueueStorageImpl(this.azureQueueStorage.getHttpPipeline(), + this.azureQueueStorage.getSerializerAdapter(), this.azureQueueStorage.getUrl() + "/" + queueName, + this.azureQueueStorage.getServiceVersion()); + QueueAsyncClient queueAsyncClient = new QueueAsyncClient(queueStorage, queueName, accountName, serviceVersion, + messageEncoding, processMessageDecodingErrorAsyncHandler, processMessageDecodingErrorHandler, null); + return new QueueClient(queueStorage, queueName, accountName, serviceVersion, messageEncoding, processMessageDecodingErrorAsyncHandler, processMessageDecodingErrorHandler, queueAsyncClient); } @@ -335,9 +342,10 @@ public PagedIterable listQueues(QueuesSegmentOptions options, Duratio } } BiFunction> retriever = (nextMarker, pageSize) -> { - Supplier> operation = () -> this.azureQueueStorage.getServices() - .listQueuesSegmentSinglePage(prefix, nextMarker, pageSize == null ? maxResultsPerPage : pageSize, - include, null, null, finalContext); + Supplier> operation + = () -> ModelHelper.toQueueItemPage(this.azureQueueStorage.getServices() + .getQueuesWithResponse(ModelHelper.listQueuesRequestOptions(finalContext, prefix, nextMarker, + pageSize == null ? maxResultsPerPage : pageSize, include))); return submitThreadPool(operation, LOGGER, timeout); @@ -403,8 +411,12 @@ public QueueServiceProperties getProperties() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation - = () -> this.azureQueueStorage.getServices().getPropertiesWithResponse(null, null, finalContext); + Supplier> operation = () -> { + Response response = this.azureQueueStorage.getServices() + .getPropertiesWithResponse(ModelHelper.requestOptions(finalContext)); + return new SimpleResponse<>(response, + ModelHelper.deserializeXmlBody(response.getValue(), QueueServiceProperties::fromXml)); + }; return submitThreadPool(operation, LOGGER, timeout); } @@ -538,7 +550,8 @@ public Response setPropertiesWithResponse(QueueServiceProperties propertie Context context) { Context finalContext = context == null ? Context.NONE : context; Supplier> operation = () -> this.azureQueueStorage.getServices() - .setPropertiesNoCustomHeadersWithResponse(properties, null, null, finalContext); + .setPropertiesWithResponse(ModelHelper.serializeXmlBody(properties), + ModelHelper.requestOptions(finalContext)); return submitThreadPool(operation, LOGGER, timeout); } @@ -596,8 +609,12 @@ public QueueServiceStatistics getStatistics() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getStatisticsWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation - = () -> this.azureQueueStorage.getServices().getStatisticsWithResponse(null, null, finalContext); + Supplier> operation = () -> { + Response response = this.azureQueueStorage.getServices() + .getStatisticsWithResponse(ModelHelper.requestOptions(finalContext)); + return new SimpleResponse<>(response, + ModelHelper.deserializeXmlBody(response.getValue(), QueueServiceStatistics::fromXml)); + }; return submitThreadPool(operation, LOGGER, timeout); } @@ -754,17 +771,16 @@ public Response getUserDelegationKeyWithResponse(QueueGetUser new IllegalArgumentException("`start` must be null or a datetime before `expiry`.")); } - Callable> operation - = () -> this.azureQueueStorage.getServices() - .getUserDelegationKeyWithResponse(new KeyInfo() - .setStart(options.getStartsOn() == null - ? "" - : Constants.ISO_8601_UTC_DATE_FORMATTER.format(options.getStartsOn())) - .setExpiry(Constants.ISO_8601_UTC_DATE_FORMATTER.format(options.getExpiresOn())) - .setDelegatedUserTenantId(options.getDelegatedUserTenantId()), null, null, finalContext); - - ResponseBase response - = sendRequest(operation, timeout, QueueStorageException.class); + KeyInfo keyInfo = new KeyInfo(options.getExpiresOn()).setStart(options.getStartsOn()) + .setDelegatedUserTenantId(options.getDelegatedUserTenantId()); + Callable> operation = () -> { + Response rb = this.azureQueueStorage.getServices() + .getUserDelegationKeyWithResponse(ModelHelper.serializeXmlBody(keyInfo), + ModelHelper.requestOptions(finalContext)); + return new SimpleResponse<>(rb, ModelHelper.deserializeXmlBody(rb.getValue(), UserDelegationKey::fromXml)); + }; + + Response response = sendRequest(operation, timeout, QueueStorageException.class); return new SimpleResponse<>(response, response.getValue()); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClientBuilder.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClientBuilder.java index 917b4e424250..0d66350e9b39 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClientBuilder.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClientBuilder.java @@ -702,7 +702,7 @@ private AzureQueueStorageImpl createAzureQueueStorageImpl(QueueServiceVersion ve endpoint, retryOptions, coreRetryOptions, logOptions, clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); - return new AzureQueueStorageImpl(pipeline, endpoint, version.getVersion()); + return new AzureQueueStorageImpl(pipeline, endpoint, version); } /** diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java index f94306482fde..a2e7450140c3 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.implementation; @@ -10,18 +10,19 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.storage.queue.QueueServiceVersion; /** * Initializes a new instance of the AzureQueueStorage type. */ public final class AzureQueueStorageImpl { /** - * The URL of the service account, queue or message that is the target of the desired operation. + * The host name of the queue storage account, e.g. accountName.queue.core.windows.net. */ private final String url; /** - * Gets The URL of the service account, queue or message that is the target of the desired operation. + * Gets The host name of the queue storage account, e.g. accountName.queue.core.windows.net. * * @return the url value. */ @@ -30,17 +31,17 @@ public String getUrl() { } /** - * Specifies the version of the operation to use for this request. + * Service version. */ - private final String version; + private final QueueServiceVersion serviceVersion; /** - * Gets Specifies the version of the operation to use for this request. + * Gets Service version. * - * @return the version value. + * @return the serviceVersion value. */ - public String getVersion() { - return this.version; + public QueueServiceVersion getServiceVersion() { + return this.serviceVersion; } /** @@ -130,23 +131,23 @@ public MessageIdsImpl getMessageIds() { /** * Initializes an instance of AzureQueueStorage client. * - * @param url The URL of the service account, queue or message that is the target of the desired operation. - * @param version Specifies the version of the operation to use for this request. + * @param url The host name of the queue storage account, e.g. accountName.queue.core.windows.net. + * @param serviceVersion Service version. */ - public AzureQueueStorageImpl(String url, String version) { + public AzureQueueStorageImpl(String url, QueueServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), url, version); + JacksonAdapter.createDefaultSerializerAdapter(), url, serviceVersion); } /** * Initializes an instance of AzureQueueStorage client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param url The URL of the service account, queue or message that is the target of the desired operation. - * @param version Specifies the version of the operation to use for this request. + * @param url The host name of the queue storage account, e.g. accountName.queue.core.windows.net. + * @param serviceVersion Service version. */ - public AzureQueueStorageImpl(HttpPipeline httpPipeline, String url, String version) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), url, version); + public AzureQueueStorageImpl(HttpPipeline httpPipeline, String url, QueueServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), url, serviceVersion); } /** @@ -154,15 +155,15 @@ public AzureQueueStorageImpl(HttpPipeline httpPipeline, String url, String versi * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param url The URL of the service account, queue or message that is the target of the desired operation. - * @param version Specifies the version of the operation to use for this request. + * @param url The host name of the queue storage account, e.g. accountName.queue.core.windows.net. + * @param serviceVersion Service version. */ public AzureQueueStorageImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String url, - String version) { + QueueServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.url = url; - this.version = version; + this.serviceVersion = serviceVersion; this.services = new ServicesImpl(this); this.queues = new QueuesImpl(this); this.messages = new MessagesImpl(this); diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java index a5d084edbf61..941ec9dc29d2 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.implementation; -import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; @@ -16,14 +15,17 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.storage.queue.implementation.models.MessageIdsDeleteHeaders; -import com.azure.storage.queue.implementation.models.MessageIdsUpdateHeaders; -import com.azure.storage.queue.implementation.models.QueueMessage; +import com.azure.storage.queue.QueueServiceVersion; import com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal; import com.azure.storage.queue.implementation.util.ModelHelper; import reactor.core.publisher.Mono; @@ -54,6 +56,19 @@ public final class MessageIdsImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public QueueServiceVersion getServiceVersion() { + try { + return client.getServiceVersion(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } + } + /** * The interface defining all the services for AzureQueueStorageMessageIds to be used by the proxy service to * perform REST calls. @@ -62,639 +77,220 @@ public final class MessageIdsImpl { @ServiceInterface(name = "AzureQueueStorageMessageIds") public interface MessageIdsService { - @Put("/{queueName}/messages/{messageid}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> update(@HostParam("url") String url, - @PathParam("queueName") String queueName, @PathParam("messageid") String messageid, - @QueryParam("popreceipt") String popReceipt, @QueryParam("visibilitytimeout") int visibilitytimeout, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueMessage queueMessage, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{queueName}/messages/{messageid}") + @Put("/messages/{messageId}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> updateNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @PathParam("messageid") String messageid, - @QueryParam("popreceipt") String popReceipt, @QueryParam("visibilitytimeout") int visibilitytimeout, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueMessage queueMessage, @HeaderParam("Accept") String accept, - Context context); + Mono> update(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @PathParam("messageId") String messageId, @QueryParam("popreceipt") String popReceipt, + @QueryParam("visibilitytimeout") int visibilityTimeout, RequestOptions requestOptions, Context context); - @Put("/{queueName}/messages/{messageid}") + @Put("/messages/{messageId}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase updateSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @PathParam("messageid") String messageid, - @QueryParam("popreceipt") String popReceipt, @QueryParam("visibilitytimeout") int visibilitytimeout, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueMessage queueMessage, @HeaderParam("Accept") String accept, - Context context); + Response updateSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @PathParam("messageId") String messageId, @QueryParam("popreceipt") String popReceipt, + @QueryParam("visibilitytimeout") int visibilityTimeout, RequestOptions requestOptions, Context context); - @Put("/{queueName}/messages/{messageid}") + @Delete("/messages/{messageId}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response updateNoCustomHeadersSync(@HostParam("url") String url, @PathParam("queueName") String queueName, - @PathParam("messageid") String messageid, @QueryParam("popreceipt") String popReceipt, - @QueryParam("visibilitytimeout") int visibilitytimeout, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueMessage queueMessage, @HeaderParam("Accept") String accept, - Context context); + Mono> delete(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @PathParam("messageId") String messageId, @QueryParam("popreceipt") String popReceipt, + RequestOptions requestOptions, Context context); - @Delete("/{queueName}/messages/{messageid}") + @Delete("/messages/{messageId}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> delete(@HostParam("url") String url, - @PathParam("queueName") String queueName, @PathParam("messageid") String messageid, - @QueryParam("popreceipt") String popReceipt, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{queueName}/messages/{messageid}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> deleteNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @PathParam("messageid") String messageid, - @QueryParam("popreceipt") String popReceipt, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{queueName}/messages/{messageid}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase deleteSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @PathParam("messageid") String messageid, - @QueryParam("popreceipt") String popReceipt, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{queueName}/messages/{messageid}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response deleteNoCustomHeadersSync(@HostParam("url") String url, @PathParam("queueName") String queueName, - @PathParam("messageid") String messageid, @QueryParam("popreceipt") String popReceipt, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message - * operation updates the visibility timeout of a message. You can also use this operation to update the contents of - * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the - * encoded message can be up to 64KB in size. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueMessage A Message object which can be stored in a Queue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String queueName, String messageid, - String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage) { - return FluxUtil - .withContext(context -> updateWithResponseAsync(queueName, messageid, popReceipt, visibilitytimeout, - timeout, requestId, queueMessage, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message - * operation updates the visibility timeout of a message. You can also use this operation to update the contents of - * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the - * encoded message can be up to 64KB in size. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueMessage A Message object which can be stored in a Queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String queueName, String messageid, - String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage, - Context context) { - final String accept = "application/xml"; - return service - .update(this.client.getUrl(), queueName, messageid, popReceipt, visibilitytimeout, timeout, - this.client.getVersion(), requestId, queueMessage, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message - * operation updates the visibility timeout of a message. You can also use this operation to update the contents of - * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the - * encoded message can be up to 64KB in size. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueMessage A Message object which can be stored in a Queue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String queueName, String messageid, String popReceipt, int visibilitytimeout, - Integer timeout, String requestId, QueueMessage queueMessage) { - return updateWithResponseAsync(queueName, messageid, popReceipt, visibilitytimeout, timeout, requestId, - queueMessage).onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); + Response deleteSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @PathParam("messageId") String messageId, @QueryParam("popreceipt") String popReceipt, + RequestOptions requestOptions, Context context); } /** - * The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message - * operation updates the visibility timeout of a message. You can also use this operation to update the contents of - * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the - * encoded message can be up to 64KB in size. + * Updates the visibility timeout of a message. This operation can also be used to update the contents of a message. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/xml".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     MessageText: String (Required)
+     * }
+     * }
+     * 
* - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueMessage A Message object which can be stored in a Queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String queueName, String messageid, String popReceipt, int visibilitytimeout, - Integer timeout, String requestId, QueueMessage queueMessage, Context context) { - return updateWithResponseAsync(queueName, messageid, popReceipt, visibilitytimeout, timeout, requestId, - queueMessage, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message - * operation updates the visibility timeout of a message. You can also use this operation to update the contents of - * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the - * encoded message can be up to 64KB in size. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueMessage A Message object which can be stored in a Queue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param messageId The ID of the queue message. + * @param popReceipt An opaque value required to delete the message. If deletion fails using this + * PopReceipt then the message has been dequeued by another client. + * @param visibilityTimeout Specifies the new visibility timeout value, in seconds, relative to server time. A + * specified value must be + * larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message + * can be set to a value later than the expiry time. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateNoCustomHeadersWithResponseAsync(String queueName, String messageid, - String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage) { + public Mono> updateWithResponseAsync(String messageId, String popReceipt, int visibilityTimeout, + RequestOptions requestOptions) { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/xml"); + } + }); return FluxUtil - .withContext(context -> updateNoCustomHeadersWithResponseAsync(queueName, messageid, popReceipt, - visibilitytimeout, timeout, requestId, queueMessage, context)) + .withContext(context -> service.update(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + messageId, popReceipt, visibilityTimeout, requestOptionsLocal, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message - * operation updates the visibility timeout of a message. You can also use this operation to update the contents of - * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the - * encoded message can be up to 64KB in size. + * Updates the visibility timeout of a message. This operation can also be used to update the contents of a message. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/xml".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     MessageText: String (Required)
+     * }
+     * }
+     * 
* - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueMessage A Message object which can be stored in a Queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateNoCustomHeadersWithResponseAsync(String queueName, String messageid, - String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage, - Context context) { - final String accept = "application/xml"; - return service - .updateNoCustomHeaders(this.client.getUrl(), queueName, messageid, popReceipt, visibilitytimeout, timeout, - this.client.getVersion(), requestId, queueMessage, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message - * operation updates the visibility timeout of a message. You can also use this operation to update the contents of - * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the - * encoded message can be up to 64KB in size. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueMessage A Message object which can be stored in a Queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase updateWithResponse(String queueName, String messageid, - String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage, - Context context) { - try { - final String accept = "application/xml"; - return service.updateSync(this.client.getUrl(), queueName, messageid, popReceipt, visibilitytimeout, - timeout, this.client.getVersion(), requestId, queueMessage, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message - * operation updates the visibility timeout of a message. You can also use this operation to update the contents of - * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the - * encoded message can be up to 64KB in size. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueMessage A Message object which can be stored in a Queue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void update(String queueName, String messageid, String popReceipt, int visibilitytimeout, Integer timeout, - String requestId, QueueMessage queueMessage) { - updateWithResponse(queueName, messageid, popReceipt, visibilitytimeout, timeout, requestId, queueMessage, - Context.NONE); - } - - /** - * The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message - * operation updates the visibility timeout of a message. You can also use this operation to update the contents of - * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the - * encoded message can be up to 64KB in size. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueMessage A Message object which can be stored in a Queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param messageId The ID of the queue message. + * @param popReceipt An opaque value required to delete the message. If deletion fails using this + * PopReceipt then the message has been dequeued by another client. + * @param visibilityTimeout Specifies the new visibility timeout value, in seconds, relative to server time. A + * specified value must be + * larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message + * can be set to a value later than the expiry time. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateNoCustomHeadersWithResponse(String queueName, String messageid, String popReceipt, - int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage, Context context) { + public Response updateWithResponse(String messageId, String popReceipt, int visibilityTimeout, + RequestOptions requestOptions) { try { - final String accept = "application/xml"; - return service.updateNoCustomHeadersSync(this.client.getUrl(), queueName, messageid, popReceipt, - visibilitytimeout, timeout, this.client.getVersion(), requestId, queueMessage, accept, context); + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null + && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/xml"); + } + }); + return service.updateSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), messageId, + popReceipt, visibilityTimeout, requestOptionsLocal, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * The Delete operation deletes the specified message. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String queueName, String messageid, - String popReceipt, Integer timeout, String requestId) { - return FluxUtil - .withContext( - context -> deleteWithResponseAsync(queueName, messageid, popReceipt, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Delete operation deletes the specified message. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String queueName, String messageid, - String popReceipt, Integer timeout, String requestId, Context context) { - final String accept = "application/xml"; - return service - .delete(this.client.getUrl(), queueName, messageid, popReceipt, timeout, this.client.getVersion(), - requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Delete operation deletes the specified message. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String queueName, String messageid, String popReceipt, Integer timeout, - String requestId) { - return deleteWithResponseAsync(queueName, messageid, popReceipt, timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Delete operation deletes the specified message. + * Deletes the specified message. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String queueName, String messageid, String popReceipt, Integer timeout, - String requestId, Context context) { - return deleteWithResponseAsync(queueName, messageid, popReceipt, timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Delete operation deletes the specified message. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param messageId The ID of the queue message. + * @param popReceipt An opaque value required to delete the message. If deletion fails using this + * PopReceipt then the message has been dequeued by another client. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String queueName, String messageid, - String popReceipt, Integer timeout, String requestId) { + public Mono> deleteWithResponseAsync(String messageId, String popReceipt, + RequestOptions requestOptions) { return FluxUtil - .withContext(context -> deleteNoCustomHeadersWithResponseAsync(queueName, messageid, popReceipt, timeout, - requestId, context)) + .withContext(context -> service.delete(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + messageId, popReceipt, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * The Delete operation deletes the specified message. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String queueName, String messageid, - String popReceipt, Integer timeout, String requestId, Context context) { - final String accept = "application/xml"; - return service - .deleteNoCustomHeaders(this.client.getUrl(), queueName, messageid, popReceipt, timeout, - this.client.getVersion(), requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Delete operation deletes the specified message. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteWithResponse(String queueName, String messageid, - String popReceipt, Integer timeout, String requestId, Context context) { - try { - final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), queueName, messageid, popReceipt, timeout, - this.client.getVersion(), requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The Delete operation deletes the specified message. - * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String queueName, String messageid, String popReceipt, Integer timeout, String requestId) { - deleteWithResponse(queueName, messageid, popReceipt, timeout, requestId, Context.NONE); - } - - /** - * The Delete operation deletes the specified message. + * Deletes the specified message. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param queueName The queue name. - * @param messageid The message ID name. - * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get - * Messages or Update Message operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param messageId The ID of the queue message. + * @param popReceipt An opaque value required to delete the message. If deletion fails using this + * PopReceipt then the message has been dequeued by another client. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteNoCustomHeadersWithResponse(String queueName, String messageid, String popReceipt, - Integer timeout, String requestId, Context context) { + public Response deleteWithResponse(String messageId, String popReceipt, RequestOptions requestOptions) { try { - final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), queueName, messageid, popReceipt, timeout, - this.client.getVersion(), requestId, accept, context); + return service.deleteSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), messageId, + popReceipt, requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java index 3e17b2d41e9a..67eebe36dd91 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.implementation; import com.azure.core.annotation.BodyParam; @@ -10,27 +10,23 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.storage.queue.implementation.models.MessagesClearHeaders; -import com.azure.storage.queue.implementation.models.MessagesDequeueHeaders; -import com.azure.storage.queue.implementation.models.MessagesEnqueueHeaders; -import com.azure.storage.queue.implementation.models.MessagesPeekHeaders; -import com.azure.storage.queue.implementation.models.PeekedMessageItemInternalWrapper; -import com.azure.storage.queue.implementation.models.QueueMessage; -import com.azure.storage.queue.implementation.models.QueueMessageItemInternalWrapper; +import com.azure.storage.queue.QueueServiceVersion; import com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal; -import com.azure.storage.queue.implementation.models.SendMessageResultWrapper; import com.azure.storage.queue.implementation.util.ModelHelper; import reactor.core.publisher.Mono; @@ -59,6 +55,19 @@ public final class MessagesImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public QueueServiceVersion getServiceVersion() { + try { + return client.getServiceVersion(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } + } + /** * The interface defining all the services for AzureQueueStorageMessages to be used by the proxy service to perform * REST calls. @@ -67,1250 +76,485 @@ public final class MessagesImpl { @ServiceInterface(name = "AzureQueueStorageMessages") public interface MessagesService { - @Get("/{queueName}/messages") + @Get("/messages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> dequeue( - @HostParam("url") String url, @PathParam("queueName") String queueName, - @QueryParam("numofmessages") Integer numberOfMessages, - @QueryParam("visibilitytimeout") Integer visibilitytimeout, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Mono> dequeue(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/{queueName}/messages") + @Get("/messages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> dequeueNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("numofmessages") Integer numberOfMessages, - @QueryParam("visibilitytimeout") Integer visibilitytimeout, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{queueName}/messages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase dequeueSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("numofmessages") Integer numberOfMessages, - @QueryParam("visibilitytimeout") Integer visibilitytimeout, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{queueName}/messages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response dequeueNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("numofmessages") Integer numberOfMessages, - @QueryParam("visibilitytimeout") Integer visibilitytimeout, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{queueName}/messages") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> clear(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Response dequeueSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Delete("/{queueName}/messages") + @Delete("/messages") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> clearNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Mono> clear(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Delete("/{queueName}/messages") + @Delete("/messages") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase clearSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Response clearSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Delete("/{queueName}/messages") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response clearNoCustomHeadersSync(@HostParam("url") String url, @PathParam("queueName") String queueName, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Post("/{queueName}/messages") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> enqueue(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("visibilitytimeout") Integer visibilitytimeout, - @QueryParam("messagettl") Integer messageTimeToLive, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueMessage queueMessage, @HeaderParam("Accept") String accept, - Context context); - - @Post("/{queueName}/messages") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> enqueueNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("visibilitytimeout") Integer visibilitytimeout, - @QueryParam("messagettl") Integer messageTimeToLive, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueMessage queueMessage, @HeaderParam("Accept") String accept, - Context context); - - @Post("/{queueName}/messages") + @Post("/messages") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase enqueueSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("visibilitytimeout") Integer visibilitytimeout, - @QueryParam("messagettl") Integer messageTimeToLive, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueMessage queueMessage, @HeaderParam("Accept") String accept, - Context context); + Mono> enqueue(@HostParam("url") String url, + @HeaderParam("Content-Type") String contentType, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, @BodyParam("application/xml") BinaryData queueMessage, + RequestOptions requestOptions, Context context); - @Post("/{queueName}/messages") + @Post("/messages") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response enqueueNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("visibilitytimeout") Integer visibilitytimeout, - @QueryParam("messagettl") Integer messageTimeToLive, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueMessage queueMessage, @HeaderParam("Accept") String accept, - Context context); + Response enqueueSync(@HostParam("url") String url, @HeaderParam("Content-Type") String contentType, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Accept") String accept, + @BodyParam("application/xml") BinaryData queueMessage, RequestOptions requestOptions, Context context); - @Get("/{queueName}/messages") + @Get("/messages?peekonly=true") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> peek(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("peekonly") String peekonly, - @QueryParam("numofmessages") Integer numberOfMessages, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Mono> peek(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/{queueName}/messages") + @Get("/messages?peekonly=true") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> peekNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("peekonly") String peekonly, - @QueryParam("numofmessages") Integer numberOfMessages, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{queueName}/messages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase peekSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("peekonly") String peekonly, - @QueryParam("numofmessages") Integer numberOfMessages, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{queueName}/messages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response peekNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("peekonly") String peekonly, - @QueryParam("numofmessages") Integer numberOfMessages, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * The Dequeue operation retrieves one or more messages from the front of the queue. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Get Messages on a Queue along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> dequeueWithResponseAsync( - String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId) { - return FluxUtil - .withContext(context -> dequeueWithResponseAsync(queueName, numberOfMessages, visibilitytimeout, timeout, - requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Dequeue operation retrieves one or more messages from the front of the queue. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Get Messages on a Queue along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> dequeueWithResponseAsync( - String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId, - Context context) { + Response peekSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Retrieves one or more messages from the front of the queue. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
numofmessagesIntegerNoA nonzero integer value that specifies the number of + * messages to + * retrieve from the queue, up to a maximum of 32. If fewer are visible, the + * visible messages are returned. By default, a single message is retrieved from + * the queue with this operation.
visibilitytimeoutIntegerNoSpecifies the new visibility timeout value, in + * seconds, relative to server time. A specified value must be + * larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message + * can be set to a value later than the expiry time.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     QueueMessage (Required): [
+     *          (Required){
+     *             MessageId: String (Required)
+     *             InsertionTime: DateTimeRfc1123 (Required)
+     *             ExpirationTime: DateTimeRfc1123 (Required)
+     *             PopReceipt: String (Required)
+     *             TimeNextVisible: DateTimeRfc1123 (Required)
+     *             DequeueCount: long (Required)
+     *             MessageText: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response of receive messages along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> dequeueWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - return service - .dequeue(this.client.getUrl(), queueName, numberOfMessages, visibilitytimeout, timeout, - this.client.getVersion(), requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Dequeue operation retrieves one or more messages from the front of the queue. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Get Messages on a Queue on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono dequeueAsync(String queueName, Integer numberOfMessages, - Integer visibilitytimeout, Integer timeout, String requestId) { - return dequeueWithResponseAsync(queueName, numberOfMessages, visibilitytimeout, timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The Dequeue operation retrieves one or more messages from the front of the queue. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Get Messages on a Queue on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono dequeueAsync(String queueName, Integer numberOfMessages, - Integer visibilitytimeout, Integer timeout, String requestId, Context context) { - return dequeueWithResponseAsync(queueName, numberOfMessages, visibilitytimeout, timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The Dequeue operation retrieves one or more messages from the front of the queue. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Get Messages on a Queue along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> dequeueNoCustomHeadersWithResponseAsync(String queueName, - Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId) { return FluxUtil - .withContext(context -> dequeueNoCustomHeadersWithResponseAsync(queueName, numberOfMessages, - visibilitytimeout, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Dequeue operation retrieves one or more messages from the front of the queue. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Get Messages on a Queue along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> dequeueNoCustomHeadersWithResponseAsync(String queueName, - Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId, Context context) { - final String accept = "application/xml"; - return service - .dequeueNoCustomHeaders(this.client.getUrl(), queueName, numberOfMessages, visibilitytimeout, timeout, - this.client.getVersion(), requestId, accept, context) + .withContext(context -> service.dequeue(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + accept, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * The Dequeue operation retrieves one or more messages from the front of the queue. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Get Messages on a Queue along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase dequeueWithResponse(String queueName, - Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId, Context context) { + * Retrieves one or more messages from the front of the queue. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
numofmessagesIntegerNoA nonzero integer value that specifies the number of + * messages to + * retrieve from the queue, up to a maximum of 32. If fewer are visible, the + * visible messages are returned. By default, a single message is retrieved from + * the queue with this operation.
visibilitytimeoutIntegerNoSpecifies the new visibility timeout value, in + * seconds, relative to server time. A specified value must be + * larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message + * can be set to a value later than the expiry time.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     QueueMessage (Required): [
+     *          (Required){
+     *             MessageId: String (Required)
+     *             InsertionTime: DateTimeRfc1123 (Required)
+     *             ExpirationTime: DateTimeRfc1123 (Required)
+     *             PopReceipt: String (Required)
+     *             TimeNextVisible: DateTimeRfc1123 (Required)
+     *             DequeueCount: long (Required)
+     *             MessageText: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response of receive messages along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response dequeueWithResponse(RequestOptions requestOptions) { try { final String accept = "application/xml"; - return service.dequeueSync(this.client.getUrl(), queueName, numberOfMessages, visibilitytimeout, timeout, - this.client.getVersion(), requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The Dequeue operation retrieves one or more messages from the front of the queue. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Get Messages on a Queue. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QueueMessageItemInternalWrapper dequeue(String queueName, Integer numberOfMessages, - Integer visibilitytimeout, Integer timeout, String requestId) { - try { - return dequeueWithResponse(queueName, numberOfMessages, visibilitytimeout, timeout, requestId, Context.NONE) - .getValue(); + return service.dequeueSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * The Dequeue operation retrieves one or more messages from the front of the queue. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param visibilitytimeout Optional. Specifies the new visibility timeout value, in seconds, relative to server - * time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be - * larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility - * timeout of a message can be set to a value later than the expiry time. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Get Messages on a Queue along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response dequeueNoCustomHeadersWithResponse(String queueName, - Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId, Context context) { - try { - final String accept = "application/xml"; - return service.dequeueNoCustomHeadersSync(this.client.getUrl(), queueName, numberOfMessages, - visibilitytimeout, timeout, this.client.getVersion(), requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The Clear operation deletes all messages from the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> clearWithResponseAsync(String queueName, Integer timeout, - String requestId) { - return FluxUtil.withContext(context -> clearWithResponseAsync(queueName, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Clear operation deletes all messages from the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> clearWithResponseAsync(String queueName, Integer timeout, - String requestId, Context context) { - final String accept = "application/xml"; - return service - .clear(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Clear operation deletes all messages from the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono clearAsync(String queueName, Integer timeout, String requestId) { - return clearWithResponseAsync(queueName, timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Clear operation deletes all messages from the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono clearAsync(String queueName, Integer timeout, String requestId, Context context) { - return clearWithResponseAsync(queueName, timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Clear operation deletes all messages from the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Deletes all messages from the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> clearNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - String requestId) { + public Mono> clearWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext(context -> clearNoCustomHeadersWithResponseAsync(queueName, timeout, requestId, context)) + .withContext(context -> service.clear(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * The Clear operation deletes all messages from the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> clearNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - String requestId, Context context) { - final String accept = "application/xml"; - return service - .clearNoCustomHeaders(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, - context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Clear operation deletes all messages from the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase clearWithResponse(String queueName, Integer timeout, - String requestId, Context context) { - try { - final String accept = "application/xml"; - return service.clearSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, - accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The Clear operation deletes all messages from the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void clear(String queueName, Integer timeout, String requestId) { - clearWithResponse(queueName, timeout, requestId, Context.NONE); - } - - /** - * The Clear operation deletes all messages from the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Deletes all messages from the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response clearNoCustomHeadersWithResponse(String queueName, Integer timeout, String requestId, - Context context) { + public Response clearWithResponse(RequestOptions requestOptions) { try { - final String accept = "application/xml"; - return service.clearNoCustomHeadersSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), - requestId, accept, context); + return service.clearSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), requestOptions, + Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be - * specified to make the message invisible until the visibility timeout expires. A message must be in a format that - * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for - * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * - * @param queueName The queue name. - * @param queueMessage A Message object which can be stored in a Queue. - * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or - * later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative - * to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility - * timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a - * value smaller than the time-to-live value. - * @param messageTimeToLive Optional. Specifies the time-to-live interval for the message, in seconds. Prior to - * version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum - * time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this - * parameter is omitted, the default time-to-live is 7 days. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Put Message on a Queue along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> enqueueWithResponseAsync( - String queueName, QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, - Integer timeout, String requestId) { - return FluxUtil - .withContext(context -> enqueueWithResponseAsync(queueName, queueMessage, visibilitytimeout, - messageTimeToLive, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be - * specified to make the message invisible until the visibility timeout expires. A message must be in a format that - * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for - * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * - * @param queueName The queue name. - * @param queueMessage A Message object which can be stored in a Queue. - * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or - * later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative - * to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility - * timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a - * value smaller than the time-to-live value. - * @param messageTimeToLive Optional. Specifies the time-to-live interval for the message, in seconds. Prior to - * version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum - * time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this - * parameter is omitted, the default time-to-live is 7 days. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Put Message on a Queue along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> enqueueWithResponseAsync( - String queueName, QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, - Integer timeout, String requestId, Context context) { + * Adds a new message to the back of the message queue. A visibility timeout + * can also be specified to make the message invisible until the visibility timeout + * expires. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
visibilitytimeoutIntegerNoSpecifies the new visibility timeout value, in + * seconds, relative to server time. A specified value must be + * larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message + * can be set to a value later than the expiry time.
messagettlIntegerNoSpecifies the time-to-live interval for the message, in + * seconds. + * Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For + * version 2017-07-29 or later, the maximum time-to-live can be any positive + * number, as well as -1 indicating that the message does not expire. If this + * parameter is omitted, the default time-to-live is 7 days.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     MessageText: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     QueueMessage (Required): [
+     *          (Required){
+     *             MessageId: String (Required)
+     *             InsertionTime: DateTimeRfc1123 (Required)
+     *             ExpirationTime: DateTimeRfc1123 (Required)
+     *             PopReceipt: String (Required)
+     *             TimeNextVisible: DateTimeRfc1123 (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param queueMessage The queue message. The message must be in a format that can be included in an XML request + * with UTF-8 + * encoding. The encoded message can be up to 64 KB in size. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response of send message along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> enqueueWithResponseAsync(BinaryData queueMessage, RequestOptions requestOptions) { + final String contentType = "application/xml"; final String accept = "application/xml"; - return service - .enqueue(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, timeout, - this.client.getVersion(), requestId, queueMessage, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be - * specified to make the message invisible until the visibility timeout expires. A message must be in a format that - * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for - * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * - * @param queueName The queue name. - * @param queueMessage A Message object which can be stored in a Queue. - * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or - * later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative - * to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility - * timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a - * value smaller than the time-to-live value. - * @param messageTimeToLive Optional. Specifies the time-to-live interval for the message, in seconds. Prior to - * version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum - * time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this - * parameter is omitted, the default time-to-live is 7 days. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Put Message on a Queue on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enqueueAsync(String queueName, QueueMessage queueMessage, - Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId) { - return enqueueWithResponseAsync(queueName, queueMessage, visibilitytimeout, messageTimeToLive, timeout, - requestId).onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be - * specified to make the message invisible until the visibility timeout expires. A message must be in a format that - * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for - * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * - * @param queueName The queue name. - * @param queueMessage A Message object which can be stored in a Queue. - * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or - * later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative - * to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility - * timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a - * value smaller than the time-to-live value. - * @param messageTimeToLive Optional. Specifies the time-to-live interval for the message, in seconds. Prior to - * version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum - * time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this - * parameter is omitted, the default time-to-live is 7 days. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Put Message on a Queue on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enqueueAsync(String queueName, QueueMessage queueMessage, - Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId, Context context) { - return enqueueWithResponseAsync(queueName, queueMessage, visibilitytimeout, messageTimeToLive, timeout, - requestId, context).onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be - * specified to make the message invisible until the visibility timeout expires. A message must be in a format that - * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for - * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * - * @param queueName The queue name. - * @param queueMessage A Message object which can be stored in a Queue. - * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or - * later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative - * to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility - * timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a - * value smaller than the time-to-live value. - * @param messageTimeToLive Optional. Specifies the time-to-live interval for the message, in seconds. Prior to - * version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum - * time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this - * parameter is omitted, the default time-to-live is 7 days. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Put Message on a Queue along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> enqueueNoCustomHeadersWithResponseAsync(String queueName, - QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, - String requestId) { return FluxUtil - .withContext(context -> enqueueNoCustomHeadersWithResponseAsync(queueName, queueMessage, visibilitytimeout, - messageTimeToLive, timeout, requestId, context)) + .withContext(context -> service.enqueue(this.client.getUrl(), contentType, + this.client.getServiceVersion().getVersion(), accept, queueMessage, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be - * specified to make the message invisible until the visibility timeout expires. A message must be in a format that - * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for - * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * - * @param queueName The queue name. - * @param queueMessage A Message object which can be stored in a Queue. - * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or - * later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative - * to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility - * timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a - * value smaller than the time-to-live value. - * @param messageTimeToLive Optional. Specifies the time-to-live interval for the message, in seconds. Prior to - * version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum - * time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this - * parameter is omitted, the default time-to-live is 7 days. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Put Message on a Queue along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> enqueueNoCustomHeadersWithResponseAsync(String queueName, - QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, - String requestId, Context context) { - final String accept = "application/xml"; - return service - .enqueueNoCustomHeaders(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, timeout, - this.client.getVersion(), requestId, queueMessage, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be - * specified to make the message invisible until the visibility timeout expires. A message must be in a format that - * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for - * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * - * @param queueName The queue name. - * @param queueMessage A Message object which can be stored in a Queue. - * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or - * later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative - * to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility - * timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a - * value smaller than the time-to-live value. - * @param messageTimeToLive Optional. Specifies the time-to-live interval for the message, in seconds. Prior to - * version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum - * time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this - * parameter is omitted, the default time-to-live is 7 days. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Put Message on a Queue along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase enqueueWithResponse(String queueName, - QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, - String requestId, Context context) { + * Adds a new message to the back of the message queue. A visibility timeout + * can also be specified to make the message invisible until the visibility timeout + * expires. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
visibilitytimeoutIntegerNoSpecifies the new visibility timeout value, in + * seconds, relative to server time. A specified value must be + * larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message + * can be set to a value later than the expiry time.
messagettlIntegerNoSpecifies the time-to-live interval for the message, in + * seconds. + * Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For + * version 2017-07-29 or later, the maximum time-to-live can be any positive + * number, as well as -1 indicating that the message does not expire. If this + * parameter is omitted, the default time-to-live is 7 days.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     MessageText: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     QueueMessage (Required): [
+     *          (Required){
+     *             MessageId: String (Required)
+     *             InsertionTime: DateTimeRfc1123 (Required)
+     *             ExpirationTime: DateTimeRfc1123 (Required)
+     *             PopReceipt: String (Required)
+     *             TimeNextVisible: DateTimeRfc1123 (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param queueMessage The queue message. The message must be in a format that can be included in an XML request + * with UTF-8 + * encoding. The encoded message can be up to 64 KB in size. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response of send message along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response enqueueWithResponse(BinaryData queueMessage, RequestOptions requestOptions) { try { + final String contentType = "application/xml"; final String accept = "application/xml"; - return service.enqueueSync(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, timeout, - this.client.getVersion(), requestId, queueMessage, accept, context); + return service.enqueueSync(this.client.getUrl(), contentType, this.client.getServiceVersion().getVersion(), + accept, queueMessage, requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be - * specified to make the message invisible until the visibility timeout expires. A message must be in a format that - * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for - * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * - * @param queueName The queue name. - * @param queueMessage A Message object which can be stored in a Queue. - * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or - * later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative - * to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility - * timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a - * value smaller than the time-to-live value. - * @param messageTimeToLive Optional. Specifies the time-to-live interval for the message, in seconds. Prior to - * version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum - * time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this - * parameter is omitted, the default time-to-live is 7 days. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Put Message on a Queue. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SendMessageResultWrapper enqueue(String queueName, QueueMessage queueMessage, Integer visibilitytimeout, - Integer messageTimeToLive, Integer timeout, String requestId) { - try { - return enqueueWithResponse(queueName, queueMessage, visibilitytimeout, messageTimeToLive, timeout, - requestId, Context.NONE).getValue(); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be - * specified to make the message invisible until the visibility timeout expires. A message must be in a format that - * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for - * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * - * @param queueName The queue name. - * @param queueMessage A Message object which can be stored in a Queue. - * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or - * later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative - * to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility - * timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a - * value smaller than the time-to-live value. - * @param messageTimeToLive Optional. Specifies the time-to-live interval for the message, in seconds. Prior to - * version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum - * time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this - * parameter is omitted, the default time-to-live is 7 days. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Put Message on a Queue along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response enqueueNoCustomHeadersWithResponse(String queueName, - QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, - String requestId, Context context) { - try { - final String accept = "application/xml"; - return service.enqueueNoCustomHeadersSync(this.client.getUrl(), queueName, visibilitytimeout, - messageTimeToLive, timeout, this.client.getVersion(), requestId, queueMessage, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility - * of the message. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Peek Messages on a Queue along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - peekWithResponseAsync(String queueName, Integer numberOfMessages, Integer timeout, String requestId) { - return FluxUtil - .withContext(context -> peekWithResponseAsync(queueName, numberOfMessages, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility - * of the message. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Peek Messages on a Queue along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> peekWithResponseAsync( - String queueName, Integer numberOfMessages, Integer timeout, String requestId, Context context) { - final String peekonly = "true"; + * Retrieves one or more messages from the front of the queue, but does not alter the visibility of the message. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
numofmessagesIntegerNoA nonzero integer value that specifies the number of + * messages to + * retrieve from the queue, up to a maximum of 32. If fewer are visible, the + * visible messages are returned. By default, a single message is retrieved from + * the queue with this operation.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     QueueMessage (Required): [
+     *          (Required){
+     *             MessageId: String (Required)
+     *             InsertionTime: DateTimeRfc1123 (Required)
+     *             ExpirationTime: DateTimeRfc1123 (Required)
+     *             DequeueCount: long (Required)
+     *             MessageText: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response of peek messages along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> peekWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - return service - .peek(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, this.client.getVersion(), - requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility - * of the message. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Peek Messages on a Queue on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono peekAsync(String queueName, Integer numberOfMessages, Integer timeout, - String requestId) { - return peekWithResponseAsync(queueName, numberOfMessages, timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility - * of the message. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Peek Messages on a Queue on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono peekAsync(String queueName, Integer numberOfMessages, Integer timeout, - String requestId, Context context) { - return peekWithResponseAsync(queueName, numberOfMessages, timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility - * of the message. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Peek Messages on a Queue along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> peekNoCustomHeadersWithResponseAsync(String queueName, - Integer numberOfMessages, Integer timeout, String requestId) { - return FluxUtil.withContext( - context -> peekNoCustomHeadersWithResponseAsync(queueName, numberOfMessages, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility - * of the message. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Peek Messages on a Queue along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> peekNoCustomHeadersWithResponseAsync(String queueName, - Integer numberOfMessages, Integer timeout, String requestId, Context context) { - final String peekonly = "true"; - final String accept = "application/xml"; - return service - .peekNoCustomHeaders(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, - this.client.getVersion(), requestId, accept, context) + return FluxUtil + .withContext(context -> service.peek(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + accept, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility - * of the message. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Peek Messages on a Queue along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase peekWithResponse(String queueName, - Integer numberOfMessages, Integer timeout, String requestId, Context context) { - try { - final String peekonly = "true"; - final String accept = "application/xml"; - return service.peekSync(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, - this.client.getVersion(), requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility - * of the message. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Peek Messages on a Queue. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PeekedMessageItemInternalWrapper peek(String queueName, Integer numberOfMessages, Integer timeout, - String requestId) { - try { - return peekWithResponse(queueName, numberOfMessages, timeout, requestId, Context.NONE).getValue(); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility - * of the message. - * - * @param queueName The queue name. - * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from - * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single - * message is retrieved from the queue with this operation. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling Peek Messages on a Queue along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response peekNoCustomHeadersWithResponse(String queueName, - Integer numberOfMessages, Integer timeout, String requestId, Context context) { + * Retrieves one or more messages from the front of the queue, but does not alter the visibility of the message. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
numofmessagesIntegerNoA nonzero integer value that specifies the number of + * messages to + * retrieve from the queue, up to a maximum of 32. If fewer are visible, the + * visible messages are returned. By default, a single message is retrieved from + * the queue with this operation.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     QueueMessage (Required): [
+     *          (Required){
+     *             MessageId: String (Required)
+     *             InsertionTime: DateTimeRfc1123 (Required)
+     *             ExpirationTime: DateTimeRfc1123 (Required)
+     *             DequeueCount: long (Required)
+     *             MessageText: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response of peek messages along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response peekWithResponse(RequestOptions requestOptions) { try { - final String peekonly = "true"; final String accept = "application/xml"; - return service.peekNoCustomHeadersSync(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, - this.client.getVersion(), requestId, accept, context); + return service.peekSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java index 0f654704faa3..7efa0cc2b32e 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java @@ -1,39 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.implementation; -import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.storage.queue.implementation.models.QueueSignedIdentifierWrapper; +import com.azure.storage.queue.QueueServiceVersion; import com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal; -import com.azure.storage.queue.implementation.models.QueuesCreateHeaders; -import com.azure.storage.queue.implementation.models.QueuesDeleteHeaders; -import com.azure.storage.queue.implementation.models.QueuesGetAccessPolicyHeaders; -import com.azure.storage.queue.implementation.models.QueuesGetPropertiesHeaders; -import com.azure.storage.queue.implementation.models.QueuesSetAccessPolicyHeaders; -import com.azure.storage.queue.implementation.models.QueuesSetMetadataHeaders; import com.azure.storage.queue.implementation.util.ModelHelper; -import com.azure.storage.queue.models.QueueSignedIdentifier; -import java.util.List; -import java.util.Map; import reactor.core.publisher.Mono; /** @@ -61,6 +55,19 @@ public final class QueuesImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public QueueServiceVersion getServiceVersion() { + try { + return client.getServiceVersion(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } + } + /** * The interface defining all the services for AzureQueueStorageQueues to be used by the proxy service to perform * REST calls. @@ -69,1605 +76,570 @@ public final class QueuesImpl { @ServiceInterface(name = "AzureQueueStorageQueues") public interface QueuesService { - @Put("/{queueName}") - @ExpectedResponses({ 201, 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> create(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{queueName}") + @Put("/") @ExpectedResponses({ 201, 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> createNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); + Mono> create(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Put("/{queueName}") + @Put("/") @ExpectedResponses({ 201, 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase createSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); + Response createSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Put("/{queueName}") - @ExpectedResponses({ 201, 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response createNoCustomHeadersSync(@HostParam("url") String url, @PathParam("queueName") String queueName, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{queueName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> delete(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{queueName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> deleteNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{queueName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase deleteSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{queueName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response deleteNoCustomHeadersSync(@HostParam("url") String url, @PathParam("queueName") String queueName, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/{queueName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getProperties(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/{queueName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getPropertiesNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/{queueName}") + @Get("?comp=metadata") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase getPropertiesSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); + Mono> getProperties(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Get("/{queueName}") + @Get("?comp=metadata") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); + Response getPropertiesSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Put("/{queueName}") + @Delete("/") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> setMetadata(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Put("/{queueName}") + @Delete("/") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> setMetadataNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Response deleteSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Put("/{queueName}") + @Put("?comp=metadata") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase setMetadataSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Mono> setMetadata(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Put("/{queueName}") + @Put("?comp=metadata") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response setMetadataNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{queueName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getAccessPolicy( - @HostParam("url") String url, @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/{queueName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getAccessPolicyNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); + Response setMetadataSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); - @Get("/{queueName}") + @Get("?comp=acl") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase getAccessPolicySync( - @HostParam("url") String url, @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); + Mono> getAccessPolicy(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Get("/{queueName}") + @Get("?comp=acl") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response getAccessPolicyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{queueName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> setAccessPolicy(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueSignedIdentifierWrapper queueAcl, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{queueName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> setAccessPolicyNoCustomHeaders(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueSignedIdentifierWrapper queueAcl, @HeaderParam("Accept") String accept, - Context context); + Response getAccessPolicySync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Put("/{queueName}") + @Put("?comp=acl") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase setAccessPolicySync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueSignedIdentifierWrapper queueAcl, @HeaderParam("Accept") String accept, - Context context); + Mono> setAccessPolicy(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, RequestOptions requestOptions, Context context); - @Put("/{queueName}") + @Put("?comp=acl") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response setAccessPolicyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("queueName") String queueName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueSignedIdentifierWrapper queueAcl, @HeaderParam("Accept") String accept, - Context context); - } - - /** - * creates a new queue under the given account. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String queueName, Integer timeout, - Map metadata, String requestId) { - return FluxUtil - .withContext(context -> createWithResponseAsync(queueName, timeout, metadata, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * creates a new queue under the given account. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String queueName, Integer timeout, - Map metadata, String requestId, Context context) { - final String accept = "application/xml"; - return service - .create(this.client.getUrl(), queueName, timeout, metadata, this.client.getVersion(), requestId, accept, - context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * creates a new queue under the given account. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String queueName, Integer timeout, Map metadata, String requestId) { - return createWithResponseAsync(queueName, timeout, metadata, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * creates a new queue under the given account. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String queueName, Integer timeout, Map metadata, String requestId, - Context context) { - return createWithResponseAsync(queueName, timeout, metadata, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * creates a new queue under the given account. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + Response setAccessPolicySync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + RequestOptions requestOptions, Context context); + } + + /** + * Creates a new queue. If a queue with the same name already exists, the operation succeeds when the metadata + * is identical. If the metadata differs, the operation fails. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoThe metadata headers.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - Map metadata, String requestId) { + public Mono> createWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext( - context -> createNoCustomHeadersWithResponseAsync(queueName, timeout, metadata, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * creates a new queue under the given account. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - Map metadata, String requestId, Context context) { - final String accept = "application/xml"; - return service - .createNoCustomHeaders(this.client.getUrl(), queueName, timeout, metadata, this.client.getVersion(), - requestId, accept, context) + .withContext(context -> service.create(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * creates a new queue under the given account. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createWithResponse(String queueName, Integer timeout, - Map metadata, String requestId, Context context) { - try { - final String accept = "application/xml"; - return service.createSync(this.client.getUrl(), queueName, timeout, metadata, this.client.getVersion(), - requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * creates a new queue under the given account. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void create(String queueName, Integer timeout, Map metadata, String requestId) { - createWithResponse(queueName, timeout, metadata, requestId, Context.NONE); - } - - /** - * creates a new queue under the given account. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Creates a new queue. If a queue with the same name already exists, the operation succeeds when the metadata + * is identical. If the metadata differs, the operation fails. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoThe metadata headers.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createNoCustomHeadersWithResponse(String queueName, Integer timeout, - Map metadata, String requestId, Context context) { + public Response createWithResponse(RequestOptions requestOptions) { try { - final String accept = "application/xml"; - return service.createNoCustomHeadersSync(this.client.getUrl(), queueName, timeout, metadata, - this.client.getVersion(), requestId, accept, context); + return service.createSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * operation permanently deletes the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String queueName, Integer timeout, - String requestId) { - return FluxUtil.withContext(context -> deleteWithResponseAsync(queueName, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * operation permanently deletes the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String queueName, Integer timeout, - String requestId, Context context) { - final String accept = "application/xml"; - return service - .delete(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * operation permanently deletes the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String queueName, Integer timeout, String requestId) { - return deleteWithResponseAsync(queueName, timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * operation permanently deletes the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String queueName, Integer timeout, String requestId, Context context) { - return deleteWithResponseAsync(queueName, timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * operation permanently deletes the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Returns all user-defined metadata and system properties for the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - String requestId) { + public Mono> getPropertiesWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext(context -> deleteNoCustomHeadersWithResponseAsync(queueName, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * operation permanently deletes the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - String requestId, Context context) { - final String accept = "application/xml"; - return service - .deleteNoCustomHeaders(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, - accept, context) + .withContext(context -> service.getProperties(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * operation permanently deletes the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteWithResponse(String queueName, Integer timeout, - String requestId, Context context) { - try { - final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, - accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * operation permanently deletes the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String queueName, Integer timeout, String requestId) { - deleteWithResponse(queueName, timeout, requestId, Context.NONE); - } - - /** - * operation permanently deletes the specified queue. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Returns all user-defined metadata and system properties for the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteNoCustomHeadersWithResponse(String queueName, Integer timeout, String requestId, - Context context) { + public Response getPropertiesWithResponse(RequestOptions requestOptions) { try { - final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), - requestId, accept, context); + return service.getPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the - * queue as name-values pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String queueName, - Integer timeout, String requestId) { - return FluxUtil.withContext(context -> getPropertiesWithResponseAsync(queueName, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the - * queue as name-values pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String queueName, - Integer timeout, String requestId, Context context) { - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .getProperties(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), requestId, accept, - context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the - * queue as name-values pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(String queueName, Integer timeout, String requestId) { - return getPropertiesWithResponseAsync(queueName, timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the - * queue as name-values pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(String queueName, Integer timeout, String requestId, Context context) { - return getPropertiesWithResponseAsync(queueName, timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the - * queue as name-values pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Permanently deletes the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - String requestId) { + public Mono> deleteWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext( - context -> getPropertiesNoCustomHeadersWithResponseAsync(queueName, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the - * queue as name-values pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - String requestId, Context context) { - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .getPropertiesNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, accept, context) + .withContext(context -> service.delete(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the - * queue as name-values pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPropertiesWithResponse(String queueName, Integer timeout, - String requestId, Context context) { - try { - final String comp = "metadata"; - final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the - * queue as name-values pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void getProperties(String queueName, Integer timeout, String requestId) { - getPropertiesWithResponse(queueName, timeout, requestId, Context.NONE); - } - - /** - * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the - * queue as name-values pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Permanently deletes the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPropertiesNoCustomHeadersWithResponse(String queueName, Integer timeout, String requestId, - Context context) { + public Response deleteWithResponse(RequestOptions requestOptions) { try { - final String comp = "metadata"; - final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service.deleteSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataWithResponseAsync(String queueName, - Integer timeout, Map metadata, String requestId) { - return FluxUtil - .withContext(context -> setMetadataWithResponseAsync(queueName, timeout, metadata, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataWithResponseAsync(String queueName, - Integer timeout, Map metadata, String requestId, Context context) { - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .setMetadata(this.client.getUrl(), queueName, comp, timeout, metadata, this.client.getVersion(), requestId, - accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataAsync(String queueName, Integer timeout, Map metadata, - String requestId) { - return setMetadataWithResponseAsync(queueName, timeout, metadata, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataAsync(String queueName, Integer timeout, Map metadata, - String requestId, Context context) { - return setMetadataWithResponseAsync(queueName, timeout, metadata, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Sets user-defined metadata for the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoThe metadata headers.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - Map metadata, String requestId) { - return FluxUtil.withContext( - context -> setMetadataNoCustomHeadersWithResponseAsync(queueName, timeout, metadata, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - Map metadata, String requestId, Context context) { - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .setMetadataNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, metadata, - this.client.getVersion(), requestId, accept, context) + public Mono> setMetadataWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.setMetadata(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setMetadataWithResponse(String queueName, Integer timeout, - Map metadata, String requestId, Context context) { - try { - final String comp = "metadata"; - final String accept = "application/xml"; - return service.setMetadataSync(this.client.getUrl(), queueName, comp, timeout, metadata, - this.client.getVersion(), requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setMetadata(String queueName, Integer timeout, Map metadata, String requestId) { - setMetadataWithResponse(queueName, timeout, metadata, requestId, Context.NONE); - } - - /** - * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param metadata Optional. Include this parameter to specify that the queue's metadata be returned as part of the - * response body. Note that metadata requested with this parameter must be stored in accordance with the naming - * restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata - * names must adhere to the naming conventions for C# identifiers. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Sets user-defined metadata for the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoThe metadata headers.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response setMetadataNoCustomHeadersWithResponse(String queueName, Integer timeout, - Map metadata, String requestId, Context context) { + public Response setMetadataWithResponse(RequestOptions requestOptions) { try { - final String comp = "metadata"; - final String accept = "application/xml"; - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, metadata, - this.client.getVersion(), requestId, accept, context); + return service.setMetadataSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * returns details about any stored access policies specified on the queue that may be used with Shared Access - * Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of signed identifiers along with {@link ResponseBase} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getAccessPolicyWithResponseAsync(String queueName, Integer timeout, String requestId) { - return FluxUtil.withContext(context -> getAccessPolicyWithResponseAsync(queueName, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * returns details about any stored access policies specified on the queue that may be used with Shared Access - * Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of signed identifiers along with {@link ResponseBase} on successful completion of + * Gets the access policy for the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedIdentifier (Required): [
+     *          (Required){
+     *             Id: String (Required)
+     *             AccessPolicy (Required): {
+     *                 Start: String (Optional)
+     *                 Expiry: String (Optional)
+     *                 Permission: String (Optional)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the access policy for the specified queue along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getAccessPolicyWithResponseAsync(String queueName, Integer timeout, String requestId, Context context) { - final String comp = "acl"; + public Mono> getAccessPolicyWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - return service - .getAccessPolicy(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), requestId, - accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * returns details about any stored access policies specified on the queue that may be used with Shared Access - * Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of signed identifiers on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAccessPolicyAsync(String queueName, Integer timeout, - String requestId) { - return getAccessPolicyWithResponseAsync(queueName, timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * returns details about any stored access policies specified on the queue that may be used with Shared Access - * Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of signed identifiers on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAccessPolicyAsync(String queueName, Integer timeout, String requestId, - Context context) { - return getAccessPolicyWithResponseAsync(queueName, timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * returns details about any stored access policies specified on the queue that may be used with Shared Access - * Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of signed identifiers along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getAccessPolicyNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, String requestId) { return FluxUtil - .withContext( - context -> getAccessPolicyNoCustomHeadersWithResponseAsync(queueName, timeout, requestId, context)) + .withContext(context -> service.getAccessPolicy(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * returns details about any stored access policies specified on the queue that may be used with Shared Access - * Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of signed identifiers along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAccessPolicyNoCustomHeadersWithResponseAsync( - String queueName, Integer timeout, String requestId, Context context) { - final String comp = "acl"; - final String accept = "application/xml"; - return service - .getAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * returns details about any stored access policies specified on the queue that may be used with Shared Access - * Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of signed identifiers along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase - getAccessPolicyWithResponse(String queueName, Integer timeout, String requestId, Context context) { + * Gets the access policy for the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedIdentifier (Required): [
+     *          (Required){
+     *             Id: String (Required)
+     *             AccessPolicy (Required): {
+     *                 Start: String (Optional)
+     *                 Expiry: String (Optional)
+     *                 Permission: String (Optional)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the access policy for the specified queue along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAccessPolicyWithResponse(RequestOptions requestOptions) { try { - final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicySync(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, accept, context); + return service.getAccessPolicySync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * returns details about any stored access policies specified on the queue that may be used with Shared Access - * Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of signed identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QueueSignedIdentifierWrapper getAccessPolicy(String queueName, Integer timeout, String requestId) { - try { - return getAccessPolicyWithResponse(queueName, timeout, requestId, Context.NONE).getValue(); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * returns details about any stored access policies specified on the queue that may be used with Shared Access - * Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of signed identifiers along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAccessPolicyNoCustomHeadersWithResponse(String queueName, - Integer timeout, String requestId, Context context) { - try { - final String comp = "acl"; - final String accept = "application/xml"; - return service.getAccessPolicyNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * sets stored access policies for the queue that may be used with Shared Access Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueAcl the acls for the queue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setAccessPolicyWithResponseAsync(String queueName, - Integer timeout, String requestId, List queueAcl) { - return FluxUtil - .withContext(context -> setAccessPolicyWithResponseAsync(queueName, timeout, requestId, queueAcl, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * sets stored access policies for the queue that may be used with Shared Access Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueAcl the acls for the queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setAccessPolicyWithResponseAsync(String queueName, - Integer timeout, String requestId, List queueAcl, Context context) { - final String comp = "acl"; - final String accept = "application/xml"; - QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return service - .setAccessPolicy(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), requestId, - queueAclConverted, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * sets stored access policies for the queue that may be used with Shared Access Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueAcl the acls for the queue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setAccessPolicyAsync(String queueName, Integer timeout, String requestId, - List queueAcl) { - return setAccessPolicyWithResponseAsync(queueName, timeout, requestId, queueAcl) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * sets stored access policies for the queue that may be used with Shared Access Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueAcl the acls for the queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setAccessPolicyAsync(String queueName, Integer timeout, String requestId, - List queueAcl, Context context) { - return setAccessPolicyWithResponseAsync(queueName, timeout, requestId, queueAcl, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * sets stored access policies for the queue that may be used with Shared Access Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueAcl the acls for the queue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Sets the permissions for the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/xml".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedIdentifier (Required): [
+     *          (Required){
+     *             Id: String (Required)
+     *             AccessPolicy (Required): {
+     *                 Start: String (Optional)
+     *                 Expiry: String (Optional)
+     *                 Permission: String (Optional)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - String requestId, List queueAcl) { + public Mono> setAccessPolicyWithResponseAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/xml"); + } + }); return FluxUtil - .withContext(context -> setAccessPolicyNoCustomHeadersWithResponseAsync(queueName, timeout, requestId, - queueAcl, context)) + .withContext(context -> service.setAccessPolicy(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), requestOptionsLocal, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * sets stored access policies for the queue that may be used with Shared Access Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueAcl the acls for the queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, - String requestId, List queueAcl, Context context) { - final String comp = "acl"; - final String accept = "application/xml"; - QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return service - .setAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, queueAclConverted, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * sets stored access policies for the queue that may be used with Shared Access Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueAcl the acls for the queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setAccessPolicyWithResponse(String queueName, - Integer timeout, String requestId, List queueAcl, Context context) { - try { - final String comp = "acl"; - final String accept = "application/xml"; - QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return service.setAccessPolicySync(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, queueAclConverted, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * sets stored access policies for the queue that may be used with Shared Access Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueAcl the acls for the queue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setAccessPolicy(String queueName, Integer timeout, String requestId, - List queueAcl) { - setAccessPolicyWithResponse(queueName, timeout, requestId, queueAcl, Context.NONE); - } - - /** - * sets stored access policies for the queue that may be used with Shared Access Signatures. - * - * @param queueName The queue name. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queueAcl the acls for the queue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Sets the permissions for the specified queue. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/xml".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedIdentifier (Required): [
+     *          (Required){
+     *             Id: String (Required)
+     *             AccessPolicy (Required): {
+     *                 Start: String (Optional)
+     *                 Expiry: String (Optional)
+     *                 Permission: String (Optional)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response setAccessPolicyNoCustomHeadersWithResponse(String queueName, Integer timeout, - String requestId, List queueAcl, Context context) { + public Response setAccessPolicyWithResponse(RequestOptions requestOptions) { try { - final String comp = "acl"; - final String accept = "application/xml"; - QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return service.setAccessPolicyNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, queueAclConverted, accept, context); + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null + && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/xml"); + } + }); + return service.setAccessPolicySync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + requestOptionsLocal, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java index e73a6302b761..39444fbc7327 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.implementation; import com.azure.core.annotation.BodyParam; @@ -9,39 +9,31 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.storage.queue.implementation.models.KeyInfo; -import com.azure.storage.queue.implementation.models.ListQueuesSegmentResponse; +import com.azure.storage.queue.QueueServiceVersion; import com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal; -import com.azure.storage.queue.implementation.models.ServicesGetPropertiesHeaders; -import com.azure.storage.queue.implementation.models.ServicesGetStatisticsHeaders; -import com.azure.storage.queue.implementation.models.ServicesGetUserDelegationKeyHeaders; -import com.azure.storage.queue.implementation.models.ServicesListQueuesSegmentHeaders; -import com.azure.storage.queue.implementation.models.ServicesListQueuesSegmentNextHeaders; -import com.azure.storage.queue.implementation.models.ServicesSetPropertiesHeaders; import com.azure.storage.queue.implementation.util.ModelHelper; -import com.azure.storage.queue.models.QueueItem; -import com.azure.storage.queue.models.QueueServiceProperties; -import com.azure.storage.queue.models.QueueServiceStatistics; -import com.azure.storage.queue.models.UserDelegationKey; import java.util.List; -import java.util.Objects; +import java.util.Map; import java.util.stream.Collectors; import reactor.core.publisher.Mono; @@ -70,6 +62,19 @@ public final class ServicesImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public QueueServiceVersion getServiceVersion() { + try { + return client.getServiceVersion(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } + } + /** * The interface defining all the services for AzureQueueStorageServices to be used by the proxy service to perform * REST calls. @@ -78,1987 +83,818 @@ public final class ServicesImpl { @ServiceInterface(name = "AzureQueueStorageServices") public interface ServicesService { - @Put("/") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> setProperties(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueServiceProperties queueServiceProperties, - @HeaderParam("Accept") String accept, Context context); - - @Put("/") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> setPropertiesNoCustomHeaders(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueServiceProperties queueServiceProperties, - @HeaderParam("Accept") String accept, Context context); - - @Put("/") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase setPropertiesSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueServiceProperties queueServiceProperties, - @HeaderParam("Accept") String accept, Context context); - - @Put("/") + @Put("?restype=service&comp=properties") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response setPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueueServiceProperties queueServiceProperties, - @HeaderParam("Accept") String accept, Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getProperties( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getPropertiesNoCustomHeaders(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase getPropertiesSync( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getStatistics( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getStatisticsNoCustomHeaders(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase getStatisticsSync( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, + Mono> setProperties(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/xml") BinaryData queueServiceProperties, RequestOptions requestOptions, Context context); - @Get("/") - @ExpectedResponses({ 200 }) + @Put("?restype=service&comp=properties") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response getStatisticsNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, + Response setPropertiesSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/xml") BinaryData queueServiceProperties, RequestOptions requestOptions, Context context); - @Post("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getUserDelegationKey( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); - - @Post("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> getUserDelegationKeyNoCustomHeaders(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); - - @Post("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase getUserDelegationKeySync( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); - - @Post("/") + @Get("?restype=service&comp=properties") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response getUserDelegationKeyNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); + Mono> getProperties(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Get("/") + @Get("?restype=service&comp=properties") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> listQueuesSegment( - @HostParam("url") String url, @QueryParam("comp") String comp, @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, - @HeaderParam("Accept") String accept, Context context); + Response getPropertiesSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Get("/") + @Get("?restype=service&comp=stats") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> listQueuesSegmentNoCustomHeaders(@HostParam("url") String url, - @QueryParam("comp") String comp, @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, @HeaderParam("Accept") String accept, - Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase listQueuesSegmentSync( - @HostParam("url") String url, @QueryParam("comp") String comp, @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, - @HeaderParam("Accept") String accept, Context context); + Mono> getStatistics(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Get("/") + @Get("?restype=service&comp=stats") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response listQueuesSegmentNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("comp") String comp, @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, @HeaderParam("Accept") String accept, - Context context); + Response getStatisticsSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Get("{nextLink}") + @Post("?restype=service&comp=userdelegationkey") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> listQueuesSegmentNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Mono> getUserDelegationKey(@HostParam("url") String url, + @HeaderParam("Content-Type") String contentType, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, @BodyParam("application/xml") BinaryData keyInfo, + RequestOptions requestOptions, Context context); - @Get("{nextLink}") + @Post("?restype=service&comp=userdelegationkey") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Mono> listQueuesSegmentNextNoCustomHeaders( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Response getUserDelegationKeySync(@HostParam("url") String url, + @HeaderParam("Content-Type") String contentType, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, @BodyParam("application/xml") BinaryData keyInfo, + RequestOptions requestOptions, Context context); - @Get("{nextLink}") + @Get("?comp=list") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - ResponseBase listQueuesSegmentNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); + Mono> getQueues(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Get("{nextLink}") + @Get("?comp=list") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) - Response listQueuesSegmentNextNoCustomHeadersSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param queueServiceProperties The StorageService properties. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesWithResponseAsync( - QueueServiceProperties queueServiceProperties, Integer timeout, String requestId) { - return FluxUtil - .withContext(context -> setPropertiesWithResponseAsync(queueServiceProperties, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param queueServiceProperties The StorageService properties. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesWithResponseAsync( - QueueServiceProperties queueServiceProperties, Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .setProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, - queueServiceProperties, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param queueServiceProperties The StorageService properties. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesAsync(QueueServiceProperties queueServiceProperties, Integer timeout, - String requestId) { - return setPropertiesWithResponseAsync(queueServiceProperties, timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param queueServiceProperties The StorageService properties. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesAsync(QueueServiceProperties queueServiceProperties, Integer timeout, - String requestId, Context context) { - return setPropertiesWithResponseAsync(queueServiceProperties, timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param queueServiceProperties The StorageService properties. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + Response getQueuesSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Logging (Optional): {
+     *         Version: String (Required)
+     *         Delete: boolean (Required)
+     *         Read: boolean (Required)
+     *         Write: boolean (Required)
+     *         RetentionPolicy (Required): {
+     *             Enabled: boolean (Required)
+     *             Days: Integer (Optional)
+     *         }
+     *     }
+     *     HourMetrics (Optional): {
+     *         Version: String (Optional)
+     *         Enabled: boolean (Required)
+     *         IncludeAPIs: Boolean (Optional)
+     *         RetentionPolicy (Optional): (recursive schema, see RetentionPolicy above)
+     *     }
+     *     MinuteMetrics (Optional): (recursive schema, see MinuteMetrics above)
+     *     Cors (Optional): [
+     *          (Optional){
+     *             AllowedOrigins: String (Required)
+     *             AllowedMethods: String (Required)
+     *             AllowedHeaders: String (Required)
+     *             ExposedHeaders: String (Required)
+     *             MaxAgeInSeconds: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param queueServiceProperties The storage service properties to set. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesNoCustomHeadersWithResponseAsync( - QueueServiceProperties queueServiceProperties, Integer timeout, String requestId) { + public Mono> setPropertiesWithResponseAsync(BinaryData queueServiceProperties, + RequestOptions requestOptions) { + final String contentType = "application/xml"; return FluxUtil - .withContext(context -> setPropertiesNoCustomHeadersWithResponseAsync(queueServiceProperties, timeout, - requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param queueServiceProperties The StorageService properties. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesNoCustomHeadersWithResponseAsync( - QueueServiceProperties queueServiceProperties, Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, queueServiceProperties, accept, context) + .withContext( + context -> service.setProperties(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + contentType, queueServiceProperties, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param queueServiceProperties The StorageService properties. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setPropertiesWithResponse( - QueueServiceProperties queueServiceProperties, Integer timeout, String requestId, Context context) { - try { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.setPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, queueServiceProperties, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param queueServiceProperties The StorageService properties. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setProperties(QueueServiceProperties queueServiceProperties, Integer timeout, String requestId) { - setPropertiesWithResponse(queueServiceProperties, timeout, requestId, Context.NONE); - } - - /** - * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param queueServiceProperties The StorageService properties. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Logging (Optional): {
+     *         Version: String (Required)
+     *         Delete: boolean (Required)
+     *         Read: boolean (Required)
+     *         Write: boolean (Required)
+     *         RetentionPolicy (Required): {
+     *             Enabled: boolean (Required)
+     *             Days: Integer (Optional)
+     *         }
+     *     }
+     *     HourMetrics (Optional): {
+     *         Version: String (Optional)
+     *         Enabled: boolean (Required)
+     *         IncludeAPIs: Boolean (Optional)
+     *         RetentionPolicy (Optional): (recursive schema, see RetentionPolicy above)
+     *     }
+     *     MinuteMetrics (Optional): (recursive schema, see MinuteMetrics above)
+     *     Cors (Optional): [
+     *          (Optional){
+     *             AllowedOrigins: String (Required)
+     *             AllowedMethods: String (Required)
+     *             AllowedHeaders: String (Required)
+     *             ExposedHeaders: String (Required)
+     *             MaxAgeInSeconds: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param queueServiceProperties The storage service properties to set. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response setPropertiesNoCustomHeadersWithResponse(QueueServiceProperties queueServiceProperties, - Integer timeout, String requestId, Context context) { + public Response setPropertiesWithResponse(BinaryData queueServiceProperties, RequestOptions requestOptions) { try { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, queueServiceProperties, accept, context); + final String contentType = "application/xml"; + return service.setPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + contentType, queueServiceProperties, requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getPropertiesWithResponseAsync(Integer timeout, String requestId) { - return FluxUtil.withContext(context -> getPropertiesWithResponseAsync(timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getPropertiesWithResponseAsync(Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "properties"; + * Retrieves properties of a storage account's Queue service, including properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Logging (Optional): {
+     *         Version: String (Required)
+     *         Delete: boolean (Required)
+     *         Read: boolean (Required)
+     *         Write: boolean (Required)
+     *         RetentionPolicy (Required): {
+     *             Enabled: boolean (Required)
+     *             Days: Integer (Optional)
+     *         }
+     *     }
+     *     HourMetrics (Optional): {
+     *         Version: String (Optional)
+     *         Enabled: boolean (Required)
+     *         IncludeAPIs: Boolean (Optional)
+     *         RetentionPolicy (Optional): (recursive schema, see RetentionPolicy above)
+     *     }
+     *     MinuteMetrics (Optional): (recursive schema, see MinuteMetrics above)
+     *     Cors (Optional): [
+     *          (Optional){
+     *             AllowedOrigins: String (Required)
+     *             AllowedMethods: String (Required)
+     *             AllowedHeaders: String (Required)
+     *             ExposedHeaders: String (Required)
+     *             MaxAgeInSeconds: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the service properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPropertiesWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - return service - .getProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, accept, - context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(Integer timeout, String requestId) { - return getPropertiesWithResponseAsync(timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(Integer timeout, String requestId, Context context) { - return getPropertiesWithResponseAsync(timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(Integer timeout, - String requestId) { return FluxUtil - .withContext(context -> getPropertiesNoCustomHeadersWithResponseAsync(timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(Integer timeout, - String requestId, Context context) { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, accept, context) + .withContext(context -> service.getProperties(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPropertiesWithResponse(Integer timeout, - String requestId, Context context) { - try { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QueueServiceProperties getProperties(Integer timeout, String requestId) { - try { - return getPropertiesWithResponse(timeout, requestId, Context.NONE).getValue(); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPropertiesNoCustomHeadersWithResponse(Integer timeout, String requestId, - Context context) { + * Retrieves properties of a storage account's Queue service, including properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Logging (Optional): {
+     *         Version: String (Required)
+     *         Delete: boolean (Required)
+     *         Read: boolean (Required)
+     *         Write: boolean (Required)
+     *         RetentionPolicy (Required): {
+     *             Enabled: boolean (Required)
+     *             Days: Integer (Optional)
+     *         }
+     *     }
+     *     HourMetrics (Optional): {
+     *         Version: String (Optional)
+     *         Enabled: boolean (Required)
+     *         IncludeAPIs: Boolean (Optional)
+     *         RetentionPolicy (Optional): (recursive schema, see RetentionPolicy above)
+     *     }
+     *     MinuteMetrics (Optional): (recursive schema, see MinuteMetrics above)
+     *     Cors (Optional): [
+     *          (Optional){
+     *             AllowedOrigins: String (Required)
+     *             AllowedMethods: String (Required)
+     *             AllowedHeaders: String (Required)
+     *             ExposedHeaders: String (Required)
+     *             MaxAgeInSeconds: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the service properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPropertiesWithResponse(RequestOptions requestOptions) { try { - final String restype = "service"; - final String comp = "properties"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service.getPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getStatisticsWithResponseAsync(Integer timeout, String requestId) { - return FluxUtil.withContext(context -> getStatisticsWithResponseAsync(timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getStatisticsWithResponseAsync(Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "stats"; + * Retrieves statistics related to replication for the Queue service. It is only available on the secondary + * location endpoint when read-access geo-redundant replication is enabled for the storage account. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     GeoReplication (Optional): {
+     *         Status: String(live/bootstrap/unavailable) (Required)
+     *         LastSyncTime: DateTimeRfc1123 (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return statistics for the storage queue service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStatisticsWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - return service - .getStatistics(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, accept, - context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStatisticsAsync(Integer timeout, String requestId) { - return getStatisticsWithResponseAsync(timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStatisticsAsync(Integer timeout, String requestId, Context context) { - return getStatisticsWithResponseAsync(timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStatisticsNoCustomHeadersWithResponseAsync(Integer timeout, - String requestId) { return FluxUtil - .withContext(context -> getStatisticsNoCustomHeadersWithResponseAsync(timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStatisticsNoCustomHeadersWithResponseAsync(Integer timeout, - String requestId, Context context) { - final String restype = "service"; - final String comp = "stats"; - final String accept = "application/xml"; - return service - .getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, accept, context) + .withContext(context -> service.getStatistics(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getStatisticsWithResponse(Integer timeout, - String requestId, Context context) { - try { - final String restype = "service"; - final String comp = "stats"; - final String accept = "application/xml"; - return service.getStatisticsSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QueueServiceStatistics getStatistics(Integer timeout, String requestId) { - try { - return getStatisticsWithResponse(timeout, requestId, Context.NONE).getValue(); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStatisticsNoCustomHeadersWithResponse(Integer timeout, String requestId, - Context context) { + * Retrieves statistics related to replication for the Queue service. It is only available on the secondary + * location endpoint when read-access geo-redundant replication is enabled for the storage account. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     GeoReplication (Optional): {
+     *         Status: String(live/bootstrap/unavailable) (Required)
+     *         LastSyncTime: DateTimeRfc1123 (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return statistics for the storage queue service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStatisticsWithResponse(RequestOptions requestOptions) { try { - final String restype = "service"; - final String comp = "stats"; final String accept = "application/xml"; - return service.getStatisticsNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service.getStatisticsSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getUserDelegationKeyWithResponseAsync(KeyInfo keyInfo, Integer timeout, String requestId) { - return FluxUtil - .withContext(context -> getUserDelegationKeyWithResponseAsync(keyInfo, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getUserDelegationKeyWithResponseAsync(KeyInfo keyInfo, Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "userdelegationkey"; - final String accept = "application/xml"; - return service - .getUserDelegationKey(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, - keyInfo, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getUserDelegationKeyAsync(KeyInfo keyInfo, Integer timeout, String requestId) { - return getUserDelegationKeyWithResponseAsync(keyInfo, timeout, requestId) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getUserDelegationKeyAsync(KeyInfo keyInfo, Integer timeout, String requestId, - Context context) { - return getUserDelegationKeyWithResponseAsync(keyInfo, timeout, requestId, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUserDelegationKeyNoCustomHeadersWithResponseAsync(KeyInfo keyInfo, - Integer timeout, String requestId) { - return FluxUtil - .withContext( - context -> getUserDelegationKeyNoCustomHeadersWithResponseAsync(keyInfo, timeout, requestId, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); - } - - /** - * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer token - * authentication. + * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer + * token authentication. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Start: OffsetDateTime (Optional)
+     *     Expiry: OffsetDateTime (Required)
+     *     DelegatedUserTid: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedOid: String (Required)
+     *     SignedTid: String (Required)
+     *     SignedStart: OffsetDateTime (Required)
+     *     SignedExpiry: OffsetDateTime (Required)
+     *     SignedService: String (Required)
+     *     SignedVersion: String (Required)
+     *     SignedDelegatedUserTid: String (Optional)
+     *     Value: String (Required)
+     * }
+     * }
+     * 
* * @param keyInfo Key information. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a user delegation key along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUserDelegationKeyNoCustomHeadersWithResponseAsync(KeyInfo keyInfo, - Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "userdelegationkey"; + public Mono> getUserDelegationKeyWithResponseAsync(BinaryData keyInfo, + RequestOptions requestOptions) { + final String contentType = "application/xml"; final String accept = "application/xml"; - return service - .getUserDelegationKeyNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, keyInfo, accept, context) + return FluxUtil + .withContext(context -> service.getUserDelegationKey(this.client.getUrl(), contentType, + this.client.getServiceVersion().getVersion(), accept, keyInfo, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** - * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer token - * authentication. + * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer + * token authentication. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Start: OffsetDateTime (Optional)
+     *     Expiry: OffsetDateTime (Required)
+     *     DelegatedUserTid: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedOid: String (Required)
+     *     SignedTid: String (Required)
+     *     SignedStart: OffsetDateTime (Required)
+     *     SignedExpiry: OffsetDateTime (Required)
+     *     SignedService: String (Required)
+     *     SignedVersion: String (Required)
+     *     SignedDelegatedUserTid: String (Optional)
+     *     Value: String (Required)
+     * }
+     * }
+     * 
* * @param keyInfo Key information. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase - getUserDelegationKeyWithResponse(KeyInfo keyInfo, Integer timeout, String requestId, Context context) { - try { - final String restype = "service"; - final String comp = "userdelegationkey"; - final String accept = "application/xml"; - return service.getUserDelegationKeySync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, keyInfo, accept, context); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserDelegationKey getUserDelegationKey(KeyInfo keyInfo, Integer timeout, String requestId) { - try { - return getUserDelegationKeyWithResponse(keyInfo, timeout, requestId, Context.NONE).getValue(); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * Retrieves a user delegation key for the Queue service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a user delegation key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUserDelegationKeyNoCustomHeadersWithResponse(KeyInfo keyInfo, Integer timeout, - String requestId, Context context) { + public Response getUserDelegationKeyWithResponse(BinaryData keyInfo, RequestOptions requestOptions) { try { - final String restype = "service"; - final String comp = "userdelegationkey"; + final String contentType = "application/xml"; final String accept = "application/xml"; - return service.getUserDelegationKeyNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, keyInfo, accept, context); + return service.getUserDelegationKeySync(this.client.getUrl(), contentType, + this.client.getServiceVersion().getVersion(), accept, keyInfo, requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listQueuesSegmentSinglePageAsync(String prefix, String marker, - Integer maxresults, List include, Integer timeout, String requestId) { - final String comp = "list"; + * Returns a list of queues. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only queues whose name begins with + * the specified prefix.
markerStringNoIdentifies the portion of the list of queues to be returned with + * the next listing operation. The operation + * returns the marker value if the listing operation did not return all queues remaining. The marker 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.
maxresultsIntegerNoSpecifies the maximum number of queues to return. If the + * request does not specify maxresults, or specifies + * a value greater than 5000, the server will return up to 5000 items.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
includeList<String>NoSpecify to include additional, optional + * information. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Name: String (Required)
+     *     Metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list queues response along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getQueuesSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); return FluxUtil - .withContext(context -> service.listQueuesSegment(this.client.getUrl(), comp, prefix, marker, maxresults, - includeConverted, timeout, this.client.getVersion(), requestId, accept, context)) + .withContext(context -> service.getQueues(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listQueuesSegmentSinglePageAsync(String prefix, String marker, - Integer maxresults, List include, Integer timeout, String requestId, Context context) { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .listQueuesSegment(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, - this.client.getVersion(), requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service as paginated response with - * {@link PagedFlux}. + getValues(res.getValue(), "Queues"), null, null)); + } + + /** + * Returns a list of queues. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only queues whose name begins with + * the specified prefix.
markerStringNoIdentifies the portion of the list of queues to be returned with + * the next listing operation. The operation + * returns the marker value if the listing operation did not return all queues remaining. The marker 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.
maxresultsIntegerNoSpecifies the maximum number of queues to return. If the + * request does not specify maxresults, or specifies + * a value greater than 5000, the server will return up to 5000 items.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
includeList<String>NoSpecify to include additional, optional + * information. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Name: String (Required)
+     *     Metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list queues response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listQueuesSegmentAsync(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId) { - return new PagedFlux<>( - () -> listQueuesSegmentSinglePageAsync(prefix, marker, maxresults, include, timeout, requestId), - nextLink -> listQueuesSegmentNextSinglePageAsync(nextLink, requestId)); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listQueuesSegmentAsync(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId, Context context) { - return new PagedFlux<>( - () -> listQueuesSegmentSinglePageAsync(prefix, marker, maxresults, include, timeout, requestId, context), - nextLink -> listQueuesSegmentNextSinglePageAsync(nextLink, requestId, context)); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listQueuesSegmentNoCustomHeadersSinglePageAsync(String prefix, String marker, - Integer maxresults, List include, Integer timeout, String requestId) { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.listQueuesSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, - maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null)); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listQueuesSegmentNoCustomHeadersSinglePageAsync(String prefix, String marker, - Integer maxresults, List include, Integer timeout, String requestId, Context context) { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .listQueuesSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, - timeout, this.client.getVersion(), requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null)); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listQueuesSegmentNoCustomHeadersAsync(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId) { - return new PagedFlux<>(() -> listQueuesSegmentNoCustomHeadersSinglePageAsync(prefix, marker, maxresults, - include, timeout, requestId), nextLink -> listQueuesSegmentNextSinglePageAsync(nextLink, requestId)); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listQueuesSegmentNoCustomHeadersAsync(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId, Context context) { - return new PagedFlux<>(() -> listQueuesSegmentNoCustomHeadersSinglePageAsync(prefix, marker, maxresults, - include, timeout, requestId, context), - nextLink -> listQueuesSegmentNextSinglePageAsync(nextLink, requestId, context)); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listQueuesSegmentSinglePage(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId) { - try { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - ResponseBase res - = service.listQueuesSegmentSync(this.client.getUrl(), comp, prefix, marker, maxresults, - includeConverted, timeout, this.client.getVersion(), requestId, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listQueuesSegmentSinglePage(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId, Context context) { + public PagedFlux getQueuesAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> getQueuesSinglePageAsync(requestOptions)); + } + + /** + * Returns a list of queues. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only queues whose name begins with + * the specified prefix.
markerStringNoIdentifies the portion of the list of queues to be returned with + * the next listing operation. The operation + * returns the marker value if the listing operation did not return all queues remaining. The marker 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.
maxresultsIntegerNoSpecifies the maximum number of queues to return. If the + * request does not specify maxresults, or specifies + * a value greater than 5000, the server will return up to 5000 items.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
includeList<String>NoSpecify to include additional, optional + * information. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Name: String (Required)
+     *     Metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list queues response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getQueuesSinglePage(RequestOptions requestOptions) { try { - final String comp = "list"; final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - ResponseBase res - = service.listQueuesSegmentSync(this.client.getUrl(), comp, prefix, marker, maxresults, - includeConverted, timeout, this.client.getVersion(), requestId, accept, context); + Response res = service.getQueuesSync(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + getValues(res.getValue(), "Queues"), null, null); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueuesSegment(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId) { - return new PagedIterable<>( - () -> listQueuesSegmentSinglePage(prefix, marker, maxresults, include, timeout, requestId), - nextLink -> listQueuesSegmentNextSinglePage(nextLink, requestId)); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service as paginated response with - * {@link PagedIterable}. + * Returns a list of queues. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only queues whose name begins with + * the specified prefix.
markerStringNoIdentifies the portion of the list of queues to be returned with + * the next listing operation. The operation + * returns the marker value if the listing operation did not return all queues remaining. The marker 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.
maxresultsIntegerNoSpecifies the maximum number of queues to return. If the + * request does not specify maxresults, or specifies + * a value greater than 5000, the server will return up to 5000 items.
timeoutIntegerNoThe timeout parameter is expressed in seconds. For more + * information, see + * <a + * href="https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations">Setting + * Timeouts for Queue Service Operations.</a>
includeList<String>NoSpecify to include additional, optional + * information. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Name: String (Required)
+     *     Metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list queues response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueuesSegment(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId, Context context) { - return new PagedIterable<>( - () -> listQueuesSegmentSinglePage(prefix, marker, maxresults, include, timeout, requestId, context), - nextLink -> listQueuesSegmentNextSinglePage(nextLink, requestId, context)); + public PagedIterable getQueues(RequestOptions requestOptions) { + return new PagedIterable<>(() -> getQueuesSinglePage(requestOptions)); } - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listQueuesSegmentNoCustomHeadersSinglePage(String prefix, String marker, - Integer maxresults, List include, Integer timeout, String requestId) { + private List getValues(BinaryData binaryData, String path) { try { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - Response res - = service.listQueuesSegmentNoCustomHeadersSync(this.client.getUrl(), comp, prefix, marker, maxresults, - includeConverted, timeout, this.client.getVersion(), requestId, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listQueuesSegmentNoCustomHeadersSinglePage(String prefix, String marker, - Integer maxresults, List include, Integer timeout, String requestId, Context context) { + private String getNextLink(BinaryData binaryData, String path) { try { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - Response res - = service.listQueuesSegmentNoCustomHeadersSync(this.client.getUrl(), comp, prefix, marker, maxresults, - includeConverted, timeout, this.client.getVersion(), requestId, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } } - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueuesSegmentNoCustomHeaders(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId) { - return new PagedIterable<>( - () -> listQueuesSegmentNoCustomHeadersSinglePage(prefix, marker, maxresults, include, timeout, requestId), - nextLink -> listQueuesSegmentNextSinglePage(nextLink, requestId)); - } - - /** - * The List Queues Segment operation returns a list of the queues under the specified account. - * - * @param prefix Filters the results to return only queues whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of queues 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 queues 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 queues 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 include Include this parameter to specify that the queues' metadata be returned as part of the response - * body. - * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a - * href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting - * Timeouts for Queue Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueuesSegmentNoCustomHeaders(String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId, Context context) { - return new PagedIterable<>(() -> listQueuesSegmentNoCustomHeadersSinglePage(prefix, marker, maxresults, include, - timeout, requestId, context), nextLink -> listQueuesSegmentNextSinglePage(nextLink, requestId, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listQueuesSegmentNextSinglePageAsync(String nextLink, String requestId) { - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.listQueuesSegmentNext(nextLink, this.client.getUrl(), - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listQueuesSegmentNextSinglePageAsync(String nextLink, String requestId, - Context context) { - final String accept = "application/xml"; - return service - .listQueuesSegmentNext(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listQueuesSegmentNextNoCustomHeadersSinglePageAsync(String nextLink, - String requestId) { + public Mono> getQueuesWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; return FluxUtil - .withContext(context -> service.listQueuesSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listQueuesSegmentNextNoCustomHeadersSinglePageAsync(String nextLink, - String requestId, Context context) { - final String accept = "application/xml"; - return service - .listQueuesSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, - accept, context) - .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listQueuesSegmentNextSinglePage(String nextLink, String requestId) { - try { - final String accept = "application/xml"; - ResponseBase res - = service.listQueuesSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, - accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listQueuesSegmentNextSinglePage(String nextLink, String requestId, - Context context) { - try { - final String accept = "application/xml"; - ResponseBase res - = service.listQueuesSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, - accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @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 QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listQueuesSegmentNextNoCustomHeadersSinglePage(String nextLink, String requestId) { - try { - final String accept = "application/xml"; - Response res = service.listQueuesSegmentNextNoCustomHeadersSync(nextLink, - this.client.getUrl(), this.client.getVersion(), requestId, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } + .withContext(context -> service.getQueues(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws QueueStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object returned when calling List Queues on a Queue Service along with {@link PagedResponse}. - */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listQueuesSegmentNextNoCustomHeadersSinglePage(String nextLink, String requestId, - Context context) { + public Response getQueuesWithResponse(RequestOptions requestOptions) { try { final String accept = "application/xml"; - Response res = service.listQueuesSegmentNextNoCustomHeadersSync(nextLink, - this.client.getUrl(), this.client.getVersion(), requestId, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + return service.getQueuesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java index 23bee3d2d266..32ba77103eb9 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java @@ -1,95 +1,89 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.implementation.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; import com.azure.xml.XmlWriter; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; /** - * Key information. + * Key information for user delegation key. */ @Fluent public final class KeyInfo implements XmlSerializable { + /* - * The date-time the key is active in ISO 8601 UTC time + * The date-time the key is active in ISO 8601 UTC time. */ @Generated - private String start; + private OffsetDateTime start; /* - * The date-time the key expires in ISO 8601 UTC time + * The date-time the key expires in ISO 8601 UTC time. */ @Generated - private String expiry; + private final OffsetDateTime expiry; /* - * The delegated user tenant id in Azure AD + * The delegated user tenant ID in Entra ID. */ @Generated private String delegatedUserTenantId; /** * Creates an instance of KeyInfo class. + * + * @param expiry the expiry value to set. */ @Generated - public KeyInfo() { + public KeyInfo(OffsetDateTime expiry) { + this.expiry = expiry; } /** * Get the start property: The date-time the key is active in ISO 8601 UTC time. - * + * * @return the start value. */ @Generated - public String getStart() { + public OffsetDateTime getStart() { return this.start; } /** * Set the start property: The date-time the key is active in ISO 8601 UTC time. - * + * * @param start the start value to set. * @return the KeyInfo object itself. */ @Generated - public KeyInfo setStart(String start) { + public KeyInfo setStart(OffsetDateTime start) { this.start = start; return this; } /** * Get the expiry property: The date-time the key expires in ISO 8601 UTC time. - * + * * @return the expiry value. */ @Generated - public String getExpiry() { + public OffsetDateTime getExpiry() { return this.expiry; } /** - * Set the expiry property: The date-time the key expires in ISO 8601 UTC time. - * - * @param expiry the expiry value to set. - * @return the KeyInfo object itself. - */ - @Generated - public KeyInfo setExpiry(String expiry) { - this.expiry = expiry; - return this; - } - - /** - * Get the delegatedUserTenantId property: The delegated user tenant id in Azure AD. - * + * Get the delegatedUserTenantId property: The delegated user tenant ID in Entra ID. + * * @return the delegatedUserTenantId value. */ @Generated @@ -98,8 +92,8 @@ public String getDelegatedUserTenantId() { } /** - * Set the delegatedUserTenantId property: The delegated user tenant id in Azure AD. - * + * Set the delegatedUserTenantId property: The delegated user tenant ID in Entra ID. + * * @param delegatedUserTenantId the delegatedUserTenantId value to set. * @return the KeyInfo object itself. */ @@ -120,18 +114,21 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { rootElementName = rootElementName == null || rootElementName.isEmpty() ? "KeyInfo" : rootElementName; xmlWriter.writeStartElement(rootElementName); - xmlWriter.writeStringElement("Start", this.start); - xmlWriter.writeStringElement("Expiry", this.expiry); + xmlWriter.writeStringElement("Start", + this.start == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.start)); + xmlWriter.writeStringElement("Expiry", + this.expiry == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiry)); xmlWriter.writeStringElement("DelegatedUserTid", this.delegatedUserTenantId); return xmlWriter.writeEndElement(); } /** * Reads an instance of KeyInfo from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of KeyInfo if the XmlReader was pointing to an instance of it, or null if it was pointing to * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the KeyInfo. */ @Generated @@ -141,12 +138,13 @@ public static KeyInfo fromXml(XmlReader xmlReader) throws XMLStreamException { /** * Reads an instance of KeyInfo from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of KeyInfo if the XmlReader was pointing to an instance of it, or null if it was pointing to * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the KeyInfo. */ @Generated @@ -154,21 +152,24 @@ public static KeyInfo fromXml(XmlReader xmlReader, String rootElementName) throw String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "KeyInfo" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - KeyInfo deserializedKeyInfo = new KeyInfo(); + OffsetDateTime start = null; + OffsetDateTime expiry = null; + String delegatedUserTenantId = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Start".equals(elementName.getLocalPart())) { - deserializedKeyInfo.start = reader.getStringElement(); + start = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("Expiry".equals(elementName.getLocalPart())) { - deserializedKeyInfo.expiry = reader.getStringElement(); + expiry = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("DelegatedUserTid".equals(elementName.getLocalPart())) { - deserializedKeyInfo.delegatedUserTenantId = reader.getStringElement(); + delegatedUserTenantId = reader.getStringElement(); } else { reader.skipElement(); } } - + KeyInfo deserializedKeyInfo = new KeyInfo(expiry); + deserializedKeyInfo.start = start; + deserializedKeyInfo.delegatedUserTenantId = delegatedUserTenantId; return deserializedKeyInfo; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java new file mode 100644 index 000000000000..ea2dad5dedf7 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.storage.queue.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.storage.queue.models.SendMessageResult; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * The response of send message. + */ +@Immutable +public final class ListOfSentMessage implements XmlSerializable { + + /* + * The list of sent messages. + */ + @Generated + private final List items; + + /** + * Creates an instance of ListOfSentMessage class. + * + * @param items the items value to set. + */ + @Generated + private ListOfSentMessage(List items) { + this.items = items; + } + + /** + * Get the items property: The list of sent messages. + * + * @return the items value. + */ + @Generated + public List getItems() { + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + for (SendMessageResult element : this.items) { + xmlWriter.writeXml(element, "QueueMessage"); + } + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ListOfSentMessage from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ListOfSentMessage if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ListOfSentMessage. + */ + @Generated + public static ListOfSentMessage fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ListOfSentMessage from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ListOfSentMessage if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ListOfSentMessage. + */ + @Generated + public static ListOfSentMessage fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + if ("QueueMessage".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SendMessageResult.fromXml(reader, "QueueMessage")); + } else { + reader.skipElement(); + } + } + return new ListOfSentMessage(items); + }); + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListQueuesIncludeType.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListQueuesIncludeType.java new file mode 100644 index 000000000000..09ec5a5cc0ff --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListQueuesIncludeType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.storage.queue.implementation.models; + +/** + * Specify to include additional, optional information. + */ +public enum ListQueuesIncludeType { + /** + * Include queue metadata. + */ + METADATA("metadata"); + + /** + * The actual serialized value for a ListQueuesIncludeType instance. + */ + private final String value; + + ListQueuesIncludeType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ListQueuesIncludeType instance. + * + * @param value the serialized value to parse. + * @return the parsed ListQueuesIncludeType object, or null if unable to parse. + */ + public static ListQueuesIncludeType fromString(String value) { + if (value == null) { + return null; + } + ListQueuesIncludeType[] items = ListQueuesIncludeType.values(); + for (ListQueuesIncludeType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java index 8b46a2c57961..50791009388c 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.implementation.models; -import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.azure.core.util.DateTimeRfc1123; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; @@ -17,50 +16,71 @@ import javax.xml.stream.XMLStreamException; /** - * The object returned in the QueueMessageList array when calling Peek Messages on a Queue. + * The peeked queue message. */ -@Fluent +@Immutable public final class PeekedMessageItemInternal implements XmlSerializable { + /* - * The Id of the Message. + * The ID of the message. */ @Generated - private String messageId; + private final String messageId; /* - * The time the Message was inserted into the Queue. + * The time the message was inserted into the queue. */ @Generated - private DateTimeRfc1123 insertionTime; + private final DateTimeRfc1123 insertionTime; /* - * The time that the Message will expire and be automatically deleted. + * The time that the message will expire and be automatically deleted. */ @Generated - private DateTimeRfc1123 expirationTime; + private final DateTimeRfc1123 expirationTime; /* * The number of times the message has been dequeued. */ @Generated - private long dequeueCount; + private final long dequeueCount; /* - * The content of the Message. + * The content of the message. */ @Generated - private String messageText; + private final String messageText; /** * Creates an instance of PeekedMessageItemInternal class. + * + * @param messageId the messageId value to set. + * @param insertionTime the insertionTime value to set. + * @param expirationTime the expirationTime value to set. + * @param dequeueCount the dequeueCount value to set. + * @param messageText the messageText value to set. */ @Generated - public PeekedMessageItemInternal() { + private PeekedMessageItemInternal(String messageId, OffsetDateTime insertionTime, OffsetDateTime expirationTime, + long dequeueCount, String messageText) { + this.messageId = messageId; + if (insertionTime == null) { + this.insertionTime = null; + } else { + this.insertionTime = new DateTimeRfc1123(insertionTime); + } + if (expirationTime == null) { + this.expirationTime = null; + } else { + this.expirationTime = new DateTimeRfc1123(expirationTime); + } + this.dequeueCount = dequeueCount; + this.messageText = messageText; } /** - * Get the messageId property: The Id of the Message. - * + * Get the messageId property: The ID of the message. + * * @return the messageId value. */ @Generated @@ -69,20 +89,8 @@ public String getMessageId() { } /** - * Set the messageId property: The Id of the Message. - * - * @param messageId the messageId value to set. - * @return the PeekedMessageItemInternal object itself. - */ - @Generated - public PeekedMessageItemInternal setMessageId(String messageId) { - this.messageId = messageId; - return this; - } - - /** - * Get the insertionTime property: The time the Message was inserted into the Queue. - * + * Get the insertionTime property: The time the message was inserted into the queue. + * * @return the insertionTime value. */ @Generated @@ -94,24 +102,8 @@ public OffsetDateTime getInsertionTime() { } /** - * Set the insertionTime property: The time the Message was inserted into the Queue. - * - * @param insertionTime the insertionTime value to set. - * @return the PeekedMessageItemInternal object itself. - */ - @Generated - public PeekedMessageItemInternal setInsertionTime(OffsetDateTime insertionTime) { - if (insertionTime == null) { - this.insertionTime = null; - } else { - this.insertionTime = new DateTimeRfc1123(insertionTime); - } - return this; - } - - /** - * Get the expirationTime property: The time that the Message will expire and be automatically deleted. - * + * Get the expirationTime property: The time that the message will expire and be automatically deleted. + * * @return the expirationTime value. */ @Generated @@ -122,25 +114,9 @@ public OffsetDateTime getExpirationTime() { return this.expirationTime.getDateTime(); } - /** - * Set the expirationTime property: The time that the Message will expire and be automatically deleted. - * - * @param expirationTime the expirationTime value to set. - * @return the PeekedMessageItemInternal object itself. - */ - @Generated - public PeekedMessageItemInternal setExpirationTime(OffsetDateTime expirationTime) { - if (expirationTime == null) { - this.expirationTime = null; - } else { - this.expirationTime = new DateTimeRfc1123(expirationTime); - } - return this; - } - /** * Get the dequeueCount property: The number of times the message has been dequeued. - * + * * @return the dequeueCount value. */ @Generated @@ -149,20 +125,8 @@ public long getDequeueCount() { } /** - * Set the dequeueCount property: The number of times the message has been dequeued. - * - * @param dequeueCount the dequeueCount value to set. - * @return the PeekedMessageItemInternal object itself. - */ - @Generated - public PeekedMessageItemInternal setDequeueCount(long dequeueCount) { - this.dequeueCount = dequeueCount; - return this; - } - - /** - * Get the messageText property: The content of the Message. - * + * Get the messageText property: The content of the message. + * * @return the messageText value. */ @Generated @@ -170,18 +134,6 @@ public String getMessageText() { return this.messageText; } - /** - * Set the messageText property: The content of the Message. - * - * @param messageText the messageText value to set. - * @return the PeekedMessageItemInternal object itself. - */ - @Generated - public PeekedMessageItemInternal setMessageText(String messageText) { - this.messageText = messageText; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -203,10 +155,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of PeekedMessageItemInternal from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of PeekedMessageItemInternal if the XmlReader was pointing to an instance of it, or null if * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the PeekedMessageItemInternal. */ @Generated @@ -216,12 +169,13 @@ public static PeekedMessageItemInternal fromXml(XmlReader xmlReader) throws XMLS /** * Reads an instance of PeekedMessageItemInternal from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of PeekedMessageItemInternal if the XmlReader was pointing to an instance of it, or null if * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the PeekedMessageItemInternal. */ @Generated @@ -230,28 +184,34 @@ public static PeekedMessageItemInternal fromXml(XmlReader xmlReader, String root String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessage" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - PeekedMessageItemInternal deserializedPeekedMessageItemInternal = new PeekedMessageItemInternal(); + String messageId = null; + OffsetDateTime insertionTime = null; + OffsetDateTime expirationTime = null; + long dequeueCount = 0L; + String messageText = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("MessageId".equals(elementName.getLocalPart())) { - deserializedPeekedMessageItemInternal.messageId = reader.getStringElement(); + messageId = reader.getStringElement(); } else if ("InsertionTime".equals(elementName.getLocalPart())) { - deserializedPeekedMessageItemInternal.insertionTime - = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 insertionTimeHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (insertionTimeHolder != null) { + insertionTime = insertionTimeHolder.getDateTime(); + } } else if ("ExpirationTime".equals(elementName.getLocalPart())) { - deserializedPeekedMessageItemInternal.expirationTime - = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 expirationTimeHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (expirationTimeHolder != null) { + expirationTime = expirationTimeHolder.getDateTime(); + } } else if ("DequeueCount".equals(elementName.getLocalPart())) { - deserializedPeekedMessageItemInternal.dequeueCount = reader.getLongElement(); + dequeueCount = reader.getLongElement(); } else if ("MessageText".equals(elementName.getLocalPart())) { - deserializedPeekedMessageItemInternal.messageText = reader.getStringElement(); + messageText = reader.getStringElement(); } else { reader.skipElement(); } } - - return deserializedPeekedMessageItemInternal; + return new PeekedMessageItemInternal(messageId, insertionTime, expirationTime, dequeueCount, messageText); }); } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java new file mode 100644 index 000000000000..c56803f6fb7f --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.storage.queue.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * The response of peek messages. + */ +@Immutable +public final class PeekedMessages implements XmlSerializable { + + /* + * The list of peeked messages. + */ + @Generated + private final List items; + + /** + * Creates an instance of PeekedMessages class. + * + * @param items the items value to set. + */ + @Generated + private PeekedMessages(List items) { + this.items = items; + } + + /** + * Get the items property: The list of peeked messages. + * + * @return the items value. + */ + @Generated + public List getItems() { + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + for (PeekedMessageItemInternal element : this.items) { + xmlWriter.writeXml(element, "QueueMessage"); + } + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of PeekedMessages from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of PeekedMessages if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the PeekedMessages. + */ + @Generated + public static PeekedMessages fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of PeekedMessages from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of PeekedMessages if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the PeekedMessages. + */ + @Generated + public static PeekedMessages fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + if ("QueueMessage".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(PeekedMessageItemInternal.fromXml(reader, "QueueMessage")); + } else { + reader.skipElement(); + } + } + return new PeekedMessages(items); + }); + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessage.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessage.java index 8dd364c11d54..cb89de0f4f4f 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessage.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessage.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.implementation.models; -import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; @@ -14,26 +13,30 @@ import javax.xml.stream.XMLStreamException; /** - * A Message object which can be stored in a Queue. + * The queue message. */ -@Fluent +@Immutable public final class QueueMessage implements XmlSerializable { + /* - * The content of the message + * The content of the message. */ @Generated - private String messageText; + private final String messageText; /** * Creates an instance of QueueMessage class. + * + * @param messageText the messageText value to set. */ @Generated - public QueueMessage() { + public QueueMessage(String messageText) { + this.messageText = messageText; } /** * Get the messageText property: The content of the message. - * + * * @return the messageText value. */ @Generated @@ -41,18 +44,6 @@ public String getMessageText() { return this.messageText; } - /** - * Set the messageText property: The content of the message. - * - * @param messageText the messageText value to set. - * @return the QueueMessage object itself. - */ - @Generated - public QueueMessage setMessageText(String messageText) { - this.messageText = messageText; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -70,10 +61,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueMessage from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueMessage if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueMessage. */ @Generated @@ -83,12 +75,13 @@ public static QueueMessage fromXml(XmlReader xmlReader) throws XMLStreamExceptio /** * Reads an instance of QueueMessage from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of QueueMessage if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueMessage. */ @Generated @@ -96,18 +89,16 @@ public static QueueMessage fromXml(XmlReader xmlReader, String rootElementName) String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessage" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - QueueMessage deserializedQueueMessage = new QueueMessage(); + String messageText = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("MessageText".equals(elementName.getLocalPart())) { - deserializedQueueMessage.messageText = reader.getStringElement(); + messageText = reader.getStringElement(); } else { reader.skipElement(); } } - - return deserializedQueueMessage; + return new QueueMessage(messageText); }); } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java index acd34c0e8e2b..57d6feb08634 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.implementation.models; -import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.azure.core.util.DateTimeRfc1123; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; @@ -17,63 +16,92 @@ import javax.xml.stream.XMLStreamException; /** - * The object returned in the QueueMessageList array when calling Get Messages on a Queue. + * The received queue message. */ -@Fluent +@Immutable public final class QueueMessageItemInternal implements XmlSerializable { + /* - * The Id of the Message. + * The ID of the message. */ @Generated - private String messageId; + private final String messageId; /* - * The time the Message was inserted into the Queue. + * The time the message was inserted into the queue. */ @Generated - private DateTimeRfc1123 insertionTime; + private final DateTimeRfc1123 insertionTime; /* - * The time that the Message will expire and be automatically deleted. + * The time that the message will expire and be automatically deleted. */ @Generated - private DateTimeRfc1123 expirationTime; + private final DateTimeRfc1123 expirationTime; /* - * This value is required to delete the Message. If deletion fails using this popreceipt then the message has been - * dequeued by another client. + * An opaque value required to delete the message. If deletion fails using this + * PopReceipt then the message has been dequeued by another client. */ @Generated - private String popReceipt; + private final String popReceipt; /* - * The time that the message will again become visible in the Queue. + * The time that the message will again become visible in the queue. */ @Generated - private DateTimeRfc1123 timeNextVisible; + private final DateTimeRfc1123 timeNextVisible; /* * The number of times the message has been dequeued. */ @Generated - private long dequeueCount; + private final long dequeueCount; /* - * The content of the Message. + * The content of the message. */ @Generated - private String messageText; + private final String messageText; /** * Creates an instance of QueueMessageItemInternal class. + * + * @param messageId the messageId value to set. + * @param insertionTime the insertionTime value to set. + * @param expirationTime the expirationTime value to set. + * @param popReceipt the popReceipt value to set. + * @param timeNextVisible the timeNextVisible value to set. + * @param dequeueCount the dequeueCount value to set. + * @param messageText the messageText value to set. */ @Generated - public QueueMessageItemInternal() { + private QueueMessageItemInternal(String messageId, OffsetDateTime insertionTime, OffsetDateTime expirationTime, + String popReceipt, OffsetDateTime timeNextVisible, long dequeueCount, String messageText) { + this.messageId = messageId; + if (insertionTime == null) { + this.insertionTime = null; + } else { + this.insertionTime = new DateTimeRfc1123(insertionTime); + } + if (expirationTime == null) { + this.expirationTime = null; + } else { + this.expirationTime = new DateTimeRfc1123(expirationTime); + } + this.popReceipt = popReceipt; + if (timeNextVisible == null) { + this.timeNextVisible = null; + } else { + this.timeNextVisible = new DateTimeRfc1123(timeNextVisible); + } + this.dequeueCount = dequeueCount; + this.messageText = messageText; } /** - * Get the messageId property: The Id of the Message. - * + * Get the messageId property: The ID of the message. + * * @return the messageId value. */ @Generated @@ -82,20 +110,8 @@ public String getMessageId() { } /** - * Set the messageId property: The Id of the Message. - * - * @param messageId the messageId value to set. - * @return the QueueMessageItemInternal object itself. - */ - @Generated - public QueueMessageItemInternal setMessageId(String messageId) { - this.messageId = messageId; - return this; - } - - /** - * Get the insertionTime property: The time the Message was inserted into the Queue. - * + * Get the insertionTime property: The time the message was inserted into the queue. + * * @return the insertionTime value. */ @Generated @@ -107,24 +123,8 @@ public OffsetDateTime getInsertionTime() { } /** - * Set the insertionTime property: The time the Message was inserted into the Queue. - * - * @param insertionTime the insertionTime value to set. - * @return the QueueMessageItemInternal object itself. - */ - @Generated - public QueueMessageItemInternal setInsertionTime(OffsetDateTime insertionTime) { - if (insertionTime == null) { - this.insertionTime = null; - } else { - this.insertionTime = new DateTimeRfc1123(insertionTime); - } - return this; - } - - /** - * Get the expirationTime property: The time that the Message will expire and be automatically deleted. - * + * Get the expirationTime property: The time that the message will expire and be automatically deleted. + * * @return the expirationTime value. */ @Generated @@ -136,25 +136,9 @@ public OffsetDateTime getExpirationTime() { } /** - * Set the expirationTime property: The time that the Message will expire and be automatically deleted. - * - * @param expirationTime the expirationTime value to set. - * @return the QueueMessageItemInternal object itself. - */ - @Generated - public QueueMessageItemInternal setExpirationTime(OffsetDateTime expirationTime) { - if (expirationTime == null) { - this.expirationTime = null; - } else { - this.expirationTime = new DateTimeRfc1123(expirationTime); - } - return this; - } - - /** - * Get the popReceipt property: This value is required to delete the Message. If deletion fails using this - * popreceipt then the message has been dequeued by another client. - * + * Get the popReceipt property: An opaque value required to delete the message. If deletion fails using this + * PopReceipt then the message has been dequeued by another client. + * * @return the popReceipt value. */ @Generated @@ -163,21 +147,8 @@ public String getPopReceipt() { } /** - * Set the popReceipt property: This value is required to delete the Message. If deletion fails using this - * popreceipt then the message has been dequeued by another client. - * - * @param popReceipt the popReceipt value to set. - * @return the QueueMessageItemInternal object itself. - */ - @Generated - public QueueMessageItemInternal setPopReceipt(String popReceipt) { - this.popReceipt = popReceipt; - return this; - } - - /** - * Get the timeNextVisible property: The time that the message will again become visible in the Queue. - * + * Get the timeNextVisible property: The time that the message will again become visible in the queue. + * * @return the timeNextVisible value. */ @Generated @@ -188,25 +159,9 @@ public OffsetDateTime getTimeNextVisible() { return this.timeNextVisible.getDateTime(); } - /** - * Set the timeNextVisible property: The time that the message will again become visible in the Queue. - * - * @param timeNextVisible the timeNextVisible value to set. - * @return the QueueMessageItemInternal object itself. - */ - @Generated - public QueueMessageItemInternal setTimeNextVisible(OffsetDateTime timeNextVisible) { - if (timeNextVisible == null) { - this.timeNextVisible = null; - } else { - this.timeNextVisible = new DateTimeRfc1123(timeNextVisible); - } - return this; - } - /** * Get the dequeueCount property: The number of times the message has been dequeued. - * + * * @return the dequeueCount value. */ @Generated @@ -215,20 +170,8 @@ public long getDequeueCount() { } /** - * Set the dequeueCount property: The number of times the message has been dequeued. - * - * @param dequeueCount the dequeueCount value to set. - * @return the QueueMessageItemInternal object itself. - */ - @Generated - public QueueMessageItemInternal setDequeueCount(long dequeueCount) { - this.dequeueCount = dequeueCount; - return this; - } - - /** - * Get the messageText property: The content of the Message. - * + * Get the messageText property: The content of the message. + * * @return the messageText value. */ @Generated @@ -236,18 +179,6 @@ public String getMessageText() { return this.messageText; } - /** - * Set the messageText property: The content of the Message. - * - * @param messageText the messageText value to set. - * @return the QueueMessageItemInternal object itself. - */ - @Generated - public QueueMessageItemInternal setMessageText(String messageText) { - this.messageText = messageText; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -271,10 +202,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueMessageItemInternal from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueMessageItemInternal if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueMessageItemInternal. */ @Generated @@ -284,12 +216,13 @@ public static QueueMessageItemInternal fromXml(XmlReader xmlReader) throws XMLSt /** * Reads an instance of QueueMessageItemInternal from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of QueueMessageItemInternal if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueMessageItemInternal. */ @Generated @@ -298,33 +231,44 @@ public static QueueMessageItemInternal fromXml(XmlReader xmlReader, String rootE String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessage" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - QueueMessageItemInternal deserializedQueueMessageItemInternal = new QueueMessageItemInternal(); + String messageId = null; + OffsetDateTime insertionTime = null; + OffsetDateTime expirationTime = null; + String popReceipt = null; + OffsetDateTime timeNextVisible = null; + long dequeueCount = 0L; + String messageText = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("MessageId".equals(elementName.getLocalPart())) { - deserializedQueueMessageItemInternal.messageId = reader.getStringElement(); + messageId = reader.getStringElement(); } else if ("InsertionTime".equals(elementName.getLocalPart())) { - deserializedQueueMessageItemInternal.insertionTime - = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 insertionTimeHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (insertionTimeHolder != null) { + insertionTime = insertionTimeHolder.getDateTime(); + } } else if ("ExpirationTime".equals(elementName.getLocalPart())) { - deserializedQueueMessageItemInternal.expirationTime - = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 expirationTimeHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (expirationTimeHolder != null) { + expirationTime = expirationTimeHolder.getDateTime(); + } } else if ("PopReceipt".equals(elementName.getLocalPart())) { - deserializedQueueMessageItemInternal.popReceipt = reader.getStringElement(); + popReceipt = reader.getStringElement(); } else if ("TimeNextVisible".equals(elementName.getLocalPart())) { - deserializedQueueMessageItemInternal.timeNextVisible - = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 timeNextVisibleHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (timeNextVisibleHolder != null) { + timeNextVisible = timeNextVisibleHolder.getDateTime(); + } } else if ("DequeueCount".equals(elementName.getLocalPart())) { - deserializedQueueMessageItemInternal.dequeueCount = reader.getLongElement(); + dequeueCount = reader.getLongElement(); } else if ("MessageText".equals(elementName.getLocalPart())) { - deserializedQueueMessageItemInternal.messageText = reader.getStringElement(); + messageText = reader.getStringElement(); } else { reader.skipElement(); } } - - return deserializedQueueMessageItemInternal; + return new QueueMessageItemInternal(messageId, insertionTime, expirationTime, popReceipt, timeNextVisible, + dequeueCount, messageText); }); } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java new file mode 100644 index 000000000000..6b03fc98c969 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.storage.queue.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * The response of receive messages. + */ +@Immutable +public final class ReceivedMessages implements XmlSerializable { + + /* + * The list of received messages. + */ + @Generated + private final List items; + + /** + * Creates an instance of ReceivedMessages class. + * + * @param items the items value to set. + */ + @Generated + private ReceivedMessages(List items) { + this.items = items; + } + + /** + * Get the items property: The list of received messages. + * + * @return the items value. + */ + @Generated + public List getItems() { + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + for (QueueMessageItemInternal element : this.items) { + xmlWriter.writeXml(element, "QueueMessage"); + } + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ReceivedMessages from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ReceivedMessages if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ReceivedMessages. + */ + @Generated + public static ReceivedMessages fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ReceivedMessages from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ReceivedMessages if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ReceivedMessages. + */ + @Generated + public static ReceivedMessages fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + if ("QueueMessage".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(QueueMessageItemInternal.fromXml(reader, "QueueMessage")); + } else { + reader.skipElement(); + } + } + return new ReceivedMessages(items); + }); + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java new file mode 100644 index 000000000000..a1d584d78983 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.storage.queue.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.storage.queue.models.QueueSignedIdentifier; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * An array of signed identifiers. + */ +@Immutable +public final class SignedIdentifiers implements XmlSerializable { + + /* + * The list of signed identifiers. + */ + @Generated + private final List items; + + /** + * Creates an instance of SignedIdentifiers class. + * + * @param items the items value to set. + */ + @Generated + public SignedIdentifiers(List items) { + this.items = items; + } + + /** + * Get the items property: The list of signed identifiers. + * + * @return the items value. + */ + @Generated + public List getItems() { + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "SignedIdentifiers" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + for (QueueSignedIdentifier element : this.items) { + xmlWriter.writeXml(element, "SignedIdentifier"); + } + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of SignedIdentifiers from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of SignedIdentifiers if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the SignedIdentifiers. + */ + @Generated + public static SignedIdentifiers fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of SignedIdentifiers from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of SignedIdentifiers if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the SignedIdentifiers. + */ + @Generated + public static SignedIdentifiers fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "SignedIdentifiers" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + if ("SignedIdentifier".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(QueueSignedIdentifier.fromXml(reader, "SignedIdentifier")); + } else { + reader.skipElement(); + } + } + return new SignedIdentifiers(items); + }); + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/package-info.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/package-info.java index afc0afd9d0b2..c58cac2f6f9c 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/package-info.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for AzureQueueStorage. - * null. + * + * Package containing the data models for Queues. + * */ package com.azure.storage.queue.implementation.models; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/package-info.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/package-info.java index 8be6c8e2dad7..b40fac6f4256 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/package-info.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/package-info.java @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for AzureQueueStorage. - * null. + * Package containing the implementations for Queues. */ package com.azure.storage.queue.implementation; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java index cb37ecda1cbf..94033767205e 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java @@ -3,20 +3,34 @@ package com.azure.storage.queue.implementation.util; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.queue.QueueMessageEncoding; +import com.azure.storage.queue.implementation.models.ListQueuesSegmentResponse; import com.azure.storage.queue.implementation.models.PeekedMessageItemInternal; import com.azure.storage.queue.implementation.models.QueueMessageItemInternal; import com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal; import com.azure.storage.queue.implementation.models.QueuesGetPropertiesHeaders; import com.azure.storage.queue.models.PeekedMessageItem; +import com.azure.storage.queue.models.QueueItem; import com.azure.storage.queue.models.QueueMessageItem; import com.azure.storage.queue.models.QueueProperties; import com.azure.storage.queue.models.QueueStorageException; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlWriter; +import javax.xml.stream.XMLStreamException; +import java.io.ByteArrayOutputStream; import java.util.Base64; +import java.util.Collections; +import java.util.List; import java.util.Objects; public class ModelHelper { @@ -107,4 +121,166 @@ public static QueueStorageException mapToQueueStorageException(QueueStorageExcep return new QueueStorageException(StorageImplUtils.convertStorageExceptionMessage(internal.getMessage(), internal.getResponse(), code, headerName), internal.getResponse(), internal.getValue()); } + + /** + * Creates a {@link RequestOptions} for a protocol call, threading the supplied {@link Context}. + *

+ * The generated implementation layer exposes protocol methods that accept a {@link RequestOptions}. The + * hand-written clients translate their typed parameters into query parameters, headers and a request body on the + * returned instance. Callers add operation-specific query parameters via + * {@link #addOptionalQueryParam(RequestOptions, String, Object)}. + * + * @param context The context to thread onto the request, may be {@code null}. + * @return A new {@link RequestOptions} carrying the context. + */ + public static RequestOptions requestOptions(Context context) { + RequestOptions requestOptions = new RequestOptions(); + if (context != null) { + requestOptions.setContext(context); + } + return requestOptions; + } + + /** + * Adds a query parameter to the {@link RequestOptions} only when {@code value} is non-null, mirroring the optional + * parameter semantics of the previous typed implementation methods. + * + * @param requestOptions The request options to mutate. + * @param name The wire query parameter name (as documented on the generated protocol method). + * @param value The value, or {@code null} to omit the parameter. + */ + public static void addOptionalQueryParam(RequestOptions requestOptions, String name, Object value) { + if (value != null) { + requestOptions.addQueryParam(name, String.valueOf(value)); + } + } + + /** + * Wire prefix for user-defined queue metadata headers. The generated protocol methods document a single + * {@code x-ms-meta} header collection; on the wire each entry is emitted as {@code x-ms-meta-}. + */ + private static final String METADATA_HEADER_PREFIX = "x-ms-meta-"; + + /** + * Translates a queue metadata map into {@code x-ms-meta-} request headers on the supplied + * {@link RequestOptions}. Replaces the {@code @HeaderCollection("x-ms-meta-")} binding the previous typed + * implementation methods carried; {@code create} and {@code setMetadata} both delegate here. + * + * @param requestOptions The request options to mutate. + * @param metadata The metadata to serialize, may be {@code null} or empty. + */ + public static void addMetadataHeaders(RequestOptions requestOptions, java.util.Map metadata) { + if (metadata != null) { + for (java.util.Map.Entry entry : metadata.entrySet()) { + requestOptions.addHeader(METADATA_HEADER_PREFIX + entry.getKey(), entry.getValue()); + } + } + } + + /** + * Serializes an {@link XmlSerializable} request body into XML {@link BinaryData} for the protocol layer. + * + * @param value The value to serialize, may be {@code null}. + * @return The XML-encoded {@link BinaryData}, or {@code null} if {@code value} is {@code null}. + */ + public static BinaryData serializeXmlBody(XmlSerializable value) { + if (value == null) { + return null; + } + try { + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + try (XmlWriter xmlWriter = XmlWriter.toStream(stream)) { + value.toXml(xmlWriter); + xmlWriter.flush(); + } + return BinaryData.fromBytes(stream.toByteArray()); + } catch (XMLStreamException e) { + throw LOGGER.logExceptionAsError(new RuntimeException(e)); + } + } + + /** + * Deserializes an XML {@link BinaryData} protocol response using the provided reader function. + * + * @param data The XML response body, may be {@code null}. + * @param deserializer The {@code fromXml} function of the target type. + * @param The deserialized type. + * @return The deserialized value, or {@code null} if {@code data} is {@code null}. + */ + public static T deserializeXmlBody(BinaryData data, XmlDeserializer deserializer) { + if (data == null) { + return null; + } + try (XmlReader xmlReader = XmlReader.fromBytes(data.toBytes())) { + return deserializer.deserialize(xmlReader); + } catch (XMLStreamException e) { + throw LOGGER.logExceptionAsError(new RuntimeException(e)); + } + } + + /** + * Builds the {@link RequestOptions} for a {@code List Queues} protocol call, translating the typed listing + * parameters into the wire query parameters documented on the generated {@code getQueuesWithResponse} accessor + * ({@code prefix}, {@code marker}, {@code maxresults}, {@code include}). The {@code include} values are sent as a + * single comma-separated query parameter, matching the previous typed implementation method. + * + * @param context The context to thread onto the request, may be {@code null}. + * @param prefix The queue name prefix filter, may be {@code null}. + * @param marker The continuation marker for the page to fetch, may be {@code null}. + * @param maxResults The maximum number of queues per page, may be {@code null}. + * @param include The optional listing details (e.g. {@code metadata}), may be {@code null} or empty. + * @return The configured {@link RequestOptions}. + */ + public static RequestOptions listQueuesRequestOptions(Context context, String prefix, String marker, + Integer maxResults, List include) { + RequestOptions requestOptions = requestOptions(context); + addOptionalQueryParam(requestOptions, "prefix", prefix); + addOptionalQueryParam(requestOptions, "marker", marker); + addOptionalQueryParam(requestOptions, "maxresults", maxResults); + // The AutoRest client serialized 'include' unconditionally (as a CSV collection query parameter), emitting an + // empty 'include=' when no include options were requested. Preserve that wire shape so the request matches the + // service contract (and recordings); an empty value is a no-op for the service. + requestOptions.addQueryParam("include", + (include == null || include.isEmpty()) ? "" : String.join(",", include)); + return requestOptions; + } + + /** + * Converts a raw {@code List Queues} protocol response into a {@link PagedResponse} of {@link QueueItem}, preserving + * the {@code NextMarker}-based continuation the hand-written paging depends on. + *

+ * The service returns an empty {@code NextMarker} element on the final page. {@link com.azure.core.http.rest.PagedFlux} + * / {@link com.azure.core.http.rest.PagedIterable} treat any non-null continuation token as "more pages available", + * so an empty marker is normalized to {@code null} to terminate paging (mirroring the {@code len(NextMarker) > 0} + * check the other language SDKs use). + * + * @param response The raw XML list response from {@code getQueuesWithResponse[Async]}. + * @return The page of queue items with the continuation token populated from {@code NextMarker}. + */ + public static PagedResponse toQueueItemPage(Response response) { + ListQueuesSegmentResponse body = deserializeXmlBody(response.getValue(), ListQueuesSegmentResponse::fromXml); + List items = (body == null) ? Collections.emptyList() : body.getQueueItems(); + String nextMarker = (body == null) ? null : body.getNextMarker(); + String continuationToken = (nextMarker == null || nextMarker.isEmpty()) ? null : nextMarker; + return new PagedResponseBase(response.getRequest(), response.getStatusCode(), + response.getHeaders(), items, continuationToken, null); + } + + /** + * Functional interface matching the generated {@code fromXml(XmlReader)} factory methods so protocol responses can + * be deserialized generically. + * + * @param The deserialized type. + */ + @FunctionalInterface + public interface XmlDeserializer { + /** + * Reads an instance of {@code T} from the supplied {@link XmlReader}. + * + * @param reader The XML reader positioned at the response body. + * @return The deserialized value. + * @throws XMLStreamException If the XML is malformed. + */ + T deserialize(XmlReader reader) throws XMLStreamException; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java index 467560aa819f..470d1f602fe7 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -17,19 +16,21 @@ import javax.xml.stream.XMLStreamException; /** - * The GeoReplication model. + * Geo replication information for the secondary storage location. */ @Fluent public final class GeoReplication implements XmlSerializable { + /* - * The status of the secondary location + * The status of the secondary location. */ @Generated private GeoReplicationStatus status; /* - * A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for - * read operations at the secondary. Primary writes after this point in time may or may not be available for reads. + * A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available + * for read operations at the secondary. Primary writes after this point in time may or may not be available + * for reads. */ @Generated private DateTimeRfc1123 lastSyncTime; @@ -43,7 +44,7 @@ public GeoReplication() { /** * Get the status property: The status of the secondary location. - * + * * @return the status value. */ @Generated @@ -53,7 +54,7 @@ public GeoReplicationStatus getStatus() { /** * Set the status property: The status of the secondary location. - * + * * @param status the status value to set. * @return the GeoReplication object itself. */ @@ -65,9 +66,10 @@ public GeoReplication setStatus(GeoReplicationStatus status) { /** * Get the lastSyncTime property: A GMT date/time value, to the second. All primary writes preceding this value are - * guaranteed to be available for read operations at the secondary. Primary writes after this point in time may or - * may not be available for reads. - * + * guaranteed to be available + * for read operations at the secondary. Primary writes after this point in time may or may not be available + * for reads. + * * @return the lastSyncTime value. */ @Generated @@ -80,9 +82,10 @@ public OffsetDateTime getLastSyncTime() { /** * Set the lastSyncTime property: A GMT date/time value, to the second. All primary writes preceding this value are - * guaranteed to be available for read operations at the secondary. Primary writes after this point in time may or - * may not be available for reads. - * + * guaranteed to be available + * for read operations at the secondary. Primary writes after this point in time may or may not be available + * for reads. + * * @param lastSyncTime the lastSyncTime value to set. * @return the GeoReplication object itself. */ @@ -114,10 +117,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of GeoReplication from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of GeoReplication if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the GeoReplication. */ @Generated @@ -127,12 +131,13 @@ public static GeoReplication fromXml(XmlReader xmlReader) throws XMLStreamExcept /** * Reads an instance of GeoReplication from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of GeoReplication if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the GeoReplication. */ @Generated @@ -140,19 +145,24 @@ public static GeoReplication fromXml(XmlReader xmlReader, String rootElementName String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "GeoReplication" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - GeoReplication deserializedGeoReplication = new GeoReplication(); + GeoReplicationStatus status = null; + OffsetDateTime lastSyncTime = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Status".equals(elementName.getLocalPart())) { - deserializedGeoReplication.status = GeoReplicationStatus.fromString(reader.getStringElement()); + status = GeoReplicationStatus.fromString(reader.getStringElement()); } else if ("LastSyncTime".equals(elementName.getLocalPart())) { - deserializedGeoReplication.lastSyncTime = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 lastSyncTimeHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (lastSyncTimeHolder != null) { + lastSyncTime = lastSyncTimeHolder.getDateTime(); + } } else { reader.skipElement(); } } - + GeoReplication deserializedGeoReplication = new GeoReplication(); + deserializedGeoReplication.status = status; + deserializedGeoReplication.lastSyncTime = lastSyncTime == null ? null : new DateTimeRfc1123(lastSyncTime); return deserializedGeoReplication; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java index 19b3566a8434..d763d599c1ac 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Generated; @@ -9,30 +8,31 @@ import java.util.Collection; /** - * The status of the secondary location. + * The geo replication status. */ public final class GeoReplicationStatus extends ExpandableStringEnum { + /** - * Static value live for GeoReplicationStatus. + * The geo replication is live. */ @Generated public static final GeoReplicationStatus LIVE = fromString("live"); /** - * Static value bootstrap for GeoReplicationStatus. + * The geo replication is bootstrap. */ @Generated public static final GeoReplicationStatus BOOTSTRAP = fromString("bootstrap"); /** - * Static value unavailable for GeoReplicationStatus. + * The geo replication is unavailable. */ @Generated public static final GeoReplicationStatus UNAVAILABLE = fromString("unavailable"); /** * Creates a new instance of GeoReplicationStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Generated @@ -42,7 +42,7 @@ public GeoReplicationStatus() { /** * Creates or finds a GeoReplicationStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding GeoReplicationStatus. */ @@ -53,7 +53,7 @@ public static GeoReplicationStatus fromString(String name) { /** * Gets known GeoReplicationStatus values. - * + * * @return known GeoReplicationStatus values. */ @Generated diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java index 21815734cacd..688f888b82b7 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java @@ -1,40 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.CoreUtils; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; import com.azure.xml.XmlWriter; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; /** - * An Access policy. + * The access policy. */ @Fluent public final class QueueAccessPolicy implements XmlSerializable { + /* - * the date-time the policy is active + * The date-time the policy is active. */ @Generated private OffsetDateTime startsOn; /* - * the date-time the policy expires + * The date-time the policy expires. */ @Generated private OffsetDateTime expiresOn; /* - * the permissions for the acl policy + * The permissions for the policy. */ @Generated private String permissions; @@ -47,8 +47,8 @@ public QueueAccessPolicy() { } /** - * Get the startsOn property: the date-time the policy is active. - * + * Get the startsOn property: The date-time the policy is active. + * * @return the startsOn value. */ @Generated @@ -57,8 +57,8 @@ public OffsetDateTime getStartsOn() { } /** - * Set the startsOn property: the date-time the policy is active. - * + * Set the startsOn property: The date-time the policy is active. + * * @param startsOn the startsOn value to set. * @return the QueueAccessPolicy object itself. */ @@ -69,8 +69,8 @@ public QueueAccessPolicy setStartsOn(OffsetDateTime startsOn) { } /** - * Get the expiresOn property: the date-time the policy expires. - * + * Get the expiresOn property: The date-time the policy expires. + * * @return the expiresOn value. */ @Generated @@ -79,8 +79,8 @@ public OffsetDateTime getExpiresOn() { } /** - * Set the expiresOn property: the date-time the policy expires. - * + * Set the expiresOn property: The date-time the policy expires. + * * @param expiresOn the expiresOn value to set. * @return the QueueAccessPolicy object itself. */ @@ -91,8 +91,8 @@ public QueueAccessPolicy setExpiresOn(OffsetDateTime expiresOn) { } /** - * Get the permissions property: the permissions for the acl policy. - * + * Get the permissions property: The permissions for the policy. + * * @return the permissions value. */ @Generated @@ -101,8 +101,8 @@ public String getPermissions() { } /** - * Set the permissions property: the permissions for the acl policy. - * + * Set the permissions property: The permissions for the policy. + * * @param permissions the permissions value to set. * @return the QueueAccessPolicy object itself. */ @@ -121,7 +121,7 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueAccessPolicy" : rootElementName; + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "AccessPolicy" : rootElementName; xmlWriter.writeStartElement(rootElementName); xmlWriter.writeStringElement("Start", this.startsOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startsOn)); @@ -133,7 +133,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueAccessPolicy from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueAccessPolicy if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. @@ -146,7 +146,7 @@ public static QueueAccessPolicy fromXml(XmlReader xmlReader) throws XMLStreamExc /** * Reads an instance of QueueAccessPolicy from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -157,12 +157,11 @@ public static QueueAccessPolicy fromXml(XmlReader xmlReader) throws XMLStreamExc @Generated public static QueueAccessPolicy fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueAccessPolicy" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "AccessPolicy" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { QueueAccessPolicy deserializedQueueAccessPolicy = new QueueAccessPolicy(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Start".equals(elementName.getLocalPart())) { deserializedQueueAccessPolicy.startsOn = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); @@ -175,7 +174,6 @@ public static QueueAccessPolicy fromXml(XmlReader xmlReader, String rootElementN reader.skipElement(); } } - return deserializedQueueAccessPolicy; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java index b7a71fb2f70e..cfb9b2cf98e6 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -18,32 +17,33 @@ */ @Fluent public final class QueueAnalyticsLogging implements XmlSerializable { + /* - * The version of Storage Analytics to configure. + * The version of the logging properties. */ @Generated private String version; /* - * Indicates whether all delete requests should be logged. + * Whether delete operation is logged. */ @Generated private boolean delete; /* - * Indicates whether all read requests should be logged. + * Whether read operation is logged. */ @Generated private boolean read; /* - * Indicates whether all write requests should be logged. + * Whether write operation is logged. */ @Generated private boolean write; /* - * the retention policy + * The retention policy of the logs. */ @Generated private QueueRetentionPolicy retentionPolicy; @@ -56,8 +56,8 @@ public QueueAnalyticsLogging() { } /** - * Get the version property: The version of Storage Analytics to configure. - * + * Get the version property: The version of the logging properties. + * * @return the version value. */ @Generated @@ -66,8 +66,8 @@ public String getVersion() { } /** - * Set the version property: The version of Storage Analytics to configure. - * + * Set the version property: The version of the logging properties. + * * @param version the version value to set. * @return the QueueAnalyticsLogging object itself. */ @@ -78,8 +78,8 @@ public QueueAnalyticsLogging setVersion(String version) { } /** - * Get the delete property: Indicates whether all delete requests should be logged. - * + * Get the delete property: Whether delete operation is logged. + * * @return the delete value. */ @Generated @@ -88,8 +88,8 @@ public boolean isDelete() { } /** - * Set the delete property: Indicates whether all delete requests should be logged. - * + * Set the delete property: Whether delete operation is logged. + * * @param delete the delete value to set. * @return the QueueAnalyticsLogging object itself. */ @@ -100,8 +100,8 @@ public QueueAnalyticsLogging setDelete(boolean delete) { } /** - * Get the read property: Indicates whether all read requests should be logged. - * + * Get the read property: Whether read operation is logged. + * * @return the read value. */ @Generated @@ -110,8 +110,8 @@ public boolean isRead() { } /** - * Set the read property: Indicates whether all read requests should be logged. - * + * Set the read property: Whether read operation is logged. + * * @param read the read value to set. * @return the QueueAnalyticsLogging object itself. */ @@ -122,8 +122,8 @@ public QueueAnalyticsLogging setRead(boolean read) { } /** - * Get the write property: Indicates whether all write requests should be logged. - * + * Get the write property: Whether write operation is logged. + * * @return the write value. */ @Generated @@ -132,8 +132,8 @@ public boolean isWrite() { } /** - * Set the write property: Indicates whether all write requests should be logged. - * + * Set the write property: Whether write operation is logged. + * * @param write the write value to set. * @return the QueueAnalyticsLogging object itself. */ @@ -144,8 +144,8 @@ public QueueAnalyticsLogging setWrite(boolean write) { } /** - * Get the retentionPolicy property: the retention policy. - * + * Get the retentionPolicy property: The retention policy of the logs. + * * @return the retentionPolicy value. */ @Generated @@ -154,8 +154,8 @@ public QueueRetentionPolicy getRetentionPolicy() { } /** - * Set the retentionPolicy property: the retention policy. - * + * Set the retentionPolicy property: The retention policy of the logs. + * * @param retentionPolicy the retentionPolicy value to set. * @return the QueueAnalyticsLogging object itself. */ @@ -174,8 +174,7 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueAnalyticsLogging" : rootElementName; + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "Logging" : rootElementName; xmlWriter.writeStartElement(rootElementName); xmlWriter.writeStringElement("Version", this.version); xmlWriter.writeBooleanElement("Delete", this.delete); @@ -187,10 +186,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueAnalyticsLogging from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueAnalyticsLogging if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueAnalyticsLogging. */ @Generated @@ -200,39 +200,47 @@ public static QueueAnalyticsLogging fromXml(XmlReader xmlReader) throws XMLStrea /** * Reads an instance of QueueAnalyticsLogging from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of QueueAnalyticsLogging if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueAnalyticsLogging. */ @Generated public static QueueAnalyticsLogging fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueAnalyticsLogging" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "Logging" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - QueueAnalyticsLogging deserializedQueueAnalyticsLogging = new QueueAnalyticsLogging(); + String version = null; + boolean delete = false; + boolean read = false; + boolean write = false; + QueueRetentionPolicy retentionPolicy = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Version".equals(elementName.getLocalPart())) { - deserializedQueueAnalyticsLogging.version = reader.getStringElement(); + version = reader.getStringElement(); } else if ("Delete".equals(elementName.getLocalPart())) { - deserializedQueueAnalyticsLogging.delete = reader.getBooleanElement(); + delete = reader.getBooleanElement(); } else if ("Read".equals(elementName.getLocalPart())) { - deserializedQueueAnalyticsLogging.read = reader.getBooleanElement(); + read = reader.getBooleanElement(); } else if ("Write".equals(elementName.getLocalPart())) { - deserializedQueueAnalyticsLogging.write = reader.getBooleanElement(); + write = reader.getBooleanElement(); } else if ("RetentionPolicy".equals(elementName.getLocalPart())) { - deserializedQueueAnalyticsLogging.retentionPolicy - = QueueRetentionPolicy.fromXml(reader, "RetentionPolicy"); + retentionPolicy = QueueRetentionPolicy.fromXml(reader, "RetentionPolicy"); } else { reader.skipElement(); } } - + QueueAnalyticsLogging deserializedQueueAnalyticsLogging = new QueueAnalyticsLogging(); + deserializedQueueAnalyticsLogging.version = version; + deserializedQueueAnalyticsLogging.delete = delete; + deserializedQueueAnalyticsLogging.read = read; + deserializedQueueAnalyticsLogging.write = write; + deserializedQueueAnalyticsLogging.retentionPolicy = retentionPolicy; return deserializedQueueAnalyticsLogging; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java index 0b719ffe0efe..92e5fa8533ad 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -14,43 +13,37 @@ import javax.xml.stream.XMLStreamException; /** - * CORS is an HTTP feature that enables a web application running under one domain to access resources in another - * domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from - * calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs - * in another domain. + * The CORS rules. */ @Fluent public final class QueueCorsRule implements XmlSerializable { + /* - * The origin domains that are permitted to make a request against the storage service via CORS. The origin domain - * is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with - * the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all - * origin domains to make requests via CORS. + * The allowed origins. */ @Generated private String allowedOrigins; /* - * The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated) + * The allowed methods. */ @Generated private String allowedMethods; /* - * the request headers that the origin domain may specify on the CORS request. + * The allowed headers. */ @Generated private String allowedHeaders; /* - * The response headers that may be sent in the response to the CORS request and exposed by the browser to the - * request issuer + * The exposed headers. */ @Generated private String exposedHeaders; /* - * The maximum amount time that a browser should cache the preflight OPTIONS request. + * The maximum age in seconds. */ @Generated private int maxAgeInSeconds; @@ -63,11 +56,8 @@ public QueueCorsRule() { } /** - * Get the allowedOrigins property: The origin domains that are permitted to make a request against the storage - * service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be - * an exact case-sensitive match with the origin that the user age sends to the service. You can also use the - * wildcard character '*' to allow all origin domains to make requests via CORS. - * + * Get the allowedOrigins property: The allowed origins. + * * @return the allowedOrigins value. */ @Generated @@ -76,11 +66,8 @@ public String getAllowedOrigins() { } /** - * Set the allowedOrigins property: The origin domains that are permitted to make a request against the storage - * service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be - * an exact case-sensitive match with the origin that the user age sends to the service. You can also use the - * wildcard character '*' to allow all origin domains to make requests via CORS. - * + * Set the allowedOrigins property: The allowed origins. + * * @param allowedOrigins the allowedOrigins value to set. * @return the QueueCorsRule object itself. */ @@ -91,9 +78,8 @@ public QueueCorsRule setAllowedOrigins(String allowedOrigins) { } /** - * Get the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS - * request. (comma separated). - * + * Get the allowedMethods property: The allowed methods. + * * @return the allowedMethods value. */ @Generated @@ -102,9 +88,8 @@ public String getAllowedMethods() { } /** - * Set the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS - * request. (comma separated). - * + * Set the allowedMethods property: The allowed methods. + * * @param allowedMethods the allowedMethods value to set. * @return the QueueCorsRule object itself. */ @@ -115,8 +100,8 @@ public QueueCorsRule setAllowedMethods(String allowedMethods) { } /** - * Get the allowedHeaders property: the request headers that the origin domain may specify on the CORS request. - * + * Get the allowedHeaders property: The allowed headers. + * * @return the allowedHeaders value. */ @Generated @@ -125,8 +110,8 @@ public String getAllowedHeaders() { } /** - * Set the allowedHeaders property: the request headers that the origin domain may specify on the CORS request. - * + * Set the allowedHeaders property: The allowed headers. + * * @param allowedHeaders the allowedHeaders value to set. * @return the QueueCorsRule object itself. */ @@ -137,9 +122,8 @@ public QueueCorsRule setAllowedHeaders(String allowedHeaders) { } /** - * Get the exposedHeaders property: The response headers that may be sent in the response to the CORS request and - * exposed by the browser to the request issuer. - * + * Get the exposedHeaders property: The exposed headers. + * * @return the exposedHeaders value. */ @Generated @@ -148,9 +132,8 @@ public String getExposedHeaders() { } /** - * Set the exposedHeaders property: The response headers that may be sent in the response to the CORS request and - * exposed by the browser to the request issuer. - * + * Set the exposedHeaders property: The exposed headers. + * * @param exposedHeaders the exposedHeaders value to set. * @return the QueueCorsRule object itself. */ @@ -161,9 +144,8 @@ public QueueCorsRule setExposedHeaders(String exposedHeaders) { } /** - * Get the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS - * request. - * + * Get the maxAgeInSeconds property: The maximum age in seconds. + * * @return the maxAgeInSeconds value. */ @Generated @@ -172,9 +154,8 @@ public int getMaxAgeInSeconds() { } /** - * Set the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS - * request. - * + * Set the maxAgeInSeconds property: The maximum age in seconds. + * * @param maxAgeInSeconds the maxAgeInSeconds value to set. * @return the QueueCorsRule object itself. */ @@ -205,10 +186,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueCorsRule from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueCorsRule if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueCorsRule. */ @Generated @@ -218,12 +200,13 @@ public static QueueCorsRule fromXml(XmlReader xmlReader) throws XMLStreamExcepti /** * Reads an instance of QueueCorsRule from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of QueueCorsRule if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueCorsRule. */ @Generated @@ -231,25 +214,33 @@ public static QueueCorsRule fromXml(XmlReader xmlReader, String rootElementName) String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "CorsRule" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - QueueCorsRule deserializedQueueCorsRule = new QueueCorsRule(); + String allowedOrigins = null; + String allowedMethods = null; + String allowedHeaders = null; + String exposedHeaders = null; + int maxAgeInSeconds = 0; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("AllowedOrigins".equals(elementName.getLocalPart())) { - deserializedQueueCorsRule.allowedOrigins = reader.getStringElement(); + allowedOrigins = reader.getStringElement(); } else if ("AllowedMethods".equals(elementName.getLocalPart())) { - deserializedQueueCorsRule.allowedMethods = reader.getStringElement(); + allowedMethods = reader.getStringElement(); } else if ("AllowedHeaders".equals(elementName.getLocalPart())) { - deserializedQueueCorsRule.allowedHeaders = reader.getStringElement(); + allowedHeaders = reader.getStringElement(); } else if ("ExposedHeaders".equals(elementName.getLocalPart())) { - deserializedQueueCorsRule.exposedHeaders = reader.getStringElement(); + exposedHeaders = reader.getStringElement(); } else if ("MaxAgeInSeconds".equals(elementName.getLocalPart())) { - deserializedQueueCorsRule.maxAgeInSeconds = reader.getIntElement(); + maxAgeInSeconds = reader.getIntElement(); } else { reader.skipElement(); } } - + QueueCorsRule deserializedQueueCorsRule = new QueueCorsRule(); + deserializedQueueCorsRule.allowedOrigins = allowedOrigins; + deserializedQueueCorsRule.allowedMethods = allowedMethods; + deserializedQueueCorsRule.allowedHeaders = allowedHeaders; + deserializedQueueCorsRule.exposedHeaders = exposedHeaders; + deserializedQueueCorsRule.maxAgeInSeconds = maxAgeInSeconds; return deserializedQueueCorsRule; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java index 1370bd78acf3..765addc7bd09 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -20,14 +19,15 @@ */ @Fluent public final class QueueItem implements XmlSerializable { + /* - * The name of the Queue. + * The name of the queue. */ @Generated private String name; /* - * Dictionary of + * The metadata of the queue. */ @Generated private Map metadata; @@ -40,8 +40,8 @@ public QueueItem() { } /** - * Get the name property: The name of the Queue. - * + * Get the name property: The name of the queue. + * * @return the name value. */ @Generated @@ -50,8 +50,8 @@ public String getName() { } /** - * Set the name property: The name of the Queue. - * + * Set the name property: The name of the queue. + * * @param name the name value to set. * @return the QueueItem object itself. */ @@ -62,8 +62,8 @@ public QueueItem setName(String name) { } /** - * Get the metadata property: Dictionary of <string>. - * + * Get the metadata property: The metadata of the queue. + * * @return the metadata value. */ @Generated @@ -72,8 +72,8 @@ public Map getMetadata() { } /** - * Set the metadata property: Dictionary of <string>. - * + * Set the metadata property: The metadata of the queue. + * * @param metadata the metadata value to set. * @return the QueueItem object itself. */ @@ -107,10 +107,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueItem from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueItem if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueItem. */ @Generated @@ -120,37 +121,39 @@ public static QueueItem fromXml(XmlReader xmlReader) throws XMLStreamException { /** * Reads an instance of QueueItem from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of QueueItem if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueItem. */ @Generated public static QueueItem fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "Queue" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - QueueItem deserializedQueueItem = new QueueItem(); + String name = null; + Map metadata = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Name".equals(elementName.getLocalPart())) { - deserializedQueueItem.name = reader.getStringElement(); + name = reader.getStringElement(); } else if ("Metadata".equals(elementName.getLocalPart())) { while (reader.nextElement() != XmlToken.END_ELEMENT) { - if (deserializedQueueItem.metadata == null) { - deserializedQueueItem.metadata = new LinkedHashMap<>(); + if (metadata == null) { + metadata = new LinkedHashMap<>(); } - deserializedQueueItem.metadata.put(reader.getElementName().getLocalPart(), - reader.getStringElement()); + metadata.put(reader.getElementName().getLocalPart(), reader.getStringElement()); } } else { reader.skipElement(); } } - + QueueItem deserializedQueueItem = new QueueItem(); + deserializedQueueItem.name = name; + deserializedQueueItem.metadata = metadata; return deserializedQueueItem; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java index 0d2fede2ffb2..6569e403bd04 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -14,30 +13,31 @@ import javax.xml.stream.XMLStreamException; /** - * a summary of request statistics grouped by API in hour or minute aggregates for queues. + * The metrics properties. */ @Fluent public final class QueueMetrics implements XmlSerializable { + /* - * The version of Storage Analytics to configure. + * The version of the metrics properties. */ @Generated private String version; /* - * Indicates whether metrics are enabled for the Queue service. + * Whether it is enabled. */ @Generated private boolean enabled; /* - * Indicates whether metrics should generate summary statistics for called API operations. + * Whether to include API in the metrics. */ @Generated private Boolean includeApis; /* - * the retention policy + * The retention policy of the metrics. */ @Generated private QueueRetentionPolicy retentionPolicy; @@ -50,8 +50,8 @@ public QueueMetrics() { } /** - * Get the version property: The version of Storage Analytics to configure. - * + * Get the version property: The version of the metrics properties. + * * @return the version value. */ @Generated @@ -60,8 +60,8 @@ public String getVersion() { } /** - * Set the version property: The version of Storage Analytics to configure. - * + * Set the version property: The version of the metrics properties. + * * @param version the version value to set. * @return the QueueMetrics object itself. */ @@ -72,8 +72,8 @@ public QueueMetrics setVersion(String version) { } /** - * Get the enabled property: Indicates whether metrics are enabled for the Queue service. - * + * Get the enabled property: Whether it is enabled. + * * @return the enabled value. */ @Generated @@ -82,8 +82,8 @@ public boolean isEnabled() { } /** - * Set the enabled property: Indicates whether metrics are enabled for the Queue service. - * + * Set the enabled property: Whether it is enabled. + * * @param enabled the enabled value to set. * @return the QueueMetrics object itself. */ @@ -94,9 +94,8 @@ public QueueMetrics setEnabled(boolean enabled) { } /** - * Get the includeApis property: Indicates whether metrics should generate summary statistics for called API - * operations. - * + * Get the includeApis property: Whether to include API in the metrics. + * * @return the includeApis value. */ @Generated @@ -105,9 +104,8 @@ public Boolean isIncludeApis() { } /** - * Set the includeApis property: Indicates whether metrics should generate summary statistics for called API - * operations. - * + * Set the includeApis property: Whether to include API in the metrics. + * * @param includeApis the includeApis value to set. * @return the QueueMetrics object itself. */ @@ -118,8 +116,8 @@ public QueueMetrics setIncludeApis(Boolean includeApis) { } /** - * Get the retentionPolicy property: the retention policy. - * + * Get the retentionPolicy property: The retention policy of the metrics. + * * @return the retentionPolicy value. */ @Generated @@ -128,8 +126,8 @@ public QueueRetentionPolicy getRetentionPolicy() { } /** - * Set the retentionPolicy property: the retention policy. - * + * Set the retentionPolicy property: The retention policy of the metrics. + * * @param retentionPolicy the retentionPolicy value to set. * @return the QueueMetrics object itself. */ @@ -148,7 +146,7 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMetrics" : rootElementName; + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "Metrics" : rootElementName; xmlWriter.writeStartElement(rootElementName); xmlWriter.writeStringElement("Version", this.version); xmlWriter.writeBooleanElement("Enabled", this.enabled); @@ -159,10 +157,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueMetrics from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueMetrics if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueMetrics. */ @Generated @@ -172,36 +171,43 @@ public static QueueMetrics fromXml(XmlReader xmlReader) throws XMLStreamExceptio /** * Reads an instance of QueueMetrics from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of QueueMetrics if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueMetrics. */ @Generated public static QueueMetrics fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueMetrics" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "Metrics" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - QueueMetrics deserializedQueueMetrics = new QueueMetrics(); + String version = null; + boolean enabled = false; + Boolean includeApis = null; + QueueRetentionPolicy retentionPolicy = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Version".equals(elementName.getLocalPart())) { - deserializedQueueMetrics.version = reader.getStringElement(); + version = reader.getStringElement(); } else if ("Enabled".equals(elementName.getLocalPart())) { - deserializedQueueMetrics.enabled = reader.getBooleanElement(); + enabled = reader.getBooleanElement(); } else if ("IncludeAPIs".equals(elementName.getLocalPart())) { - deserializedQueueMetrics.includeApis = reader.getNullableElement(Boolean::parseBoolean); + includeApis = reader.getNullableElement(Boolean::parseBoolean); } else if ("RetentionPolicy".equals(elementName.getLocalPart())) { - deserializedQueueMetrics.retentionPolicy = QueueRetentionPolicy.fromXml(reader, "RetentionPolicy"); + retentionPolicy = QueueRetentionPolicy.fromXml(reader, "RetentionPolicy"); } else { reader.skipElement(); } } - + QueueMetrics deserializedQueueMetrics = new QueueMetrics(); + deserializedQueueMetrics.enabled = enabled; + deserializedQueueMetrics.version = version; + deserializedQueueMetrics.includeApis = includeApis; + deserializedQueueMetrics.retentionPolicy = retentionPolicy; return deserializedQueueMetrics; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java index 8f307fa6fb6a..8f8d4fb8e196 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -14,19 +13,19 @@ import javax.xml.stream.XMLStreamException; /** - * the retention policy. + * The retention policy. */ @Fluent public final class QueueRetentionPolicy implements XmlSerializable { + /* - * Indicates whether a retention policy is enabled for the storage service + * Whether to enable the retention policy. */ @Generated private boolean enabled; /* - * Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than - * this value will be deleted + * The number of days to retain the logs. */ @Generated private Integer days; @@ -39,8 +38,8 @@ public QueueRetentionPolicy() { } /** - * Get the enabled property: Indicates whether a retention policy is enabled for the storage service. - * + * Get the enabled property: Whether to enable the retention policy. + * * @return the enabled value. */ @Generated @@ -49,8 +48,8 @@ public boolean isEnabled() { } /** - * Set the enabled property: Indicates whether a retention policy is enabled for the storage service. - * + * Set the enabled property: Whether to enable the retention policy. + * * @param enabled the enabled value to set. * @return the QueueRetentionPolicy object itself. */ @@ -61,9 +60,8 @@ public QueueRetentionPolicy setEnabled(boolean enabled) { } /** - * Get the days property: Indicates the number of days that metrics or logging or soft-deleted data should be - * retained. All data older than this value will be deleted. - * + * Get the days property: The number of days to retain the logs. + * * @return the days value. */ @Generated @@ -72,9 +70,8 @@ public Integer getDays() { } /** - * Set the days property: Indicates the number of days that metrics or logging or soft-deleted data should be - * retained. All data older than this value will be deleted. - * + * Set the days property: The number of days to retain the logs. + * * @param days the days value to set. * @return the QueueRetentionPolicy object itself. */ @@ -93,8 +90,7 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueRetentionPolicy" : rootElementName; + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "RetentionPolicy" : rootElementName; xmlWriter.writeStartElement(rootElementName); xmlWriter.writeBooleanElement("Enabled", this.enabled); xmlWriter.writeNumberElement("Days", this.days); @@ -103,10 +99,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueRetentionPolicy from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueRetentionPolicy if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueRetentionPolicy. */ @Generated @@ -116,32 +113,35 @@ public static QueueRetentionPolicy fromXml(XmlReader xmlReader) throws XMLStream /** * Reads an instance of QueueRetentionPolicy from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of QueueRetentionPolicy if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueRetentionPolicy. */ @Generated public static QueueRetentionPolicy fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueRetentionPolicy" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "RetentionPolicy" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - QueueRetentionPolicy deserializedQueueRetentionPolicy = new QueueRetentionPolicy(); + boolean enabled = false; + Integer days = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Enabled".equals(elementName.getLocalPart())) { - deserializedQueueRetentionPolicy.enabled = reader.getBooleanElement(); + enabled = reader.getBooleanElement(); } else if ("Days".equals(elementName.getLocalPart())) { - deserializedQueueRetentionPolicy.days = reader.getNullableElement(Integer::parseInt); + days = reader.getNullableElement(Integer::parseInt); } else { reader.skipElement(); } } - + QueueRetentionPolicy deserializedQueueRetentionPolicy = new QueueRetentionPolicy(); + deserializedQueueRetentionPolicy.enabled = enabled; + deserializedQueueRetentionPolicy.days = days; return deserializedQueueRetentionPolicy; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java index 23a24ecd9c1d..54ce1163313c 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -16,30 +15,25 @@ import javax.xml.stream.XMLStreamException; /** - * Storage Service Properties. + * The service properties. */ @Fluent public final class QueueServiceProperties implements XmlSerializable { - /* - * Azure Analytics Logging settings - */ - @Generated - private QueueAnalyticsLogging analyticsLogging; /* - * A summary of request statistics grouped by API in hourly aggregates for queues + * The hour metrics properties. */ @Generated private QueueMetrics hourMetrics; /* - * a summary of request statistics grouped by API in minute aggregates for queues + * The minute metrics properties. */ @Generated private QueueMetrics minuteMetrics; /* - * The set of CORS rules. + * The CORS properties. */ @Generated private List cors; @@ -52,30 +46,8 @@ public QueueServiceProperties() { } /** - * Get the analyticsLogging property: Azure Analytics Logging settings. - * - * @return the analyticsLogging value. - */ - @Generated - public QueueAnalyticsLogging getAnalyticsLogging() { - return this.analyticsLogging; - } - - /** - * Set the analyticsLogging property: Azure Analytics Logging settings. - * - * @param analyticsLogging the analyticsLogging value to set. - * @return the QueueServiceProperties object itself. - */ - @Generated - public QueueServiceProperties setAnalyticsLogging(QueueAnalyticsLogging analyticsLogging) { - this.analyticsLogging = analyticsLogging; - return this; - } - - /** - * Get the hourMetrics property: A summary of request statistics grouped by API in hourly aggregates for queues. - * + * Get the hourMetrics property: The hour metrics properties. + * * @return the hourMetrics value. */ @Generated @@ -84,20 +56,8 @@ public QueueMetrics getHourMetrics() { } /** - * Set the hourMetrics property: A summary of request statistics grouped by API in hourly aggregates for queues. - * - * @param hourMetrics the hourMetrics value to set. - * @return the QueueServiceProperties object itself. - */ - @Generated - public QueueServiceProperties setHourMetrics(QueueMetrics hourMetrics) { - this.hourMetrics = hourMetrics; - return this; - } - - /** - * Get the minuteMetrics property: a summary of request statistics grouped by API in minute aggregates for queues. - * + * Get the minuteMetrics property: The minute metrics properties. + * * @return the minuteMetrics value. */ @Generated @@ -106,20 +66,8 @@ public QueueMetrics getMinuteMetrics() { } /** - * Set the minuteMetrics property: a summary of request statistics grouped by API in minute aggregates for queues. - * - * @param minuteMetrics the minuteMetrics value to set. - * @return the QueueServiceProperties object itself. - */ - @Generated - public QueueServiceProperties setMinuteMetrics(QueueMetrics minuteMetrics) { - this.minuteMetrics = minuteMetrics; - return this; - } - - /** - * Get the cors property: The set of CORS rules. - * + * Get the cors property: The CORS properties. + * * @return the cors value. */ @Generated @@ -131,8 +79,8 @@ public List getCors() { } /** - * Set the cors property: The set of CORS rules. - * + * Set the cors property: The CORS properties. + * * @param cors the cors value to set. * @return the QueueServiceProperties object itself. */ @@ -169,7 +117,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueServiceProperties from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueServiceProperties if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. @@ -182,7 +130,7 @@ public static QueueServiceProperties fromXml(XmlReader xmlReader) throws XMLStre /** * Reads an instance of QueueServiceProperties from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -199,7 +147,6 @@ public static QueueServiceProperties fromXml(XmlReader xmlReader, String rootEle QueueServiceProperties deserializedQueueServiceProperties = new QueueServiceProperties(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Logging".equals(elementName.getLocalPart())) { deserializedQueueServiceProperties.analyticsLogging = QueueAnalyticsLogging.fromXml(reader, "Logging"); @@ -223,8 +170,59 @@ public static QueueServiceProperties fromXml(XmlReader xmlReader, String rootEle reader.skipElement(); } } - return deserializedQueueServiceProperties; }); } + + /* + * The logging properties. + */ + @Generated + private QueueAnalyticsLogging analyticsLogging; + + /** + * Get the analyticsLogging property: The logging properties. + * + * @return the analyticsLogging value. + */ + @Generated + public QueueAnalyticsLogging getAnalyticsLogging() { + return this.analyticsLogging; + } + + /** + * Set the analyticsLogging property: The logging properties. + * + * @param analyticsLogging the analyticsLogging value to set. + * @return the QueueServiceProperties object itself. + */ + @Generated + public QueueServiceProperties setAnalyticsLogging(QueueAnalyticsLogging analyticsLogging) { + this.analyticsLogging = analyticsLogging; + return this; + } + + /** + * Set the hourMetrics property: The hour metrics properties. + * + * @param hourMetrics the hourMetrics value to set. + * @return the QueueServiceProperties object itself. + */ + @Generated + public QueueServiceProperties setHourMetrics(QueueMetrics hourMetrics) { + this.hourMetrics = hourMetrics; + return this; + } + + /** + * Set the minuteMetrics property: The minute metrics properties. + * + * @param minuteMetrics the minuteMetrics value to set. + * @return the QueueServiceProperties object itself. + */ + @Generated + public QueueServiceProperties setMinuteMetrics(QueueMetrics minuteMetrics) { + this.minuteMetrics = minuteMetrics; + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java index bddc1df10804..190f6e19fba3 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -14,12 +13,13 @@ import javax.xml.stream.XMLStreamException; /** - * Stats for the storage service. + * Statistics for the storage queue service. */ @Fluent public final class QueueServiceStatistics implements XmlSerializable { + /* - * Geo-Replication information for the Secondary Storage Service + * The geo replication stats. */ @Generated private GeoReplication geoReplication; @@ -32,8 +32,8 @@ public QueueServiceStatistics() { } /** - * Get the geoReplication property: Geo-Replication information for the Secondary Storage Service. - * + * Get the geoReplication property: The geo replication stats. + * * @return the geoReplication value. */ @Generated @@ -42,8 +42,8 @@ public GeoReplication getGeoReplication() { } /** - * Set the geoReplication property: Geo-Replication information for the Secondary Storage Service. - * + * Set the geoReplication property: The geo replication stats. + * * @param geoReplication the geoReplication value to set. * @return the QueueServiceStatistics object itself. */ @@ -62,8 +62,7 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueServiceStatistics" : rootElementName; + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueServiceStats" : rootElementName; xmlWriter.writeStartElement(rootElementName); xmlWriter.writeXml(this.geoReplication, "GeoReplication"); return xmlWriter.writeEndElement(); @@ -71,7 +70,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueServiceStatistics from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueServiceStatistics if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. @@ -84,7 +83,7 @@ public static QueueServiceStatistics fromXml(XmlReader xmlReader) throws XMLStre /** * Reads an instance of QueueServiceStatistics from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -96,12 +95,11 @@ public static QueueServiceStatistics fromXml(XmlReader xmlReader) throws XMLStre public static QueueServiceStatistics fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueServiceStatistics" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "QueueServiceStats" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { QueueServiceStatistics deserializedQueueServiceStatistics = new QueueServiceStatistics(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("GeoReplication".equals(elementName.getLocalPart())) { deserializedQueueServiceStatistics.geoReplication = GeoReplication.fromXml(reader, "GeoReplication"); @@ -109,7 +107,6 @@ public static QueueServiceStatistics fromXml(XmlReader xmlReader, String rootEle reader.skipElement(); } } - return deserializedQueueServiceStatistics; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java index c96d2a6e36f5..3a0af5a13793 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -14,18 +13,19 @@ import javax.xml.stream.XMLStreamException; /** - * signed identifier. + * The signed identifier. */ @Fluent public final class QueueSignedIdentifier implements XmlSerializable { + /* - * a unique id + * The unique ID for the signed identifier. */ @Generated private String id; /* - * The access policy + * The access policy for the signed identifier. */ @Generated private QueueAccessPolicy accessPolicy; @@ -38,8 +38,8 @@ public QueueSignedIdentifier() { } /** - * Get the id property: a unique id. - * + * Get the id property: The unique ID for the signed identifier. + * * @return the id value. */ @Generated @@ -48,8 +48,8 @@ public String getId() { } /** - * Set the id property: a unique id. - * + * Set the id property: The unique ID for the signed identifier. + * * @param id the id value to set. * @return the QueueSignedIdentifier object itself. */ @@ -60,8 +60,8 @@ public QueueSignedIdentifier setId(String id) { } /** - * Get the accessPolicy property: The access policy. - * + * Get the accessPolicy property: The access policy for the signed identifier. + * * @return the accessPolicy value. */ @Generated @@ -70,8 +70,8 @@ public QueueAccessPolicy getAccessPolicy() { } /** - * Set the accessPolicy property: The access policy. - * + * Set the accessPolicy property: The access policy for the signed identifier. + * * @param accessPolicy the accessPolicy value to set. * @return the QueueSignedIdentifier object itself. */ @@ -99,10 +99,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueSignedIdentifier from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueSignedIdentifier if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueSignedIdentifier. */ @Generated @@ -112,12 +113,13 @@ public static QueueSignedIdentifier fromXml(XmlReader xmlReader) throws XMLStrea /** * Reads an instance of QueueSignedIdentifier from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of QueueSignedIdentifier if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the QueueSignedIdentifier. */ @Generated @@ -125,19 +127,21 @@ public static QueueSignedIdentifier fromXml(XmlReader xmlReader, String rootElem String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "SignedIdentifier" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - QueueSignedIdentifier deserializedQueueSignedIdentifier = new QueueSignedIdentifier(); + String id = null; + QueueAccessPolicy accessPolicy = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Id".equals(elementName.getLocalPart())) { - deserializedQueueSignedIdentifier.id = reader.getStringElement(); + id = reader.getStringElement(); } else if ("AccessPolicy".equals(elementName.getLocalPart())) { - deserializedQueueSignedIdentifier.accessPolicy = QueueAccessPolicy.fromXml(reader, "AccessPolicy"); + accessPolicy = QueueAccessPolicy.fromXml(reader, "AccessPolicy"); } else { reader.skipElement(); } } - + QueueSignedIdentifier deserializedQueueSignedIdentifier = new QueueSignedIdentifier(); + deserializedQueueSignedIdentifier.id = id; + deserializedQueueSignedIdentifier.accessPolicy = accessPolicy; return deserializedQueueSignedIdentifier; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java index 954e7d01ee97..36700bdcf0a6 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -17,37 +16,38 @@ import javax.xml.stream.XMLStreamException; /** - * The object returned in the QueueMessageList array when calling Put Message on a Queue. + * The sent queue message. */ @Fluent public final class SendMessageResult implements XmlSerializable { + /* - * The Id of the Message. + * The ID of the message. */ @Generated private String messageId; /* - * The time the Message was inserted into the Queue. + * The time the message was inserted into the queue. */ @Generated private DateTimeRfc1123 insertionTime; /* - * The time that the Message will expire and be automatically deleted. + * The time that the message will expire and be automatically deleted. */ @Generated private DateTimeRfc1123 expirationTime; /* - * This value is required to delete the Message. If deletion fails using this popreceipt then the message has been - * dequeued by another client. + * An opaque value required to delete the message. If deletion fails using this + * PopReceipt then the message has been dequeued by another client. */ @Generated private String popReceipt; /* - * The time that the message will again become visible in the Queue. + * The time that the message will again become visible in the queue. */ @Generated private DateTimeRfc1123 timeNextVisible; @@ -60,8 +60,8 @@ public SendMessageResult() { } /** - * Get the messageId property: The Id of the Message. - * + * Get the messageId property: The ID of the message. + * * @return the messageId value. */ @Generated @@ -70,8 +70,8 @@ public String getMessageId() { } /** - * Set the messageId property: The Id of the Message. - * + * Set the messageId property: The ID of the message. + * * @param messageId the messageId value to set. * @return the SendMessageResult object itself. */ @@ -82,8 +82,8 @@ public SendMessageResult setMessageId(String messageId) { } /** - * Get the insertionTime property: The time the Message was inserted into the Queue. - * + * Get the insertionTime property: The time the message was inserted into the queue. + * * @return the insertionTime value. */ @Generated @@ -95,8 +95,8 @@ public OffsetDateTime getInsertionTime() { } /** - * Set the insertionTime property: The time the Message was inserted into the Queue. - * + * Set the insertionTime property: The time the message was inserted into the queue. + * * @param insertionTime the insertionTime value to set. * @return the SendMessageResult object itself. */ @@ -111,8 +111,8 @@ public SendMessageResult setInsertionTime(OffsetDateTime insertionTime) { } /** - * Get the expirationTime property: The time that the Message will expire and be automatically deleted. - * + * Get the expirationTime property: The time that the message will expire and be automatically deleted. + * * @return the expirationTime value. */ @Generated @@ -124,8 +124,8 @@ public OffsetDateTime getExpirationTime() { } /** - * Set the expirationTime property: The time that the Message will expire and be automatically deleted. - * + * Set the expirationTime property: The time that the message will expire and be automatically deleted. + * * @param expirationTime the expirationTime value to set. * @return the SendMessageResult object itself. */ @@ -140,9 +140,9 @@ public SendMessageResult setExpirationTime(OffsetDateTime expirationTime) { } /** - * Get the popReceipt property: This value is required to delete the Message. If deletion fails using this - * popreceipt then the message has been dequeued by another client. - * + * Get the popReceipt property: An opaque value required to delete the message. If deletion fails using this + * PopReceipt then the message has been dequeued by another client. + * * @return the popReceipt value. */ @Generated @@ -151,9 +151,9 @@ public String getPopReceipt() { } /** - * Set the popReceipt property: This value is required to delete the Message. If deletion fails using this - * popreceipt then the message has been dequeued by another client. - * + * Set the popReceipt property: An opaque value required to delete the message. If deletion fails using this + * PopReceipt then the message has been dequeued by another client. + * * @param popReceipt the popReceipt value to set. * @return the SendMessageResult object itself. */ @@ -164,8 +164,8 @@ public SendMessageResult setPopReceipt(String popReceipt) { } /** - * Get the timeNextVisible property: The time that the message will again become visible in the Queue. - * + * Get the timeNextVisible property: The time that the message will again become visible in the queue. + * * @return the timeNextVisible value. */ @Generated @@ -177,8 +177,8 @@ public OffsetDateTime getTimeNextVisible() { } /** - * Set the timeNextVisible property: The time that the message will again become visible in the Queue. - * + * Set the timeNextVisible property: The time that the message will again become visible in the queue. + * * @param timeNextVisible the timeNextVisible value to set. * @return the SendMessageResult object itself. */ @@ -213,10 +213,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of SendMessageResult from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of SendMessageResult if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the SendMessageResult. */ @Generated @@ -226,12 +227,13 @@ public static SendMessageResult fromXml(XmlReader xmlReader) throws XMLStreamExc /** * Reads an instance of SendMessageResult from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of SendMessageResult if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the SendMessageResult. */ @Generated @@ -239,25 +241,45 @@ public static SendMessageResult fromXml(XmlReader xmlReader, String rootElementN String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessage" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - SendMessageResult deserializedSendMessageResult = new SendMessageResult(); + String messageId = null; + OffsetDateTime insertionTime = null; + OffsetDateTime expirationTime = null; + String popReceipt = null; + OffsetDateTime timeNextVisible = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("MessageId".equals(elementName.getLocalPart())) { - deserializedSendMessageResult.messageId = reader.getStringElement(); + messageId = reader.getStringElement(); } else if ("InsertionTime".equals(elementName.getLocalPart())) { - deserializedSendMessageResult.insertionTime = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 insertionTimeHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (insertionTimeHolder != null) { + insertionTime = insertionTimeHolder.getDateTime(); + } } else if ("ExpirationTime".equals(elementName.getLocalPart())) { - deserializedSendMessageResult.expirationTime = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 expirationTimeHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (expirationTimeHolder != null) { + expirationTime = expirationTimeHolder.getDateTime(); + } } else if ("PopReceipt".equals(elementName.getLocalPart())) { - deserializedSendMessageResult.popReceipt = reader.getStringElement(); + popReceipt = reader.getStringElement(); } else if ("TimeNextVisible".equals(elementName.getLocalPart())) { - deserializedSendMessageResult.timeNextVisible = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 timeNextVisibleHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (timeNextVisibleHolder != null) { + timeNextVisible = timeNextVisibleHolder.getDateTime(); + } } else { reader.skipElement(); } } - + SendMessageResult deserializedSendMessageResult = new SendMessageResult(); + deserializedSendMessageResult.messageId = messageId; + deserializedSendMessageResult.insertionTime + = insertionTime == null ? null : new DateTimeRfc1123(insertionTime); + deserializedSendMessageResult.expirationTime + = expirationTime == null ? null : new DateTimeRfc1123(expirationTime); + deserializedSendMessageResult.popReceipt = popReceipt; + deserializedSendMessageResult.timeNextVisible + = timeNextVisible == null ? null : new DateTimeRfc1123(timeNextVisible); return deserializedSendMessageResult; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/UserDelegationKey.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/UserDelegationKey.java index 2fcd3e82e525..f95b91734b51 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/UserDelegationKey.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/UserDelegationKey.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -21,50 +20,33 @@ */ @Fluent public final class UserDelegationKey implements XmlSerializable { - /* - * The Azure Active Directory object ID in GUID format. - */ - @Generated - private String signedObjectId; - - /* - * The Azure Active Directory tenant ID in GUID format - */ - @Generated - private String signedTenantId; /* - * The date-time the key is active + * The date-time the key is active. */ @Generated private OffsetDateTime signedStart; /* - * The date-time the key expires + * The date-time the key expires. */ @Generated private OffsetDateTime signedExpiry; /* - * Abbreviation of the Azure Storage service that accepts the key + * The service that created the key. */ @Generated private String signedService; /* - * The service version that created the key + * The service version used when creating the key. */ @Generated private String signedVersion; /* - * The delegated user tenant id in Azure AD. Return if DelegatedUserTid is specified. - */ - @Generated - private String signedDelegatedUserTenantId; - - /* - * The key as a base64 string + * The key as a base64 string. */ @Generated private String value; @@ -76,53 +58,9 @@ public final class UserDelegationKey implements XmlSerializable { - UserDelegationKey deserializedUserDelegationKey = new UserDelegationKey(); + String signedObjectId = null; + String signedTenantId = null; + OffsetDateTime signedStart = null; + OffsetDateTime signedExpiry = null; + String signedService = null; + String signedVersion = null; + String signedDelegatedUserTenantId = null; + String value = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("SignedOid".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedObjectId = reader.getStringElement(); + signedObjectId = reader.getStringElement(); } else if ("SignedTid".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedTenantId = reader.getStringElement(); + signedTenantId = reader.getStringElement(); } else if ("SignedStart".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedStart + signedStart = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("SignedExpiry".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedExpiry + signedExpiry = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("SignedService".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedService = reader.getStringElement(); + signedService = reader.getStringElement(); } else if ("SignedVersion".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedVersion = reader.getStringElement(); + signedVersion = reader.getStringElement(); } else if ("SignedDelegatedUserTid".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedDelegatedUserTenantId = reader.getStringElement(); + signedDelegatedUserTenantId = reader.getStringElement(); } else if ("Value".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.value = reader.getStringElement(); + value = reader.getStringElement(); } else { reader.skipElement(); } } - + UserDelegationKey deserializedUserDelegationKey = new UserDelegationKey(); + deserializedUserDelegationKey.signedObjectId = signedObjectId; + deserializedUserDelegationKey.signedTenantId = signedTenantId; + deserializedUserDelegationKey.signedStart = signedStart; + deserializedUserDelegationKey.signedExpiry = signedExpiry; + deserializedUserDelegationKey.signedService = signedService; + deserializedUserDelegationKey.signedVersion = signedVersion; + deserializedUserDelegationKey.value = value; + deserializedUserDelegationKey.signedDelegatedUserTenantId = signedDelegatedUserTenantId; return deserializedUserDelegationKey; }); } + + /* + * The Entra ID object ID in GUID format. + */ + @Generated + private String signedObjectId; + + /* + * The Entra ID tenant ID in GUID format. + */ + @Generated + private String signedTenantId; + + /* + * The delegated user tenant ID in Entra ID. Return if DelegatedUserTid is specified. + */ + @Generated + private String signedDelegatedUserTenantId; + + /** + * Get the signedObjectId property: The Entra ID object ID in GUID format. + * + * @return the signedObjectId value. + */ + @Generated + public String getSignedObjectId() { + return this.signedObjectId; + } + + /** + * Set the signedObjectId property: The Entra ID object ID in GUID format. + * + * @param signedObjectId the signedObjectId value to set. + * @return the UserDelegationKey object itself. + */ + @Generated + public UserDelegationKey setSignedObjectId(String signedObjectId) { + this.signedObjectId = signedObjectId; + return this; + } + + /** + * Get the signedTenantId property: The Entra ID tenant ID in GUID format. + * + * @return the signedTenantId value. + */ + @Generated + public String getSignedTenantId() { + return this.signedTenantId; + } + + /** + * Set the signedTenantId property: The Entra ID tenant ID in GUID format. + * + * @param signedTenantId the signedTenantId value to set. + * @return the UserDelegationKey object itself. + */ + @Generated + public UserDelegationKey setSignedTenantId(String signedTenantId) { + this.signedTenantId = signedTenantId; + return this; + } + + /** + * Get the signedDelegatedUserTenantId property: The delegated user tenant ID in Entra ID. Return if + * DelegatedUserTid is specified. + * + * @return the signedDelegatedUserTenantId value. + */ + @Generated + public String getSignedDelegatedUserTenantId() { + return this.signedDelegatedUserTenantId; + } + + /** + * Set the signedDelegatedUserTenantId property: The delegated user tenant ID in Entra ID. Return if + * DelegatedUserTid is specified. + * + * @param signedDelegatedUserTenantId the signedDelegatedUserTenantId value to set. + * @return the UserDelegationKey object itself. + */ + @Generated + public UserDelegationKey setSignedDelegatedUserTenantId(String signedDelegatedUserTenantId) { + this.signedDelegatedUserTenantId = signedDelegatedUserTenantId; + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/package-info.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/package-info.java index 6854f7a763d5..a42450d65f59 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/package-info.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/package-info.java @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for AzureQueueStorage. - * null. + * Package containing the data models for Queues. */ package com.azure.storage.queue.models; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/package-info.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/package-info.java index e6671d8292fa..0d1326c86989 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/package-info.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/package-info.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. - +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * This package contains the classes to perform actions on Azure Storage Queue. + * Package containing the classes for Queues. */ package com.azure.storage.queue; diff --git a/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue-tsp_metadata.json b/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue-tsp_metadata.json new file mode 100644 index 000000000000..67d132399f8c --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue-tsp_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Storage.Queues":"2026-04-06"},"crossLanguagePackageId":"Storage.Queues","crossLanguageVersion":"f03fcb38168c","crossLanguageDefinitions":{"com.azure.storage.queue.tsp.QueueAsyncClient":"Storage.Queues.Queue","com.azure.storage.queue.tsp.QueueAsyncClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.tsp.QueueAsyncClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.tsp.QueueAsyncClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.tsp.QueueAsyncClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.tsp.QueueAsyncClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.tsp.QueueAsyncClient.deleteMessage":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.tsp.QueueAsyncClient.deleteMessageWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.tsp.QueueAsyncClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.tsp.QueueAsyncClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.tsp.QueueAsyncClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.tsp.QueueAsyncClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.tsp.QueueAsyncClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.tsp.QueueAsyncClient.peekMessages":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.tsp.QueueAsyncClient.peekMessagesWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.tsp.QueueAsyncClient.receiveMessages":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.tsp.QueueAsyncClient.receiveMessagesWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.tsp.QueueAsyncClient.sendMessage":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.tsp.QueueAsyncClient.sendMessageWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.tsp.QueueAsyncClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.tsp.QueueAsyncClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.tsp.QueueAsyncClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.tsp.QueueAsyncClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.tsp.QueueAsyncClient.updateMessage":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.tsp.QueueAsyncClient.updateMessageWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.tsp.QueueClient":"Storage.Queues.Queue","com.azure.storage.queue.tsp.QueueClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.tsp.QueueClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.tsp.QueueClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.tsp.QueueClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.tsp.QueueClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.tsp.QueueClient.deleteMessage":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.tsp.QueueClient.deleteMessageWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.tsp.QueueClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.tsp.QueueClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.tsp.QueueClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.tsp.QueueClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.tsp.QueueClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.tsp.QueueClient.peekMessages":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.tsp.QueueClient.peekMessagesWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.tsp.QueueClient.receiveMessages":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.tsp.QueueClient.receiveMessagesWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.tsp.QueueClient.sendMessage":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.tsp.QueueClient.sendMessageWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.tsp.QueueClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.tsp.QueueClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.tsp.QueueClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.tsp.QueueClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.tsp.QueueClient.updateMessage":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.tsp.QueueClient.updateMessageWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.tsp.QueueServiceAsyncClient":"Storage.Queues.Service","com.azure.storage.queue.tsp.QueueServiceAsyncClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.tsp.QueueServiceAsyncClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.tsp.QueueServiceAsyncClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.tsp.QueueServiceAsyncClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.tsp.QueueServiceAsyncClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.tsp.QueueServiceAsyncClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.tsp.QueueServiceAsyncClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.tsp.QueueServiceAsyncClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.tsp.QueueServiceAsyncClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.tsp.QueueServiceClient":"Storage.Queues.Service","com.azure.storage.queue.tsp.QueueServiceClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.tsp.QueueServiceClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.tsp.QueueServiceClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.tsp.QueueServiceClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.tsp.QueueServiceClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.tsp.QueueServiceClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.tsp.QueueServiceClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.tsp.QueueServiceClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.tsp.QueueServiceClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.tsp.QueuesClientBuilder":"Storage.Queues","com.azure.storage.queue.tsp.models.AccessPolicy":"Storage.Queues.AccessPolicy","com.azure.storage.queue.tsp.models.CorsRule":"Storage.Queues.CorsRule","com.azure.storage.queue.tsp.models.GeoReplication":"Storage.Queues.GeoReplication","com.azure.storage.queue.tsp.models.GeoReplicationStatus":"Storage.Queues.GeoReplicationStatus","com.azure.storage.queue.tsp.models.KeyInfo":"Storage.Queues.KeyInfo","com.azure.storage.queue.tsp.models.ListOfSentMessage":"Storage.Queues.ListOfSentMessage","com.azure.storage.queue.tsp.models.ListQueuesIncludeType":"Storage.Queues.ListQueuesIncludeType","com.azure.storage.queue.tsp.models.Logging":"Storage.Queues.Logging","com.azure.storage.queue.tsp.models.Metrics":"Storage.Queues.Metrics","com.azure.storage.queue.tsp.models.PeekedMessage":"Storage.Queues.PeekedMessage","com.azure.storage.queue.tsp.models.PeekedMessages":"Storage.Queues.PeekedMessages","com.azure.storage.queue.tsp.models.QueueItem":"Storage.Queues.QueueItem","com.azure.storage.queue.tsp.models.QueueMessage":"Storage.Queues.QueueMessage","com.azure.storage.queue.tsp.models.QueueServiceProperties":"Storage.Queues.QueueServiceProperties","com.azure.storage.queue.tsp.models.QueueServiceStats":"Storage.Queues.QueueServiceStats","com.azure.storage.queue.tsp.models.ReceivedMessage":"Storage.Queues.ReceivedMessage","com.azure.storage.queue.tsp.models.ReceivedMessages":"Storage.Queues.ReceivedMessages","com.azure.storage.queue.tsp.models.RetentionPolicy":"Storage.Queues.RetentionPolicy","com.azure.storage.queue.tsp.models.SentMessage":"Storage.Queues.SentMessage","com.azure.storage.queue.tsp.models.SignedIdentifier":"Storage.Queues.SignedIdentifier","com.azure.storage.queue.tsp.models.SignedIdentifiers":"Storage.Queues.SignedIdentifiers","com.azure.storage.queue.tsp.models.UserDelegationKey":"Storage.Queues.UserDelegationKey"},"generatedFiles":["src/main/java/com/azure/storage/queue/tsp/QueueAsyncClient.java","src/main/java/com/azure/storage/queue/tsp/QueueClient.java","src/main/java/com/azure/storage/queue/tsp/QueueServiceAsyncClient.java","src/main/java/com/azure/storage/queue/tsp/QueueServiceClient.java","src/main/java/com/azure/storage/queue/tsp/QueuesClientBuilder.java","src/main/java/com/azure/storage/queue/tsp/QueuesServiceVersion.java","src/main/java/com/azure/storage/queue/tsp/implementation/QueueServiceClientsImpl.java","src/main/java/com/azure/storage/queue/tsp/implementation/QueuesClientImpl.java","src/main/java/com/azure/storage/queue/tsp/implementation/QueuesImpl.java","src/main/java/com/azure/storage/queue/tsp/implementation/package-info.java","src/main/java/com/azure/storage/queue/tsp/models/AccessPolicy.java","src/main/java/com/azure/storage/queue/tsp/models/CorsRule.java","src/main/java/com/azure/storage/queue/tsp/models/GeoReplication.java","src/main/java/com/azure/storage/queue/tsp/models/GeoReplicationStatus.java","src/main/java/com/azure/storage/queue/tsp/models/KeyInfo.java","src/main/java/com/azure/storage/queue/tsp/models/ListOfSentMessage.java","src/main/java/com/azure/storage/queue/tsp/models/ListQueuesIncludeType.java","src/main/java/com/azure/storage/queue/tsp/models/Logging.java","src/main/java/com/azure/storage/queue/tsp/models/Metrics.java","src/main/java/com/azure/storage/queue/tsp/models/PeekedMessage.java","src/main/java/com/azure/storage/queue/tsp/models/PeekedMessages.java","src/main/java/com/azure/storage/queue/tsp/models/QueueItem.java","src/main/java/com/azure/storage/queue/tsp/models/QueueMessage.java","src/main/java/com/azure/storage/queue/tsp/models/QueueServiceProperties.java","src/main/java/com/azure/storage/queue/tsp/models/QueueServiceStats.java","src/main/java/com/azure/storage/queue/tsp/models/ReceivedMessage.java","src/main/java/com/azure/storage/queue/tsp/models/ReceivedMessages.java","src/main/java/com/azure/storage/queue/tsp/models/RetentionPolicy.java","src/main/java/com/azure/storage/queue/tsp/models/SentMessage.java","src/main/java/com/azure/storage/queue/tsp/models/SignedIdentifier.java","src/main/java/com/azure/storage/queue/tsp/models/SignedIdentifiers.java","src/main/java/com/azure/storage/queue/tsp/models/UserDelegationKey.java","src/main/java/com/azure/storage/queue/tsp/models/package-info.java","src/main/java/com/azure/storage/queue/tsp/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json b/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json new file mode 100644 index 000000000000..3d799aee6e1b --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Storage.Queues":"2026-04-06"},"crossLanguagePackageId":"Storage.Queues","crossLanguageVersion":"e3b3d03c0600","crossLanguageDefinitions":{"com.azure.storage.queue.AzureQueueStorageBuilder":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsAsyncClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient":"Storage.Queues","com.azure.storage.queue.MessageIdsClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessagesAsyncClient":"Storage.Queues","com.azure.storage.queue.MessagesAsyncClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesAsyncClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient":"Storage.Queues","com.azure.storage.queue.MessagesClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.QueueAsyncClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueAsyncClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueAsyncClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.ServiceAsyncClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceAsyncClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceAsyncClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceAsyncClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.implementation.models.KeyInfo":"Storage.Queues.KeyInfo","com.azure.storage.queue.implementation.models.ListOfSentMessage":"Storage.Queues.ListOfSentMessage","com.azure.storage.queue.implementation.models.ListQueuesIncludeType":"Storage.Queues.ListQueuesIncludeType","com.azure.storage.queue.implementation.models.PeekedMessageItemInternal":"Storage.Queues.PeekedMessage","com.azure.storage.queue.implementation.models.PeekedMessages":"Storage.Queues.PeekedMessages","com.azure.storage.queue.implementation.models.QueueMessage":"Storage.Queues.QueueMessage","com.azure.storage.queue.implementation.models.QueueMessageItemInternal":"Storage.Queues.ReceivedMessage","com.azure.storage.queue.implementation.models.ReceivedMessages":"Storage.Queues.ReceivedMessages","com.azure.storage.queue.implementation.models.SignedIdentifiers":"Storage.Queues.SignedIdentifiers","com.azure.storage.queue.models.GeoReplication":"Storage.Queues.GeoReplication","com.azure.storage.queue.models.GeoReplicationStatus":"Storage.Queues.GeoReplicationStatus","com.azure.storage.queue.models.QueueAccessPolicy":"Storage.Queues.AccessPolicy","com.azure.storage.queue.models.QueueAnalyticsLogging":"Storage.Queues.Logging","com.azure.storage.queue.models.QueueCorsRule":"Storage.Queues.CorsRule","com.azure.storage.queue.models.QueueItem":"Storage.Queues.QueueItem","com.azure.storage.queue.models.QueueMetrics":"Storage.Queues.Metrics","com.azure.storage.queue.models.QueueRetentionPolicy":"Storage.Queues.RetentionPolicy","com.azure.storage.queue.models.QueueServiceProperties":"Storage.Queues.QueueServiceProperties","com.azure.storage.queue.models.QueueServiceStatistics":"Storage.Queues.QueueServiceStats","com.azure.storage.queue.models.QueueSignedIdentifier":"Storage.Queues.SignedIdentifier","com.azure.storage.queue.models.SendMessageResult":"Storage.Queues.SentMessage","com.azure.storage.queue.models.UserDelegationKey":"Storage.Queues.UserDelegationKey"},"generatedFiles":["src/main/java/com/azure/storage/queue/AzureQueueStorageBuilder.java","src/main/java/com/azure/storage/queue/MessageIdsAsyncClient.java","src/main/java/com/azure/storage/queue/MessageIdsClient.java","src/main/java/com/azure/storage/queue/MessagesAsyncClient.java","src/main/java/com/azure/storage/queue/MessagesClient.java","src/main/java/com/azure/storage/queue/QueueAsyncClient.java","src/main/java/com/azure/storage/queue/QueueClient.java","src/main/java/com/azure/storage/queue/QueuesServiceVersion.java","src/main/java/com/azure/storage/queue/ServiceAsyncClient.java","src/main/java/com/azure/storage/queue/ServiceClient.java","src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java","src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java","src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java","src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java","src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java","src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java","src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java","src/main/java/com/azure/storage/queue/implementation/models/ListQueuesIncludeType.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessage.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java","src/main/java/com/azure/storage/queue/implementation/models/package-info.java","src/main/java/com/azure/storage/queue/implementation/package-info.java","src/main/java/com/azure/storage/queue/models/GeoReplication.java","src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java","src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java","src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java","src/main/java/com/azure/storage/queue/models/QueueCorsRule.java","src/main/java/com/azure/storage/queue/models/QueueItem.java","src/main/java/com/azure/storage/queue/models/QueueMetrics.java","src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java","src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java","src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java","src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java","src/main/java/com/azure/storage/queue/models/SendMessageResult.java","src/main/java/com/azure/storage/queue/models/UserDelegationKey.java","src/main/java/com/azure/storage/queue/models/package-info.java","src/main/java/com/azure/storage/queue/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/main/resources/azure-storage-queue-tsp.properties b/sdk/storage/azure-storage-queue/src/main/resources/azure-storage-queue-tsp.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/resources/azure-storage-queue-tsp.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java index 09fa8892604e..cc82ed6a3ef4 100644 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java @@ -41,15 +41,26 @@ public void beforeTest() { prefix = StorageCommonTestUtils.getCrc32(testContextManager.getTestPlaybackRecordingName()); if (getTestMode() != TestMode.LIVE) { - interceptorManager.addSanitizers( - Collections.singletonList(new TestProxySanitizer("sig=(.*)", "REDACTED", TestProxySanitizerType.URL))); + interceptorManager + .addSanitizers(Arrays.asList(new TestProxySanitizer("sig=(.*)", "REDACTED", TestProxySanitizerType.URL), + // The TypeSpec-generated protocol layer carries the queue name in the client base URL and addresses + // queue-scoped operations with query-only path templates (e.g. @Get("?comp=metadata")). azure-core's + // RestProxy assembles those into '.../{queue}/?comp=metadata' (a slash before the query), whereas the + // AutoRest recordings captured '.../{queue}?comp=metadata'. The trailing slash is semantically + // insignificant to the Queue service (LIVE behavior is identical), so normalize it away for playback + // matching rather than treating it as a behavior change. + new TestProxySanitizer("(?/)[?]comp=", "", TestProxySanitizerType.URL).setGroupForReplace("s"))); } // Ignore changes to the order of query parameters and wholly ignore the 'sv' (service version) query parameter // in SAS tokens. + // The 'Accept' header is excluded from matching because the TypeSpec-generated protocol layer omits it (sending + // the default '*/*') on operations without a response body, whereas the AutoRest recordings captured + // 'application/xml'. This mirrors the .NET migration, which added Accept to its LegacyExcludedHeaders. // TODO (alzimmer): Once all Storage libraries are migrated to test proxy move this into the common parent. - interceptorManager.addMatchers(Arrays - .asList(new CustomMatcher().setQueryOrderingIgnored(true).setIgnoredQueryParameters(Arrays.asList("sv")))); + interceptorManager.addMatchers(Arrays.asList(new CustomMatcher().setQueryOrderingIgnored(true) + .setIgnoredQueryParameters(Arrays.asList("sv")) + .setExcludedHeaders(Arrays.asList("Accept")))); } /** diff --git a/sdk/storage/azure-storage-queue/tsp-location.yaml b/sdk/storage/azure-storage-queue/tsp-location.yaml new file mode 100644 index 000000000000..7fcf1b196937 --- /dev/null +++ b/sdk/storage/azure-storage-queue/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/storage/data-plane/QueueStorage +commit: 93fe80c062a5baa4aca4b93dc07d637286584f0b +repo: Azure/azure-rest-api-specs +additionalDirectories: + From 928e6f36684abe1c8ea4af3b46e8a2f9bf7d471b Mon Sep 17 00:00:00 2001 From: Local Merge Date: Wed, 15 Jul 2026 02:13:34 +0530 Subject: [PATCH 02/13] typespec migration --- .../storage/queue/models/GeoReplication.java | 29 +++------- .../queue/models/QueueAccessPolicy.java | 4 +- .../queue/models/QueueAnalyticsLogging.java | 49 +++------------- .../storage/queue/models/QueueCorsRule.java | 49 +++------------- .../azure/storage/queue/models/QueueItem.java | 15 ----- .../storage/queue/models/QueueMetrics.java | 9 --- .../queue/models/QueueRetentionPolicy.java | 9 --- .../queue/models/QueueServiceStatistics.java | 9 --- .../queue/models/QueueSignedIdentifier.java | 25 ++------- .../queue/models/SendMessageResult.java | 56 ++++--------------- .../queue/models/UserDelegationKey.java | 52 ----------------- .../azure-storage-queue_metadata.json | 2 +- .../azure-storage-queue/tsp-location.yaml | 4 +- 13 files changed, 48 insertions(+), 264 deletions(-) diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java index 470d1f602fe7..870acfe1dad1 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java @@ -35,9 +35,6 @@ public final class GeoReplication implements XmlSerializable { @Generated private DateTimeRfc1123 lastSyncTime; - /** - * Creates an instance of GeoReplication class. - */ @Generated public GeoReplication() { } @@ -52,12 +49,6 @@ public GeoReplicationStatus getStatus() { return this.status; } - /** - * Set the status property: The status of the secondary location. - * - * @param status the status value to set. - * @return the GeoReplication object itself. - */ @Generated public GeoReplication setStatus(GeoReplicationStatus status) { this.status = status; @@ -80,15 +71,6 @@ public OffsetDateTime getLastSyncTime() { return this.lastSyncTime.getDateTime(); } - /** - * Set the lastSyncTime property: A GMT date/time value, to the second. All primary writes preceding this value are - * guaranteed to be available - * for read operations at the secondary. Primary writes after this point in time may or may not be available - * for reads. - * - * @param lastSyncTime the lastSyncTime value to set. - * @return the GeoReplication object itself. - */ @Generated public GeoReplication setLastSyncTime(OffsetDateTime lastSyncTime) { if (lastSyncTime == null) { @@ -160,10 +142,13 @@ public static GeoReplication fromXml(XmlReader xmlReader, String rootElementName reader.skipElement(); } } - GeoReplication deserializedGeoReplication = new GeoReplication(); - deserializedGeoReplication.status = status; - deserializedGeoReplication.lastSyncTime = lastSyncTime == null ? null : new DateTimeRfc1123(lastSyncTime); - return deserializedGeoReplication; + { + GeoReplication deserializedGeoReplication = new GeoReplication(); + deserializedGeoReplication.status = status; + deserializedGeoReplication.lastSyncTime + = lastSyncTime == null ? null : new DateTimeRfc1123(lastSyncTime); + return deserializedGeoReplication; + } }); } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java index 688f888b82b7..3973a62ef8c3 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java @@ -6,12 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.CoreUtils; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; import com.azure.xml.XmlWriter; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java index cfb9b2cf98e6..0acd385d90af 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java @@ -48,9 +48,6 @@ public final class QueueAnalyticsLogging implements XmlSerializable { @Generated private int maxAgeInSeconds; - /** - * Creates an instance of QueueCorsRule class. - */ @Generated public QueueCorsRule() { } @@ -65,12 +62,6 @@ public String getAllowedOrigins() { return this.allowedOrigins; } - /** - * Set the allowedOrigins property: The allowed origins. - * - * @param allowedOrigins the allowedOrigins value to set. - * @return the QueueCorsRule object itself. - */ @Generated public QueueCorsRule setAllowedOrigins(String allowedOrigins) { this.allowedOrigins = allowedOrigins; @@ -87,12 +78,6 @@ public String getAllowedMethods() { return this.allowedMethods; } - /** - * Set the allowedMethods property: The allowed methods. - * - * @param allowedMethods the allowedMethods value to set. - * @return the QueueCorsRule object itself. - */ @Generated public QueueCorsRule setAllowedMethods(String allowedMethods) { this.allowedMethods = allowedMethods; @@ -109,12 +94,6 @@ public String getAllowedHeaders() { return this.allowedHeaders; } - /** - * Set the allowedHeaders property: The allowed headers. - * - * @param allowedHeaders the allowedHeaders value to set. - * @return the QueueCorsRule object itself. - */ @Generated public QueueCorsRule setAllowedHeaders(String allowedHeaders) { this.allowedHeaders = allowedHeaders; @@ -131,12 +110,6 @@ public String getExposedHeaders() { return this.exposedHeaders; } - /** - * Set the exposedHeaders property: The exposed headers. - * - * @param exposedHeaders the exposedHeaders value to set. - * @return the QueueCorsRule object itself. - */ @Generated public QueueCorsRule setExposedHeaders(String exposedHeaders) { this.exposedHeaders = exposedHeaders; @@ -153,12 +126,6 @@ public int getMaxAgeInSeconds() { return this.maxAgeInSeconds; } - /** - * Set the maxAgeInSeconds property: The maximum age in seconds. - * - * @param maxAgeInSeconds the maxAgeInSeconds value to set. - * @return the QueueCorsRule object itself. - */ @Generated public QueueCorsRule setMaxAgeInSeconds(int maxAgeInSeconds) { this.maxAgeInSeconds = maxAgeInSeconds; @@ -235,13 +202,15 @@ public static QueueCorsRule fromXml(XmlReader xmlReader, String rootElementName) reader.skipElement(); } } - QueueCorsRule deserializedQueueCorsRule = new QueueCorsRule(); - deserializedQueueCorsRule.allowedOrigins = allowedOrigins; - deserializedQueueCorsRule.allowedMethods = allowedMethods; - deserializedQueueCorsRule.allowedHeaders = allowedHeaders; - deserializedQueueCorsRule.exposedHeaders = exposedHeaders; - deserializedQueueCorsRule.maxAgeInSeconds = maxAgeInSeconds; - return deserializedQueueCorsRule; + { + QueueCorsRule deserializedQueueCorsRule = new QueueCorsRule(); + deserializedQueueCorsRule.allowedOrigins = allowedOrigins; + deserializedQueueCorsRule.allowedMethods = allowedMethods; + deserializedQueueCorsRule.allowedHeaders = allowedHeaders; + deserializedQueueCorsRule.exposedHeaders = exposedHeaders; + deserializedQueueCorsRule.maxAgeInSeconds = maxAgeInSeconds; + return deserializedQueueCorsRule; + } }); } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java index 765addc7bd09..76b6b7f20af1 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java @@ -32,9 +32,6 @@ public final class QueueItem implements XmlSerializable { @Generated private Map metadata; - /** - * Creates an instance of QueueItem class. - */ @Generated public QueueItem() { } @@ -49,12 +46,6 @@ public String getName() { return this.name; } - /** - * Set the name property: The name of the queue. - * - * @param name the name value to set. - * @return the QueueItem object itself. - */ @Generated public QueueItem setName(String name) { this.name = name; @@ -71,12 +62,6 @@ public Map getMetadata() { return this.metadata; } - /** - * Set the metadata property: The metadata of the queue. - * - * @param metadata the metadata value to set. - * @return the QueueItem object itself. - */ @Generated public QueueItem setMetadata(Map metadata) { this.metadata = metadata; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java index 6569e403bd04..f88633ca6b68 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java @@ -42,9 +42,6 @@ public final class QueueMetrics implements XmlSerializable { @Generated private QueueRetentionPolicy retentionPolicy; - /** - * Creates an instance of QueueMetrics class. - */ @Generated public QueueMetrics() { } @@ -81,12 +78,6 @@ public boolean isEnabled() { return this.enabled; } - /** - * Set the enabled property: Whether it is enabled. - * - * @param enabled the enabled value to set. - * @return the QueueMetrics object itself. - */ @Generated public QueueMetrics setEnabled(boolean enabled) { this.enabled = enabled; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java index 8f8d4fb8e196..2f54272e1c87 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java @@ -30,9 +30,6 @@ public final class QueueRetentionPolicy implements XmlSerializable Date: Wed, 15 Jul 2026 17:50:07 +0530 Subject: [PATCH 03/13] remove customization comments --- .../main/java/QueueStorageCustomizations.java | 114 ------------------ 1 file changed, 114 deletions(-) diff --git a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java index 68ff6231778b..48ca783e58e7 100644 --- a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java +++ b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java @@ -35,39 +35,11 @@ /** * TypeSpec customization for azure-storage-queue. - * - *

Two responsibilities, replacing what the AutoRest setup did via {@code swagger/README.md} - * directives plus the old {@code QueueStorageCustomization} post-processor:

- * - *
    - *
  1. Remove the generated public client surface. typespec-java emits a public - * convenience client/builder per operation group (QueueClient, QueueAsyncClient, - * ServiceClient, MessagesClient, MessageIdsClient, AzureQueueStorageBuilder, ...) plus a - * QueuesServiceVersion. The shipped library hand-writes that surface - * (QueueClient/QueueAsyncClient/QueueServiceClient/QueueServiceAsyncClient/builders/ - * QueueServiceVersion in {@code com.azure.storage.queue}). We drop the codegen copies so the - * hand-written versions are not overwritten by {@code tsp-client update}. The generated - * implementation layer ({@code com.azure.storage.queue.implementation.AzureQueueStorageImpl} - * and the *Impl operation groups) is preserved and used by the hand-written clients. No impl - * rename is needed because Q1 ({@code @@clientName(Storage.Queues,"AzureQueueStorage","java")}) - * already keeps the impl named AzureQueueStorageImpl, which the hand-written layer references.
  2. - * - *
  3. Map the internal exception type. Wrap every impl proxy method so - * {@code QueueStorageExceptionInternal} is mapped to the public {@code QueueStorageException} - * (async: {@code .onErrorMap(QueueStorageExceptionInternal.class, - * ModelHelper::mapToQueueStorageException)}; sync: try/catch rethrowing - * {@code ModelHelper.mapToQueueStorageException(e)}). Ported verbatim from the AutoRest - * {@code QueueStorageCustomization}.
  4. - *
*/ public class QueueStorageCustomizations extends Customization { private static final String ROOT_FILE_PATH = "src/main/java/com/azure/storage/queue/"; - // Generated public client surface to drop so the hand-written equivalents survive regeneration. - // QueueClient / QueueAsyncClient collide by name with the hand-written clients (the emitter - // would otherwise overwrite them); the rest are net-new generated clients/builders/version that - // the hand-written convenience layer replaces. private static final String[] FILES_TO_REMOVE = new String[] { "QueueClient.java", "QueueAsyncClient.java", @@ -81,8 +53,6 @@ public class QueueStorageCustomizations extends Customization { "QueuesServiceVersion.java" }; - // Public models the emitter renders immutable (required-args or private constructor, final fields, no setters) - // that the shipped library exposes as @Fluent (no-arg constructor + setters). See restoreFluentModels. private static final List FLUENT_MODELS = Arrays.asList( "QueueRetentionPolicy", "QueueMetrics", "QueueCorsRule", "QueueAnalyticsLogging", "QueueSignedIdentifier", "GeoReplication", "QueueItem", "QueueServiceStatistics", "SendMessageResult", "UserDelegationKey"); @@ -99,16 +69,6 @@ public void customize(LibraryCustomization customization, Logger logger) { updateImplToMapInternalException(customization.getPackage("com.azure.storage.queue.implementation"), logger); } - // AccessPolicy.start/expiry are utcDateTime in the spec but carry @encode("rfc3339-fixed-width") (a non-standard - // encoding present so the Rust emitter forces exactly 7 fractional-second digits). The typespec-java emitter does - // not recognize that encoding and degrades the two properties to String, whereas the same emitter correctly emits - // OffsetDateTime for a plain utcDateTime (see KeyInfo.expiry). The shipped public model - // com.azure.storage.queue.models.QueueAccessPolicy exposes OffsetDateTime getStartsOn()/getExpiresOn() (and .NET's - // migration keeps DateTimeOffset), and the hand-written setAccessPolicy path relies on OffsetDateTime (it truncates - // to seconds before serializing). Restore the OffsetDateTime type using the exact serialization the emitter already - // produces for utcDateTime (ISO_OFFSET_DATE_TIME on write, CoreUtils.parseBestOffsetDateTime on read); the second - // truncation in the hand-written layer means no fractional-second precision is emitted, so the fixed-width concern - // that motivated the encode does not arise on the Java write path. private static void restoreAccessPolicyDateTimeType(Editor editor, Logger logger) { String path = "src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java"; String content = editor.getContents().get(path); @@ -148,18 +108,6 @@ private static void restoreAccessPolicyDateTimeType(Editor editor, Logger logger logger.info("Restored OffsetDateTime type for QueueAccessPolicy startsOn/expiresOn."); } - // The typespec-java emitter makes every model that has a required spec property immutable: input models - // (required @@usage) get a public required-args constructor + final fields + no setters, and output-only - // models get a private constructor + final fields + no setters (@Immutable). The shipped Storage public - // models are uniformly @Fluent (no-arg constructor + fluent setters); all four hand-written clients, the - // SAS helpers, the samples and the recorded tests build against that fluent shape, and .NET's migration - // keeps the same mutable models. Restore the fluent shape so the migration stays 100% source-compatible - // (no revapi break). The transform per model is uniform: swap @Immutable -> @Fluent, drop `final` from the - // instance fields, replace the generated constructor with a public no-arg constructor, add a fluent setter - // for every property that lost one, and rewrite fromXml to build via the no-arg constructor + field - // assignment. DateTimeRfc1123 backing fields (GeoReplication.lastSyncTime, SendMessageResult.*Time) keep - // their OffsetDateTime public accessors, reusing the exact OffsetDateTime<->DateTimeRfc1123 conversion the - // emitter already generates on those fields. private static void restoreFluentModels(LibraryCustomization customization, Logger logger) { PackageCustomization models = customization.getPackage("com.azure.storage.queue.models"); for (String className : FLUENT_MODELS) { @@ -179,27 +127,22 @@ private static void restoreFluentModels(LibraryCustomization customization, Logg private static void makeModelFluent(ClassOrInterfaceDeclaration clazz, Logger logger) { String className = clazz.getNameAsString(); - // @Immutable -> @Fluent (QueueRetentionPolicy/QueueMetrics are already @Fluent). clazz.getAnnotationByName("Immutable").ifPresent(a -> a.remove()); if (!clazz.isAnnotationPresent("Fluent")) { clazz.addMarkerAnnotation("Fluent"); } - // Drop `final` from the instance fields so they can be set after construction. clazz.getFields().forEach(field -> { if (!field.isStatic()) { field.setFinal(false); } }); - // Replace the generated constructor(s) with a single public no-arg constructor. new ArrayList<>(clazz.getConstructors()).forEach(ConstructorDeclaration::remove); ConstructorDeclaration ctor = clazz.addConstructor(Modifier.Keyword.PUBLIC); ctor.addMarkerAnnotation("Generated"); ctor.setBody(new BlockStmt()); - // Add a fluent setter for every property that lost one. The setter's parameter type mirrors the - // property's public accessor return type (which differs from the backing field for DateTimeRfc1123). for (FieldDeclaration field : clazz.getFields()) { if (field.isStatic()) { continue; @@ -210,7 +153,6 @@ private static void makeModelFluent(ClassOrInterfaceDeclaration clazz, Logger lo continue; } String fieldType = field.getElementType().asString(); - // Clone so the parameter does not steal the accessor/field's live Type node from the AST. Type accessorType = accessorReturnType(clazz, fieldName).orElse(field.getElementType()).clone(); String body; if ("DateTimeRfc1123".equals(fieldType) && "OffsetDateTime".equals(accessorType.asString())) { @@ -226,10 +168,6 @@ private static void makeModelFluent(ClassOrInterfaceDeclaration clazz, Logger lo setter.setBody(StaticJavaParser.parseBlock(body)); } - // Rewrite fromXml: the emitter builds the instance with the (now removed) generated constructor, e.g. - // `return new X(a, b);` or `X d = new X(a); d.opt = opt;`. Rebuild via the no-arg constructor and assign - // each former constructor argument to its field (converting OffsetDateTime -> DateTimeRfc1123 where the - // backing field requires it), matching how the emitter already assigns the optional fields. clazz.findAll(ObjectCreationExpr.class).stream() .filter(oce -> oce.getType().getNameAsString().equals(className) && !oce.getArguments().isEmpty()) .forEach(oce -> rewriteFromXmlConstruction(clazz, oce)); @@ -272,8 +210,6 @@ private static void rewriteFromXmlConstruction(ClassOrInterfaceDeclaration clazz } } - // Assignment for a former constructor argument (local var name == field name). OffsetDateTime locals feeding - // a DateTimeRfc1123 field are converted, mirroring the emitter's own constructor logic for those fields. private static String fieldAssignment(ClassOrInterfaceDeclaration clazz, String localName, String fieldName) { boolean rfc1123 = clazz.getFieldByName(fieldName) .map(f -> "DateTimeRfc1123".equals(f.getElementType().asString())).orElse(false); @@ -313,16 +249,6 @@ private static Optional findAncestor(Node node, Class typ return Optional.empty(); } - // The emitter models "List Queues" with @list + a body-sourced @continuationToken (NextMarker), but the - // typespec-java protocol paging path (see ServicesImpl.getQueuesSinglePage[Async]) discards that marker - // (continuation token hard-coded to null) and JSON-parses the XML body, so it cannot drive the hand-written - // PagedFlux/PagedIterable continuation loop. Until the emitter honors body @continuationToken (tracked - // against @azure-tools/typespec-java; Go's azqueue and .NET's Azure.Storage.Queues both preserve NextMarker from - // the same spec), expose a raw single-response accessor over the existing proxy call so the hand-written service - // clients can deserialize ListQueuesSegmentResponse (getQueueItems + getNextMarker) themselves. This mirrors the - // shape .NET's generator emits by default (GetQueuesSegment). The two injected methods are intentionally left - // without exception mapping here so updateImplToMapInternalException wraps them identically to every other - // WithResponse accessor. The accessor lives in the non-exported implementation package, so it is not public API. private static void exposeRawListQueuesResponse(PackageCustomization implPackage, Logger logger) { if (implPackage.getClass("ServicesImpl") == null) { logger.info("ServicesImpl not present; skipping raw list-queues accessor injection."); @@ -347,11 +273,6 @@ private static void exposeRawListQueuesResponse(PackageCustomization implPackage })); } - // The emitter derives the service-version enum name from the "Queues" service namespace, emitting - // QueuesServiceVersion (and referencing it from every impl proxy). The hand-written public layer - // (builders/clients) uses the shipped QueueServiceVersion. We drop the generated QueuesServiceVersion.java - // (in FILES_TO_REMOVE) and rewrite the impl references to the hand-written QueueServiceVersion, mirroring - // the service-version retarget AppConfiguration does in its customization. private static void retargetServiceVersionReferences(Editor editor, Logger logger) { String implDir = "src/main/java/com/azure/storage/queue/implementation/"; for (String fileName : new String[] { @@ -362,17 +283,12 @@ private static void retargetServiceVersionReferences(Editor editor, Logger logge if (content == null || !content.contains("QueuesServiceVersion")) { continue; } - // Rewrite both the import (com.azure.storage.queue.QueuesServiceVersion) and every bare reference. String updated = content.replace("QueuesServiceVersion", "QueueServiceVersion"); editor.replaceFile(path, updated); logger.info("Retargeted QueuesServiceVersion -> QueueServiceVersion in {}.", fileName); } } - // The emitter emits a generic module-info.java that drops the Storage-specific module directives - // (requires transitive com.azure.storage.common, exports com.azure.storage.queue.sas, - // opens com.azure.storage.queue.implementation). The shipped module-info is hand-written and is the - // authoritative superset, so drop the generated copy to avoid overwriting it. private static void preserveHandwrittenModuleInfo(Editor editor, Logger logger) { String path = "src/main/java/module-info.java"; if (editor.getContents().containsKey(path)) { @@ -395,24 +311,7 @@ private static void removeGeneratedPublicClients(Editor editor, Logger logger) { } } - /** - * Customizes the implementation classes that will perform calls to the service. The following logic is used: - *

- * - Check for the return of the method not equaling to PagedFlux, PagedIterable, PollerFlux, or SyncPoller. Those - * types wrap other APIs and those APIs being update is the correct change. - * - For asynchronous methods, add a call to - * {@code .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException)} to handle - * mapping QueueStorageExceptionInternal to QueueStorageException. - * - For synchronous methods, wrap the return statement in a try-catch block that catches - * QueueStorageExceptionInternal and rethrows {@code ModelHelper.mapToQueueStorageException(e)}. Or, for void - * methods wrap the last statement. - * - * @param implPackage The implementation package. - */ private static void updateImplToMapInternalException(PackageCustomization implPackage, Logger logger) { - // The operation-group set depends on the @@clientLocation split in client.tsp. Guard each - // class so the customization is robust whether the impl is the 4-group AutoRest topology - // (MessageIds/Messages/Queues/Services) or a reduced set. List implsToUpdate = Arrays.asList("MessageIdsImpl", "MessagesImpl", "QueuesImpl", "ServicesImpl"); for (String implToUpdate : implsToUpdate) { if (implPackage.getClass(implToUpdate) == null) { @@ -423,24 +322,11 @@ private static void updateImplToMapInternalException(PackageCustomization implPa ast.addImport("com.azure.storage.queue.implementation.util.ModelHelper"); ast.addImport("com.azure.storage.queue.models.QueueStorageException"); ast.addImport("com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal"); - // The emitter annotates the @ServiceInterface methods with a default - // @UnexpectedResponseExceptionType(HttpResponseException.class) plus per-status-code entries mapping - // 401/404/409 to generic azure-core exceptions (ClientAuthenticationException, ResourceNotFoundException, - // ResourceModifiedException). AutoRest emitted only the single default. Two problems with the per-code - // entries: (1) their getValue() returns Object, so azure-core cannot deserialize the XML error body via - // azure-xml and falls back to Jackson; (2) they would surface a non-QueueStorageException type to callers - // for those status codes, breaking public behavior. Remove every per-code entry (any - // @UnexpectedResponseExceptionType carrying a 'code' member) so all unexpected responses route through - // the single default, matching AutoRest. ast.findAll(NormalAnnotationExpr.class).stream() .filter(anno -> anno.getNameAsString().equals("UnexpectedResponseExceptionType") && anno.getPairs().stream().anyMatch(p -> p.getNameAsString().equals("code"))) .collect(java.util.stream.Collectors.toList()) .forEach(Node::remove); - // Retarget the remaining default annotation to the internal exception type so the pipeline throws - // QueueStorageExceptionInternal (a subtype of HttpResponseException), which the error mapping below maps - // to the public QueueStorageException. The durable fix is the tspconfig 'default-http-exception-type' - // option; this keeps the customization self-sufficient regardless of that setting. ast.findAll(SingleMemberAnnotationExpr.class).forEach(anno -> { if (anno.getNameAsString().equals("UnexpectedResponseExceptionType") && "HttpResponseException.class".equals(anno.getMemberValue().toString())) { From 54c4a4372c204e04ae371db1303b0c97adcc715d Mon Sep 17 00:00:00 2001 From: Local Merge Date: Wed, 15 Jul 2026 18:11:14 +0530 Subject: [PATCH 04/13] remove client comments --- .../main/java/com/azure/storage/queue/QueueAsyncClient.java | 4 ---- .../src/main/java/com/azure/storage/queue/QueueClient.java | 1 - .../main/java/com/azure/storage/queue/QueueClientBuilder.java | 4 ---- .../java/com/azure/storage/queue/QueueServiceAsyncClient.java | 3 --- .../main/java/com/azure/storage/queue/QueueServiceClient.java | 3 --- .../azure/storage/queue/implementation/util/ModelHelper.java | 3 --- 6 files changed, 18 deletions(-) diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java index 138f20d0e2e1..1e06193a1ebd 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java @@ -135,7 +135,6 @@ public final class QueueAsyncClient { * @return the URL of the storage queue */ public String getQueueUrl() { - // The implementation's base URL is already queue-qualified (endpoint + "/" + queueName), so it is the queue URL. return client.getUrl(); } @@ -959,9 +958,6 @@ public Mono> sendMessageWithResponse(BinaryData mess return withContext(context -> Mono.fromCallable(() -> ModelHelper.encodeMessage(message, messageEncoding)) .flatMap(messageText -> { QueueMessage queueMessage = new QueueMessage(messageText); - // Protocol mapping (see MessagesImpl.enqueueWithResponseAsync Javadoc): the message body is the - // XML-serialized QueueMessage; visibility timeout and time-to-live are the "visibilitytimeout" and - // "messagettl" query parameters; the response body is a QueueMessagesList of SendMessageResult. RequestOptions requestOptions = ModelHelper.requestOptions(context); ModelHelper.addOptionalQueryParam(requestOptions, "visibilitytimeout", visibilityTimeoutInSeconds); ModelHelper.addOptionalQueryParam(requestOptions, "messagettl", timeToLiveInSeconds); diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java index dc26f75cd6a2..e04f5a7e7f73 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java @@ -127,7 +127,6 @@ public final class QueueClient { * @return the URL of the storage queue. */ public String getQueueUrl() { - // The implementation's base URL is already queue-qualified (endpoint + "/" + queueName), so it is the queue URL. return azureQueueStorage.getUrl(); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java index 26d539bcca30..f19b2485496f 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java @@ -721,10 +721,6 @@ private AzureQueueStorageImpl createAzureQueueStorageImpl(QueueServiceVersion ve endpoint, retryOptions, coreRetryOptions, logOptions, clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); - // The generated protocol implementation addresses every queue-scoped operation relative to the base URL - // (for example @Put("/"), @Get("?comp=metadata"), @Get("/messages")) with no queueName parameter. The queue - // name is therefore carried in the implementation's base URL rather than passed per call, matching the - // per-queue endpoint semantics of the TypeSpec-generated client. return new AzureQueueStorageImpl(pipeline, endpoint + "/" + queueName, version); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java index b6f035421ee5..b67e95d9cf82 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java @@ -134,9 +134,6 @@ public QueueMessageEncoding getMessageEncoding() { * @return QueueAsyncClient that interacts with the specified queue */ public QueueAsyncClient getQueueAsyncClient(String queueName) { - // The service-level implementation's base URL is the account endpoint. A queue client addresses a specific - // queue, so build a new implementation whose base URL is queue-qualified (endpoint + "/" + queueName), - // matching the per-queue endpoint semantics of the generated protocol layer. AzureQueueStorageImpl queueStorage = new AzureQueueStorageImpl(client.getHttpPipeline(), client.getSerializerAdapter(), client.getUrl() + "/" + queueName, client.getServiceVersion()); QueueClient queueClient = new QueueClient(queueStorage, queueName, accountName, serviceVersion, messageEncoding, diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java index 7b36dda108c1..e9d76849ea83 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java @@ -143,9 +143,6 @@ public QueueMessageEncoding getMessageEncoding() { * @return QueueClient that interacts with the specified queue */ public QueueClient getQueueClient(String queueName) { - // The service-level implementation's base URL is the account endpoint. A queue client addresses a specific - // queue, so build a new implementation whose base URL is queue-qualified (endpoint + "/" + queueName), - // matching the per-queue endpoint semantics of the generated protocol layer. AzureQueueStorageImpl queueStorage = new AzureQueueStorageImpl(this.azureQueueStorage.getHttpPipeline(), this.azureQueueStorage.getSerializerAdapter(), this.azureQueueStorage.getUrl() + "/" + queueName, this.azureQueueStorage.getServiceVersion()); diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java index 94033767205e..b5d79109cbfb 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java @@ -237,9 +237,6 @@ public static RequestOptions listQueuesRequestOptions(Context context, String pr addOptionalQueryParam(requestOptions, "prefix", prefix); addOptionalQueryParam(requestOptions, "marker", marker); addOptionalQueryParam(requestOptions, "maxresults", maxResults); - // The AutoRest client serialized 'include' unconditionally (as a CSV collection query parameter), emitting an - // empty 'include=' when no include options were requested. Preserve that wire shape so the request matches the - // service contract (and recordings); an empty value is a no-op for the service. requestOptions.addQueryParam("include", (include == null || include.isEmpty()) ? "" : String.join(",", include)); return requestOptions; From 4ffb626fdc0fc45ca580c928d8cbc6e5cdad1f85 Mon Sep 17 00:00:00 2001 From: Local Merge Date: Tue, 21 Jul 2026 16:41:06 +0530 Subject: [PATCH 05/13] fixing code review comments --- .../main/java/QueueStorageCustomizations.java | 63 ++++------ .../queue/QueueServiceAsyncClient.java | 1 - .../queue/implementation/QueuesImpl.java | 16 +-- .../models/ListOfSentMessage.java | 114 ------------------ .../implementation/models/PeekedMessages.java | 113 ----------------- .../models/ReceivedMessages.java | 113 ----------------- .../models/SignedIdentifiers.java | 114 ------------------ .../implementation/models/StorageError.java | 113 ----------------- .../models/StorageErrorException.java | 42 ------- .../implementation/util/ModelHelper.java | 5 +- .../queue/models/QueueServiceStatistics.java | 5 +- .../azure-storage-queue_metadata.json | 2 +- .../azure/storage/queue/QueueTestBase.java | 5 +- .../azure-storage-queue/tsp-location.yaml | 4 +- 14 files changed, 44 insertions(+), 666 deletions(-) delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/StorageError.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/StorageErrorException.java diff --git a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java index 48ca783e58e7..29e611e9127c 100644 --- a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java +++ b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java @@ -53,6 +53,16 @@ public class QueueStorageCustomizations extends Customization { "QueuesServiceVersion.java" }; + private static final String IMPL_MODELS_PATH = "src/main/java/com/azure/storage/queue/implementation/models/"; + + // Generated XML wrapper models unused by the hand-written clients (they use the hand-authored *Wrapper types). + private static final String[] UNUSED_GENERATED_MODELS = new String[] { + "ReceivedMessages.java", + "PeekedMessages.java", + "ListOfSentMessage.java", + "SignedIdentifiers.java" + }; + private static final List FLUENT_MODELS = Arrays.asList( "QueueRetentionPolicy", "QueueMetrics", "QueueCorsRule", "QueueAnalyticsLogging", "QueueSignedIdentifier", "GeoReplication", "QueueItem", "QueueServiceStatistics", "SendMessageResult", "UserDelegationKey"); @@ -61,53 +71,14 @@ public class QueueStorageCustomizations extends Customization { public void customize(LibraryCustomization customization, Logger logger) { Editor editor = customization.getRawEditor(); removeGeneratedPublicClients(editor, logger); + removeUnusedGeneratedModels(editor, logger); preserveHandwrittenModuleInfo(editor, logger); retargetServiceVersionReferences(editor, logger); - restoreAccessPolicyDateTimeType(editor, logger); restoreFluentModels(customization, logger); exposeRawListQueuesResponse(customization.getPackage("com.azure.storage.queue.implementation"), logger); updateImplToMapInternalException(customization.getPackage("com.azure.storage.queue.implementation"), logger); } - private static void restoreAccessPolicyDateTimeType(Editor editor, Logger logger) { - String path = "src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java"; - String content = editor.getContents().get(path); - if (content == null) { - logger.info("QueueAccessPolicy.java not present; skipping date-time type restoration."); - return; - } - if (content.contains("private OffsetDateTime startsOn;")) { - logger.info("QueueAccessPolicy already uses OffsetDateTime; skipping."); - return; - } - String updated = content - .replace("import com.azure.core.annotation.Generated;", - "import com.azure.core.annotation.Generated;\n" - + "import com.azure.core.util.CoreUtils;\n" - + "import java.time.OffsetDateTime;\n" - + "import java.time.format.DateTimeFormatter;") - .replace("private String startsOn;", "private OffsetDateTime startsOn;") - .replace("private String expiresOn;", "private OffsetDateTime expiresOn;") - .replace("public String getStartsOn() {", "public OffsetDateTime getStartsOn() {") - .replace("public String getExpiresOn() {", "public OffsetDateTime getExpiresOn() {") - .replace("public QueueAccessPolicy setStartsOn(String startsOn) {", - "public QueueAccessPolicy setStartsOn(OffsetDateTime startsOn) {") - .replace("public QueueAccessPolicy setExpiresOn(String expiresOn) {", - "public QueueAccessPolicy setExpiresOn(OffsetDateTime expiresOn) {") - .replace("xmlWriter.writeStringElement(\"Start\", this.startsOn);", - "xmlWriter.writeStringElement(\"Start\",\n" - + " this.startsOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startsOn));") - .replace("xmlWriter.writeStringElement(\"Expiry\", this.expiresOn);", - "xmlWriter.writeStringElement(\"Expiry\",\n" - + " this.expiresOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiresOn));") - .replace("deserializedQueueAccessPolicy.startsOn = reader.getStringElement();", - "deserializedQueueAccessPolicy.startsOn = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString));") - .replace("deserializedQueueAccessPolicy.expiresOn = reader.getStringElement();", - "deserializedQueueAccessPolicy.expiresOn = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString));"); - editor.replaceFile(path, updated); - logger.info("Restored OffsetDateTime type for QueueAccessPolicy startsOn/expiresOn."); - } - private static void restoreFluentModels(LibraryCustomization customization, Logger logger) { PackageCustomization models = customization.getPackage("com.azure.storage.queue.models"); for (String className : FLUENT_MODELS) { @@ -311,6 +282,18 @@ private static void removeGeneratedPublicClients(Editor editor, Logger logger) { } } + private static void removeUnusedGeneratedModels(Editor editor, Logger logger) { + for (String fileName : UNUSED_GENERATED_MODELS) { + String path = IMPL_MODELS_PATH + fileName; + if (editor.getContents().containsKey(path)) { + editor.removeFile(path); + logger.info("Removed unused generated model {}", path); + } else { + logger.info("Generated model {} not present; skipping removal.", path); + } + } + } + private static void updateImplToMapInternalException(PackageCustomization implPackage, Logger logger) { List implsToUpdate = Arrays.asList("MessageIdsImpl", "MessagesImpl", "QueuesImpl", "ServicesImpl"); for (String implToUpdate : implsToUpdate) { diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java index b67e95d9cf82..b6692ddc20a4 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java index 7efa0cc2b32e..e8c21106de70 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java @@ -443,8 +443,8 @@ public Response setMetadataWithResponse(RequestOptions requestOptions) { * (Required){ * Id: String (Required) * AccessPolicy (Required): { - * Start: String (Optional) - * Expiry: String (Optional) + * Start: OffsetDateTime (Optional) + * Expiry: OffsetDateTime (Optional) * Permission: String (Optional) * } * } @@ -492,8 +492,8 @@ public Mono> getAccessPolicyWithResponseAsync(RequestOption * (Required){ * Id: String (Required) * AccessPolicy (Required): { - * Start: String (Optional) - * Expiry: String (Optional) + * Start: OffsetDateTime (Optional) + * Expiry: OffsetDateTime (Optional) * Permission: String (Optional) * } * } @@ -550,8 +550,8 @@ public Response getAccessPolicyWithResponse(RequestOptions requestOp * (Required){ * Id: String (Required) * AccessPolicy (Required): { - * Start: String (Optional) - * Expiry: String (Optional) + * Start: OffsetDateTime (Optional) + * Expiry: OffsetDateTime (Optional) * Permission: String (Optional) * } * } @@ -611,8 +611,8 @@ public Mono> setAccessPolicyWithResponseAsync(RequestOptions requ * (Required){ * Id: String (Required) * AccessPolicy (Required): { - * Start: String (Optional) - * Expiry: String (Optional) + * Start: OffsetDateTime (Optional) + * Expiry: OffsetDateTime (Optional) * Permission: String (Optional) * } * } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java deleted file mode 100644 index ea2dad5dedf7..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.storage.queue.models.SendMessageResult; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import java.util.ArrayList; -import java.util.List; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * The response of send message. - */ -@Immutable -public final class ListOfSentMessage implements XmlSerializable { - - /* - * The list of sent messages. - */ - @Generated - private final List items; - - /** - * Creates an instance of ListOfSentMessage class. - * - * @param items the items value to set. - */ - @Generated - private ListOfSentMessage(List items) { - this.items = items; - } - - /** - * Get the items property: The list of sent messages. - * - * @return the items value. - */ - @Generated - public List getItems() { - return this.items; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - if (this.items != null) { - for (SendMessageResult element : this.items) { - xmlWriter.writeXml(element, "QueueMessage"); - } - } - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of ListOfSentMessage from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of ListOfSentMessage if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws IllegalStateException If the deserialized XML object was missing any required properties. - * @throws XMLStreamException If an error occurs while reading the ListOfSentMessage. - */ - @Generated - public static ListOfSentMessage fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of ListOfSentMessage from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of ListOfSentMessage if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws IllegalStateException If the deserialized XML object was missing any required properties. - * @throws XMLStreamException If an error occurs while reading the ListOfSentMessage. - */ - @Generated - public static ListOfSentMessage fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - List items = null; - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - if ("QueueMessage".equals(elementName.getLocalPart())) { - if (items == null) { - items = new ArrayList<>(); - } - items.add(SendMessageResult.fromXml(reader, "QueueMessage")); - } else { - reader.skipElement(); - } - } - return new ListOfSentMessage(items); - }); - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java deleted file mode 100644 index c56803f6fb7f..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import java.util.ArrayList; -import java.util.List; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * The response of peek messages. - */ -@Immutable -public final class PeekedMessages implements XmlSerializable { - - /* - * The list of peeked messages. - */ - @Generated - private final List items; - - /** - * Creates an instance of PeekedMessages class. - * - * @param items the items value to set. - */ - @Generated - private PeekedMessages(List items) { - this.items = items; - } - - /** - * Get the items property: The list of peeked messages. - * - * @return the items value. - */ - @Generated - public List getItems() { - return this.items; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - if (this.items != null) { - for (PeekedMessageItemInternal element : this.items) { - xmlWriter.writeXml(element, "QueueMessage"); - } - } - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of PeekedMessages from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of PeekedMessages if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws IllegalStateException If the deserialized XML object was missing any required properties. - * @throws XMLStreamException If an error occurs while reading the PeekedMessages. - */ - @Generated - public static PeekedMessages fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of PeekedMessages from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of PeekedMessages if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws IllegalStateException If the deserialized XML object was missing any required properties. - * @throws XMLStreamException If an error occurs while reading the PeekedMessages. - */ - @Generated - public static PeekedMessages fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - List items = null; - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - if ("QueueMessage".equals(elementName.getLocalPart())) { - if (items == null) { - items = new ArrayList<>(); - } - items.add(PeekedMessageItemInternal.fromXml(reader, "QueueMessage")); - } else { - reader.skipElement(); - } - } - return new PeekedMessages(items); - }); - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java deleted file mode 100644 index 6b03fc98c969..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import java.util.ArrayList; -import java.util.List; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * The response of receive messages. - */ -@Immutable -public final class ReceivedMessages implements XmlSerializable { - - /* - * The list of received messages. - */ - @Generated - private final List items; - - /** - * Creates an instance of ReceivedMessages class. - * - * @param items the items value to set. - */ - @Generated - private ReceivedMessages(List items) { - this.items = items; - } - - /** - * Get the items property: The list of received messages. - * - * @return the items value. - */ - @Generated - public List getItems() { - return this.items; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - if (this.items != null) { - for (QueueMessageItemInternal element : this.items) { - xmlWriter.writeXml(element, "QueueMessage"); - } - } - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of ReceivedMessages from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of ReceivedMessages if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws IllegalStateException If the deserialized XML object was missing any required properties. - * @throws XMLStreamException If an error occurs while reading the ReceivedMessages. - */ - @Generated - public static ReceivedMessages fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of ReceivedMessages from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of ReceivedMessages if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws IllegalStateException If the deserialized XML object was missing any required properties. - * @throws XMLStreamException If an error occurs while reading the ReceivedMessages. - */ - @Generated - public static ReceivedMessages fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueMessagesList" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - List items = null; - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - if ("QueueMessage".equals(elementName.getLocalPart())) { - if (items == null) { - items = new ArrayList<>(); - } - items.add(QueueMessageItemInternal.fromXml(reader, "QueueMessage")); - } else { - reader.skipElement(); - } - } - return new ReceivedMessages(items); - }); - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java deleted file mode 100644 index a1d584d78983..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.storage.queue.models.QueueSignedIdentifier; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import java.util.ArrayList; -import java.util.List; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * An array of signed identifiers. - */ -@Immutable -public final class SignedIdentifiers implements XmlSerializable { - - /* - * The list of signed identifiers. - */ - @Generated - private final List items; - - /** - * Creates an instance of SignedIdentifiers class. - * - * @param items the items value to set. - */ - @Generated - public SignedIdentifiers(List items) { - this.items = items; - } - - /** - * Get the items property: The list of signed identifiers. - * - * @return the items value. - */ - @Generated - public List getItems() { - return this.items; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "SignedIdentifiers" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - if (this.items != null) { - for (QueueSignedIdentifier element : this.items) { - xmlWriter.writeXml(element, "SignedIdentifier"); - } - } - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of SignedIdentifiers from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of SignedIdentifiers if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws IllegalStateException If the deserialized XML object was missing any required properties. - * @throws XMLStreamException If an error occurs while reading the SignedIdentifiers. - */ - @Generated - public static SignedIdentifiers fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of SignedIdentifiers from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of SignedIdentifiers if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws IllegalStateException If the deserialized XML object was missing any required properties. - * @throws XMLStreamException If an error occurs while reading the SignedIdentifiers. - */ - @Generated - public static SignedIdentifiers fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "SignedIdentifiers" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - List items = null; - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - if ("SignedIdentifier".equals(elementName.getLocalPart())) { - if (items == null) { - items = new ArrayList<>(); - } - items.add(QueueSignedIdentifier.fromXml(reader, "SignedIdentifier")); - } else { - reader.skipElement(); - } - } - return new SignedIdentifiers(items); - }); - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/StorageError.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/StorageError.java deleted file mode 100644 index ade7d70ebfc0..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/StorageError.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * The StorageError model. - */ -@Fluent -public final class StorageError implements XmlSerializable { - /* - * The Message property. - */ - @Generated - private String message; - - /** - * Creates an instance of StorageError class. - */ - @Generated - public StorageError() { - } - - /** - * Get the message property: The Message property. - * - * @return the message value. - */ - @Generated - public String getMessage() { - return this.message; - } - - /** - * Set the message property: The Message property. - * - * @param message the message value to set. - * @return the StorageError object itself. - */ - @Generated - public StorageError setMessage(String message) { - this.message = message; - return this; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "StorageError" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - xmlWriter.writeStringElement("Message", this.message); - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of StorageError from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of StorageError if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws XMLStreamException If an error occurs while reading the StorageError. - */ - @Generated - public static StorageError fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of StorageError from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of StorageError if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws XMLStreamException If an error occurs while reading the StorageError. - */ - @Generated - public static StorageError fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "StorageError" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - StorageError deserializedStorageError = new StorageError(); - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - - if ("Message".equals(elementName.getLocalPart())) { - deserializedStorageError.message = reader.getStringElement(); - } else { - reader.skipElement(); - } - } - - return deserializedStorageError; - }); - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/StorageErrorException.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/StorageErrorException.java deleted file mode 100644 index 5b1aa602fce0..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/StorageErrorException.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.exception.HttpResponseException; -import com.azure.core.http.HttpResponse; - -/** - * Exception thrown for an invalid response with StorageError information. - */ -public final class StorageErrorException extends HttpResponseException { - /** - * Initializes a new instance of the StorageErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - */ - public StorageErrorException(String message, HttpResponse response) { - super(message, response); - } - - /** - * Initializes a new instance of the StorageErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - * @param value the deserialized response value. - */ - public StorageErrorException(String message, HttpResponse response, StorageError value) { - super(message, response, value); - } - - /** - * {@inheritDoc} - */ - @Override - public StorageError getValue() { - return (StorageError) super.getValue(); - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java index b5d79109cbfb..01552760f45d 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java @@ -237,8 +237,9 @@ public static RequestOptions listQueuesRequestOptions(Context context, String pr addOptionalQueryParam(requestOptions, "prefix", prefix); addOptionalQueryParam(requestOptions, "marker", marker); addOptionalQueryParam(requestOptions, "maxresults", maxResults); - requestOptions.addQueryParam("include", - (include == null || include.isEmpty()) ? "" : String.join(",", include)); + if (include != null && !include.isEmpty()) { + requestOptions.addQueryParam("include", String.join(",", include)); + } return requestOptions; } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java index 62921faa7ba6..11ac770f28d4 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java @@ -53,7 +53,8 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "QueueServiceStats" : rootElementName; + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "StorageServiceStats" : rootElementName; xmlWriter.writeStartElement(rootElementName); xmlWriter.writeXml(this.geoReplication, "GeoReplication"); return xmlWriter.writeEndElement(); @@ -86,7 +87,7 @@ public static QueueServiceStatistics fromXml(XmlReader xmlReader) throws XMLStre public static QueueServiceStatistics fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "QueueServiceStats" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "StorageServiceStats" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { QueueServiceStatistics deserializedQueueServiceStatistics = new QueueServiceStatistics(); while (reader.nextElement() != XmlToken.END_ELEMENT) { diff --git a/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json b/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json index b6f768c4b989..68480aecff28 100644 --- a/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json +++ b/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Storage.Queues":"2026-04-06"},"crossLanguagePackageId":"Storage.Queues","crossLanguageVersion":"7a46acf65985","crossLanguageDefinitions":{"com.azure.storage.queue.AzureQueueStorageBuilder":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsAsyncClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient":"Storage.Queues","com.azure.storage.queue.MessageIdsClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessagesAsyncClient":"Storage.Queues","com.azure.storage.queue.MessagesAsyncClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesAsyncClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient":"Storage.Queues","com.azure.storage.queue.MessagesClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.QueueAsyncClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueAsyncClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueAsyncClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.ServiceAsyncClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceAsyncClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceAsyncClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceAsyncClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.implementation.models.KeyInfo":"Storage.Queues.KeyInfo","com.azure.storage.queue.implementation.models.ListOfSentMessage":"Storage.Queues.ListOfSentMessage","com.azure.storage.queue.implementation.models.ListQueuesIncludeType":"Storage.Queues.ListQueuesIncludeType","com.azure.storage.queue.implementation.models.PeekedMessageItemInternal":"Storage.Queues.PeekedMessage","com.azure.storage.queue.implementation.models.PeekedMessages":"Storage.Queues.PeekedMessages","com.azure.storage.queue.implementation.models.QueueMessage":"Storage.Queues.QueueMessage","com.azure.storage.queue.implementation.models.QueueMessageItemInternal":"Storage.Queues.ReceivedMessage","com.azure.storage.queue.implementation.models.ReceivedMessages":"Storage.Queues.ReceivedMessages","com.azure.storage.queue.implementation.models.SignedIdentifiers":"Storage.Queues.SignedIdentifiers","com.azure.storage.queue.models.GeoReplication":"Storage.Queues.GeoReplication","com.azure.storage.queue.models.GeoReplicationStatus":"Storage.Queues.GeoReplicationStatus","com.azure.storage.queue.models.QueueAccessPolicy":"Storage.Queues.AccessPolicy","com.azure.storage.queue.models.QueueAnalyticsLogging":"Storage.Queues.Logging","com.azure.storage.queue.models.QueueCorsRule":"Storage.Queues.CorsRule","com.azure.storage.queue.models.QueueItem":"Storage.Queues.QueueItem","com.azure.storage.queue.models.QueueMetrics":"Storage.Queues.Metrics","com.azure.storage.queue.models.QueueRetentionPolicy":"Storage.Queues.RetentionPolicy","com.azure.storage.queue.models.QueueServiceProperties":"Storage.Queues.QueueServiceProperties","com.azure.storage.queue.models.QueueServiceStatistics":"Storage.Queues.QueueServiceStats","com.azure.storage.queue.models.QueueSignedIdentifier":"Storage.Queues.SignedIdentifier","com.azure.storage.queue.models.SendMessageResult":"Storage.Queues.SentMessage","com.azure.storage.queue.models.UserDelegationKey":"Storage.Queues.UserDelegationKey"},"generatedFiles":["src/main/java/com/azure/storage/queue/AzureQueueStorageBuilder.java","src/main/java/com/azure/storage/queue/MessageIdsAsyncClient.java","src/main/java/com/azure/storage/queue/MessageIdsClient.java","src/main/java/com/azure/storage/queue/MessagesAsyncClient.java","src/main/java/com/azure/storage/queue/MessagesClient.java","src/main/java/com/azure/storage/queue/QueueAsyncClient.java","src/main/java/com/azure/storage/queue/QueueClient.java","src/main/java/com/azure/storage/queue/QueuesServiceVersion.java","src/main/java/com/azure/storage/queue/ServiceAsyncClient.java","src/main/java/com/azure/storage/queue/ServiceClient.java","src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java","src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java","src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java","src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java","src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java","src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java","src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java","src/main/java/com/azure/storage/queue/implementation/models/ListQueuesIncludeType.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessage.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java","src/main/java/com/azure/storage/queue/implementation/models/package-info.java","src/main/java/com/azure/storage/queue/implementation/package-info.java","src/main/java/com/azure/storage/queue/models/GeoReplication.java","src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java","src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java","src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java","src/main/java/com/azure/storage/queue/models/QueueCorsRule.java","src/main/java/com/azure/storage/queue/models/QueueItem.java","src/main/java/com/azure/storage/queue/models/QueueMetrics.java","src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java","src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java","src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java","src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java","src/main/java/com/azure/storage/queue/models/SendMessageResult.java","src/main/java/com/azure/storage/queue/models/UserDelegationKey.java","src/main/java/com/azure/storage/queue/models/package-info.java","src/main/java/com/azure/storage/queue/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Storage.Queues":"2026-04-06"},"crossLanguagePackageId":"Storage.Queues","crossLanguageVersion":"7fb804b043c8","crossLanguageDefinitions":{"com.azure.storage.queue.AzureQueueStorageBuilder":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsAsyncClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient":"Storage.Queues","com.azure.storage.queue.MessageIdsClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessagesAsyncClient":"Storage.Queues","com.azure.storage.queue.MessagesAsyncClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesAsyncClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient":"Storage.Queues","com.azure.storage.queue.MessagesClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.QueueAsyncClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueAsyncClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueAsyncClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.ServiceAsyncClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceAsyncClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceAsyncClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceAsyncClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.implementation.models.KeyInfo":"Storage.Queues.KeyInfo","com.azure.storage.queue.implementation.models.ListOfSentMessage":"Storage.Queues.ListOfSentMessage","com.azure.storage.queue.implementation.models.ListQueuesIncludeType":"Storage.Queues.ListQueuesIncludeType","com.azure.storage.queue.implementation.models.PeekedMessageItemInternal":"Storage.Queues.PeekedMessage","com.azure.storage.queue.implementation.models.PeekedMessages":"Storage.Queues.PeekedMessages","com.azure.storage.queue.implementation.models.QueueMessage":"Storage.Queues.QueueMessage","com.azure.storage.queue.implementation.models.QueueMessageItemInternal":"Storage.Queues.ReceivedMessage","com.azure.storage.queue.implementation.models.ReceivedMessages":"Storage.Queues.ReceivedMessages","com.azure.storage.queue.implementation.models.SignedIdentifiers":"Storage.Queues.SignedIdentifiers","com.azure.storage.queue.models.GeoReplication":"Storage.Queues.GeoReplication","com.azure.storage.queue.models.GeoReplicationStatus":"Storage.Queues.GeoReplicationStatus","com.azure.storage.queue.models.QueueAccessPolicy":"Storage.Queues.AccessPolicy","com.azure.storage.queue.models.QueueAnalyticsLogging":"Storage.Queues.Logging","com.azure.storage.queue.models.QueueCorsRule":"Storage.Queues.CorsRule","com.azure.storage.queue.models.QueueItem":"Storage.Queues.QueueItem","com.azure.storage.queue.models.QueueMetrics":"Storage.Queues.Metrics","com.azure.storage.queue.models.QueueRetentionPolicy":"Storage.Queues.RetentionPolicy","com.azure.storage.queue.models.QueueServiceProperties":"Storage.Queues.QueueServiceProperties","com.azure.storage.queue.models.QueueServiceStatistics":"Storage.Queues.QueueServiceStats","com.azure.storage.queue.models.QueueSignedIdentifier":"Storage.Queues.SignedIdentifier","com.azure.storage.queue.models.SendMessageResult":"Storage.Queues.SentMessage","com.azure.storage.queue.models.UserDelegationKey":"Storage.Queues.UserDelegationKey"},"generatedFiles":["src/main/java/com/azure/storage/queue/AzureQueueStorageBuilder.java","src/main/java/com/azure/storage/queue/MessageIdsAsyncClient.java","src/main/java/com/azure/storage/queue/MessageIdsClient.java","src/main/java/com/azure/storage/queue/MessagesAsyncClient.java","src/main/java/com/azure/storage/queue/MessagesClient.java","src/main/java/com/azure/storage/queue/QueueAsyncClient.java","src/main/java/com/azure/storage/queue/QueueClient.java","src/main/java/com/azure/storage/queue/QueuesServiceVersion.java","src/main/java/com/azure/storage/queue/ServiceAsyncClient.java","src/main/java/com/azure/storage/queue/ServiceClient.java","src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java","src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java","src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java","src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java","src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java","src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java","src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java","src/main/java/com/azure/storage/queue/implementation/models/ListQueuesIncludeType.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessage.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java","src/main/java/com/azure/storage/queue/implementation/models/package-info.java","src/main/java/com/azure/storage/queue/implementation/package-info.java","src/main/java/com/azure/storage/queue/models/GeoReplication.java","src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java","src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java","src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java","src/main/java/com/azure/storage/queue/models/QueueCorsRule.java","src/main/java/com/azure/storage/queue/models/QueueItem.java","src/main/java/com/azure/storage/queue/models/QueueMetrics.java","src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java","src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java","src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java","src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java","src/main/java/com/azure/storage/queue/models/SendMessageResult.java","src/main/java/com/azure/storage/queue/models/UserDelegationKey.java","src/main/java/com/azure/storage/queue/models/package-info.java","src/main/java/com/azure/storage/queue/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java index cc82ed6a3ef4..fd88087ef673 100644 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java @@ -49,7 +49,10 @@ public void beforeTest() { // AutoRest recordings captured '.../{queue}?comp=metadata'. The trailing slash is semantically // insignificant to the Queue service (LIVE behavior is identical), so normalize it away for playback // matching rather than treating it as a behavior change. - new TestProxySanitizer("(?/)[?]comp=", "", TestProxySanitizerType.URL).setGroupForReplace("s"))); + new TestProxySanitizer("(?/)[?]comp=", "", TestProxySanitizerType.URL).setGroupForReplace("s"), + // Strip the empty 'include=' left in older recordings; non-empty 'include=metadata' is preserved. + new TestProxySanitizer("(?&include=)(?=&|$)", "", TestProxySanitizerType.URL) + .setGroupForReplace("inc"))); } // Ignore changes to the order of query parameters and wholly ignore the 'sv' (service version) query parameter diff --git a/sdk/storage/azure-storage-queue/tsp-location.yaml b/sdk/storage/azure-storage-queue/tsp-location.yaml index 21c879d17ece..a281a401b678 100644 --- a/sdk/storage/azure-storage-queue/tsp-location.yaml +++ b/sdk/storage/azure-storage-queue/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/storage/data-plane/QueueStorage -commit: e594f9e6853ec4044c9642948466d697c2fd8544 +commit: 3a3ffacef33056f33cdbacb4fd01de9ab91dc4c6 repo: gunjansingh-msft/azure-rest-api-specs -additionalDirectories: +additionalDirectories: [] From ecdfd663089995c04bb1b51ee47b0688e81fa9e5 Mon Sep 17 00:00:00 2001 From: Local Merge Date: Wed, 22 Jul 2026 01:53:09 +0530 Subject: [PATCH 06/13] fixing code review comments --- .../main/java/QueueStorageCustomizations.java | 70 ++++++------------- 1 file changed, 21 insertions(+), 49 deletions(-) diff --git a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java index 29e611e9127c..fdf313150b9a 100644 --- a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java +++ b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java @@ -41,26 +41,23 @@ public class QueueStorageCustomizations extends Customization { private static final String ROOT_FILE_PATH = "src/main/java/com/azure/storage/queue/"; private static final String[] FILES_TO_REMOVE = new String[] { - "QueueClient.java", - "QueueAsyncClient.java", - "ServiceClient.java", - "ServiceAsyncClient.java", - "MessagesClient.java", - "MessagesAsyncClient.java", - "MessageIdsClient.java", - "MessageIdsAsyncClient.java", - "AzureQueueStorageBuilder.java", - "QueuesServiceVersion.java" - }; - - private static final String IMPL_MODELS_PATH = "src/main/java/com/azure/storage/queue/implementation/models/"; - - // Generated XML wrapper models unused by the hand-written clients (they use the hand-authored *Wrapper types). - private static final String[] UNUSED_GENERATED_MODELS = new String[] { - "ReceivedMessages.java", - "PeekedMessages.java", - "ListOfSentMessage.java", - "SignedIdentifiers.java" + ROOT_FILE_PATH + "QueueClient.java", + ROOT_FILE_PATH + "QueueAsyncClient.java", + ROOT_FILE_PATH + "ServiceClient.java", + ROOT_FILE_PATH + "ServiceAsyncClient.java", + ROOT_FILE_PATH + "MessagesClient.java", + ROOT_FILE_PATH + "MessagesAsyncClient.java", + ROOT_FILE_PATH + "MessageIdsClient.java", + ROOT_FILE_PATH + "MessageIdsAsyncClient.java", + ROOT_FILE_PATH + "AzureQueueStorageBuilder.java", + ROOT_FILE_PATH + "QueuesServiceVersion.java", + // Generated XML wrapper models unused by the hand-written clients (they use the hand-authored *Wrapper types). + ROOT_FILE_PATH + "implementation/models/ReceivedMessages.java", + ROOT_FILE_PATH + "implementation/models/PeekedMessages.java", + ROOT_FILE_PATH + "implementation/models/ListOfSentMessage.java", + ROOT_FILE_PATH + "implementation/models/SignedIdentifiers.java", + // Generated module-info replaced by the hand-written module descriptor. + "src/main/java/module-info.java" }; private static final List FLUENT_MODELS = Arrays.asList( @@ -70,9 +67,7 @@ public class QueueStorageCustomizations extends Customization { @Override public void customize(LibraryCustomization customization, Logger logger) { Editor editor = customization.getRawEditor(); - removeGeneratedPublicClients(editor, logger); - removeUnusedGeneratedModels(editor, logger); - preserveHandwrittenModuleInfo(editor, logger); + removeGeneratedFiles(editor, logger); retargetServiceVersionReferences(editor, logger); restoreFluentModels(customization, logger); exposeRawListQueuesResponse(customization.getPackage("com.azure.storage.queue.implementation"), logger); @@ -260,40 +255,17 @@ private static void retargetServiceVersionReferences(Editor editor, Logger logge } } - private static void preserveHandwrittenModuleInfo(Editor editor, Logger logger) { - String path = "src/main/java/module-info.java"; - if (editor.getContents().containsKey(path)) { - editor.removeFile(path); - logger.info("Removed generated module-info.java to preserve the hand-written module descriptor."); - } else { - logger.info("Generated module-info.java not present; nothing to remove."); - } - } - - private static void removeGeneratedPublicClients(Editor editor, Logger logger) { - for (String fileName : FILES_TO_REMOVE) { - String path = ROOT_FILE_PATH + fileName; + private static void removeGeneratedFiles(Editor editor, Logger logger) { + for (String path : FILES_TO_REMOVE) { if (editor.getContents().containsKey(path)) { editor.removeFile(path); - logger.info("Removed generated public client {}", path); + logger.info("Removed generated file {}", path); } else { logger.info("Generated file {} not present; skipping removal.", path); } } } - private static void removeUnusedGeneratedModels(Editor editor, Logger logger) { - for (String fileName : UNUSED_GENERATED_MODELS) { - String path = IMPL_MODELS_PATH + fileName; - if (editor.getContents().containsKey(path)) { - editor.removeFile(path); - logger.info("Removed unused generated model {}", path); - } else { - logger.info("Generated model {} not present; skipping removal.", path); - } - } - } - private static void updateImplToMapInternalException(PackageCustomization implPackage, Logger logger) { List implsToUpdate = Arrays.asList("MessageIdsImpl", "MessagesImpl", "QueuesImpl", "ServicesImpl"); for (String implToUpdate : implsToUpdate) { From c5f26b7b8afbdee58030d25ded59c0a1f9ca2a91 Mon Sep 17 00:00:00 2001 From: Gunjan Singh Date: Tue, 4 Aug 2026 17:17:19 +0530 Subject: [PATCH 07/13] restore queue doc comments, bump spec pin --- .../main/java/QueueStorageCustomizations.java | 114 ++++++++---- .../queue/implementation/ServicesImpl.java | 9 +- .../queue/implementation/models/KeyInfo.java | 20 ++- .../models/PeekedMessageItemInternal.java | 19 +- .../implementation/models/QueueMessage.java | 11 +- .../models/QueueMessageItemInternal.java | 23 +-- .../implementation/models/package-info.java | 3 +- .../queue/implementation/package-info.java | 1 + .../storage/queue/models/GeoReplication.java | 60 ++++--- .../queue/models/GeoReplicationStatus.java | 8 +- .../queue/models/QueueAccessPolicy.java | 40 +++-- .../queue/models/QueueAnalyticsLogging.java | 121 ++++++++----- .../storage/queue/models/QueueCorsRule.java | 142 ++++++++++----- .../azure/storage/queue/models/QueueItem.java | 55 +++--- .../storage/queue/models/QueueMetrics.java | 55 +++--- .../queue/models/QueueRetentionPolicy.java | 44 +++-- .../queue/models/QueueServiceProperties.java | 134 +++++++------- .../queue/models/QueueServiceStatistics.java | 35 ++-- .../queue/models/QueueSignedIdentifier.java | 57 +++--- .../queue/models/SendMessageResult.java | 152 ++++++++++------ .../queue/models/UserDelegationKey.java | 170 ++++++++++++------ .../storage/queue/models/package-info.java | 1 + .../com/azure/storage/queue/package-info.java | 1 + .../azure-storage-queue_metadata.json | 2 +- .../azure-storage-queue/tsp-location.yaml | 2 +- 25 files changed, 792 insertions(+), 487 deletions(-) diff --git a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java index fdf313150b9a..49bb171bd868 100644 --- a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java +++ b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java @@ -26,6 +26,8 @@ import com.github.javaparser.ast.stmt.TryStmt; import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.ast.type.Type; +import com.github.javaparser.javadoc.Javadoc; +import com.github.javaparser.javadoc.description.JavadocDescription; import org.slf4j.Logger; import java.util.ArrayList; @@ -38,45 +40,54 @@ */ public class QueueStorageCustomizations extends Customization { - private static final String ROOT_FILE_PATH = "src/main/java/com/azure/storage/queue/"; - - private static final String[] FILES_TO_REMOVE = new String[] { - ROOT_FILE_PATH + "QueueClient.java", - ROOT_FILE_PATH + "QueueAsyncClient.java", - ROOT_FILE_PATH + "ServiceClient.java", - ROOT_FILE_PATH + "ServiceAsyncClient.java", - ROOT_FILE_PATH + "MessagesClient.java", - ROOT_FILE_PATH + "MessagesAsyncClient.java", - ROOT_FILE_PATH + "MessageIdsClient.java", - ROOT_FILE_PATH + "MessageIdsAsyncClient.java", - ROOT_FILE_PATH + "AzureQueueStorageBuilder.java", - ROOT_FILE_PATH + "QueuesServiceVersion.java", - // Generated XML wrapper models unused by the hand-written clients (they use the hand-authored *Wrapper types). - ROOT_FILE_PATH + "implementation/models/ReceivedMessages.java", - ROOT_FILE_PATH + "implementation/models/PeekedMessages.java", - ROOT_FILE_PATH + "implementation/models/ListOfSentMessage.java", - ROOT_FILE_PATH + "implementation/models/SignedIdentifiers.java", - // Generated module-info replaced by the hand-written module descriptor. - "src/main/java/module-info.java" - }; - - private static final List FLUENT_MODELS = Arrays.asList( + private static final String PKG_ROOT = "src/main/java/com/azure/storage/queue/"; + + private static final String MODELS_PACKAGE = "com.azure.storage.queue.models"; + + private static final String IMPL_PACKAGE = "com.azure.storage.queue.implementation"; + + // Models that shipped as @Fluent (public no-arg ctor + setters) before the TypeSpec migration. With + // required-fields-as-ctor-args:true these regenerate as @Immutable with a required-args ctor and no setters -- + // a breaking change. restoreFluentModels restores the shipped fluent shape per-model. Expand from the RevApi + // "method removed" report. + private static final List FLUENT_MODELS_TO_RESTORE = Arrays.asList( "QueueRetentionPolicy", "QueueMetrics", "QueueCorsRule", "QueueAnalyticsLogging", "QueueSignedIdentifier", "GeoReplication", "QueueItem", "QueueServiceStatistics", "SendMessageResult", "UserDelegationKey"); + // Generated convenience clients + builder + service version emitted by typespec-java on top of the + // implementation/*Impl operation layer. The public surface is the hand-written clients, so delete the + // generated ones (removeFile is a no-op when a name is absent). + private static final List GENERATED_CLIENTS_TO_REMOVE = Arrays.asList( + "QueueClient", "QueueAsyncClient", + "ServiceClient", "ServiceAsyncClient", + "MessagesClient", "MessagesAsyncClient", + "MessageIdsClient", "MessageIdsAsyncClient", + "AzureQueueStorageBuilder", + "QueuesServiceVersion"); + + // Generated XML wrapper models unused by the hand-written clients (they use the hand-authored *Wrapper types). + private static final List GENERATED_MODELS_TO_REMOVE = Arrays.asList( + "ReceivedMessages", "PeekedMessages", "ListOfSentMessage", "SignedIdentifiers"); + + // module-info.java is hand-authored: the module descriptor carries the full requires/exports/opens (incl. the + // transitive com.azure.storage.common visibility). typespec-java regenerates a minimal version that overwrites + // it, so drop the generated copy and keep the hand-written descriptor. + private static final List GENERATED_DESCRIPTOR_FILES_TO_REMOVE = Arrays.asList( + "src/main/java/module-info.java"); + @Override public void customize(LibraryCustomization customization, Logger logger) { Editor editor = customization.getRawEditor(); removeGeneratedFiles(editor, logger); retargetServiceVersionReferences(editor, logger); restoreFluentModels(customization, logger); - exposeRawListQueuesResponse(customization.getPackage("com.azure.storage.queue.implementation"), logger); - updateImplToMapInternalException(customization.getPackage("com.azure.storage.queue.implementation"), logger); + exposeRawListQueuesResponse(customization.getPackage(IMPL_PACKAGE), logger); + updateImplToMapInternalException(customization.getPackage(IMPL_PACKAGE), logger); } private static void restoreFluentModels(LibraryCustomization customization, Logger logger) { - PackageCustomization models = customization.getPackage("com.azure.storage.queue.models"); - for (String className : FLUENT_MODELS) { + PackageCustomization models = customization.getPackage(MODELS_PACKAGE); + for (String className : FLUENT_MODELS_TO_RESTORE) { if (models.getClass(className) == null) { logger.info("Model {} not present; skipping fluent restoration.", className); continue; @@ -107,6 +118,8 @@ private static void makeModelFluent(ClassOrInterfaceDeclaration clazz, Logger lo new ArrayList<>(clazz.getConstructors()).forEach(ConstructorDeclaration::remove); ConstructorDeclaration ctor = clazz.addConstructor(Modifier.Keyword.PUBLIC); ctor.addMarkerAnnotation("Generated"); + ctor.setJavadocComment( + new Javadoc(JavadocDescription.parseText("Creates an instance of " + className + " class."))); ctor.setBody(new BlockStmt()); for (FieldDeclaration field : clazz.getFields()) { @@ -131,6 +144,13 @@ private static void makeModelFluent(ClassOrInterfaceDeclaration clazz, Logger lo setter.addMarkerAnnotation("Generated"); setter.setType(className); setter.addParameter(new Parameter(accessorType, fieldName)); + String description = accessorDescription(clazz, fieldName); + String summary = description == null + ? "Set the " + fieldName + " property." + : "Set the " + fieldName + " property: " + description; + setter.setJavadocComment(new Javadoc(JavadocDescription.parseText(summary)) + .addBlockTag("param", fieldName, "the " + fieldName + " value to set.") + .addBlockTag("return", "the " + className + " object itself.")); setter.setBody(StaticJavaParser.parseBlock(body)); } @@ -199,6 +219,20 @@ private static Optional accessorReturnType(ClassOrInterfaceDeclaration cla return Optional.empty(); } + private static String accessorDescription(ClassOrInterfaceDeclaration clazz, String fieldName) { + String suffix = capitalize(fieldName); + for (String prefix : new String[] { "get", "is" }) { + for (MethodDeclaration getter : clazz.getMethodsByName(prefix + suffix)) { + if (getter.getParameters().isEmpty() && getter.getJavadoc().isPresent()) { + String text = getter.getJavadoc().get().getDescription().toText().trim(); + int idx = text.indexOf(": "); + return idx >= 0 ? text.substring(idx + 2).trim() : text; + } + } + } + return null; + } + private static String capitalize(String value) { return Character.toUpperCase(value.charAt(0)) + value.substring(1); } @@ -240,7 +274,7 @@ private static void exposeRawListQueuesResponse(PackageCustomization implPackage } private static void retargetServiceVersionReferences(Editor editor, Logger logger) { - String implDir = "src/main/java/com/azure/storage/queue/implementation/"; + String implDir = PKG_ROOT + "implementation/"; for (String fileName : new String[] { "AzureQueueStorageImpl.java", "ServicesImpl.java", "QueuesImpl.java", "MessagesImpl.java", "MessageIdsImpl.java" }) { @@ -256,13 +290,23 @@ private static void retargetServiceVersionReferences(Editor editor, Logger logge } private static void removeGeneratedFiles(Editor editor, Logger logger) { - for (String path : FILES_TO_REMOVE) { - if (editor.getContents().containsKey(path)) { - editor.removeFile(path); - logger.info("Removed generated file {}", path); - } else { - logger.info("Generated file {} not present; skipping removal.", path); - } + for (String className : GENERATED_CLIENTS_TO_REMOVE) { + removeFileIfPresent(editor, PKG_ROOT + className + ".java", logger); + } + for (String modelName : GENERATED_MODELS_TO_REMOVE) { + removeFileIfPresent(editor, PKG_ROOT + "implementation/models/" + modelName + ".java", logger); + } + for (String path : GENERATED_DESCRIPTOR_FILES_TO_REMOVE) { + removeFileIfPresent(editor, path, logger); + } + } + + private static void removeFileIfPresent(Editor editor, String path, Logger logger) { + if (editor.getContents().containsKey(path)) { + editor.removeFile(path); + logger.info("Removed generated file {}", path); + } else { + logger.info("Generated file {} not present; skipping removal.", path); } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java index 39444fbc7327..f7de7be8f206 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java @@ -347,7 +347,7 @@ public Response setPropertiesWithResponse(BinaryData queueServicePropertie * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the service properties along with {@link Response} on successful completion of {@link Mono}. + * @return storage Service Properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPropertiesWithResponseAsync(RequestOptions requestOptions) { @@ -412,7 +412,7 @@ public Mono> getPropertiesWithResponseAsync(RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the service properties along with {@link Response}. + * @return storage Service Properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(RequestOptions requestOptions) { @@ -457,8 +457,7 @@ public Response getPropertiesWithResponse(RequestOptions requestOpti * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return statistics for the storage queue service along with {@link Response} on successful completion of - * {@link Mono}. + * @return stats for the storage service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getStatisticsWithResponseAsync(RequestOptions requestOptions) { @@ -501,7 +500,7 @@ public Mono> getStatisticsWithResponseAsync(RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return statistics for the storage queue service along with {@link Response}. + * @return stats for the storage service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getStatisticsWithResponse(RequestOptions requestOptions) { diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java index 32ba77103eb9..099ab42e72bc 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.storage.queue.implementation.models; import com.azure.core.annotation.Fluent; @@ -20,7 +21,6 @@ */ @Fluent public final class KeyInfo implements XmlSerializable { - /* * The date-time the key is active in ISO 8601 UTC time. */ @@ -41,7 +41,7 @@ public final class KeyInfo implements XmlSerializable { /** * Creates an instance of KeyInfo class. - * + * * @param expiry the expiry value to set. */ @Generated @@ -51,7 +51,7 @@ public KeyInfo(OffsetDateTime expiry) { /** * Get the start property: The date-time the key is active in ISO 8601 UTC time. - * + * * @return the start value. */ @Generated @@ -61,7 +61,7 @@ public OffsetDateTime getStart() { /** * Set the start property: The date-time the key is active in ISO 8601 UTC time. - * + * * @param start the start value to set. * @return the KeyInfo object itself. */ @@ -73,7 +73,7 @@ public KeyInfo setStart(OffsetDateTime start) { /** * Get the expiry property: The date-time the key expires in ISO 8601 UTC time. - * + * * @return the expiry value. */ @Generated @@ -83,7 +83,7 @@ public OffsetDateTime getExpiry() { /** * Get the delegatedUserTenantId property: The delegated user tenant ID in Entra ID. - * + * * @return the delegatedUserTenantId value. */ @Generated @@ -93,7 +93,7 @@ public String getDelegatedUserTenantId() { /** * Set the delegatedUserTenantId property: The delegated user tenant ID in Entra ID. - * + * * @param delegatedUserTenantId the delegatedUserTenantId value to set. * @return the KeyInfo object itself. */ @@ -124,7 +124,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of KeyInfo from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of KeyInfo if the XmlReader was pointing to an instance of it, or null if it was pointing to * XML null. @@ -138,7 +138,7 @@ public static KeyInfo fromXml(XmlReader xmlReader) throws XMLStreamException { /** * Reads an instance of KeyInfo from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -157,6 +157,7 @@ public static KeyInfo fromXml(XmlReader xmlReader, String rootElementName) throw String delegatedUserTenantId = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); + if ("Start".equals(elementName.getLocalPart())) { start = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("Expiry".equals(elementName.getLocalPart())) { @@ -170,6 +171,7 @@ public static KeyInfo fromXml(XmlReader xmlReader, String rootElementName) throw KeyInfo deserializedKeyInfo = new KeyInfo(expiry); deserializedKeyInfo.start = start; deserializedKeyInfo.delegatedUserTenantId = delegatedUserTenantId; + return deserializedKeyInfo; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java index 50791009388c..5890b34d8467 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.storage.queue.implementation.models; import com.azure.core.annotation.Generated; @@ -20,7 +21,6 @@ */ @Immutable public final class PeekedMessageItemInternal implements XmlSerializable { - /* * The ID of the message. */ @@ -53,7 +53,7 @@ public final class PeekedMessageItemInternal implements XmlSerializable { - /* * The content of the message. */ @@ -26,7 +26,7 @@ public final class QueueMessage implements XmlSerializable { /** * Creates an instance of QueueMessage class. - * + * * @param messageText the messageText value to set. */ @Generated @@ -36,7 +36,7 @@ public QueueMessage(String messageText) { /** * Get the messageText property: The content of the message. - * + * * @return the messageText value. */ @Generated @@ -61,7 +61,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueMessage from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueMessage if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. @@ -75,7 +75,7 @@ public static QueueMessage fromXml(XmlReader xmlReader) throws XMLStreamExceptio /** * Reads an instance of QueueMessage from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -92,6 +92,7 @@ public static QueueMessage fromXml(XmlReader xmlReader, String rootElementName) String messageText = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); + if ("MessageText".equals(elementName.getLocalPart())) { messageText = reader.getStringElement(); } else { diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java index 57d6feb08634..14609d256a58 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.storage.queue.implementation.models; import com.azure.core.annotation.Generated; @@ -20,7 +21,6 @@ */ @Immutable public final class QueueMessageItemInternal implements XmlSerializable { - /* * The ID of the message. */ @@ -66,7 +66,7 @@ public final class QueueMessageItemInternal implements XmlSerializable * Package containing the data models for Queues. - * */ package com.azure.storage.queue.implementation.models; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/package-info.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/package-info.java index b40fac6f4256..9f3fcc695bcd 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/package-info.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/package-info.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. + /** * Package containing the implementations for Queues. */ diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java index 870acfe1dad1..dfbdfcf35880 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java @@ -16,7 +16,7 @@ import javax.xml.stream.XMLStreamException; /** - * Geo replication information for the secondary storage location. + * The GeoReplication model. */ @Fluent public final class GeoReplication implements XmlSerializable { @@ -35,10 +35,6 @@ public final class GeoReplication implements XmlSerializable { @Generated private DateTimeRfc1123 lastSyncTime; - @Generated - public GeoReplication() { - } - /** * Get the status property: The status of the secondary location. * @@ -49,12 +45,6 @@ public GeoReplicationStatus getStatus() { return this.status; } - @Generated - public GeoReplication setStatus(GeoReplicationStatus status) { - this.status = status; - return this; - } - /** * Get the lastSyncTime property: A GMT date/time value, to the second. All primary writes preceding this value are * guaranteed to be available @@ -71,16 +61,6 @@ public OffsetDateTime getLastSyncTime() { return this.lastSyncTime.getDateTime(); } - @Generated - public GeoReplication setLastSyncTime(OffsetDateTime lastSyncTime) { - if (lastSyncTime == null) { - this.lastSyncTime = null; - } else { - this.lastSyncTime = new DateTimeRfc1123(lastSyncTime); - } - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -151,4 +131,42 @@ public static GeoReplication fromXml(XmlReader xmlReader, String rootElementName } }); } + + /** + * Creates an instance of GeoReplication class. + */ + @Generated + public GeoReplication() { + } + + /** + * Set the status property: The status of the secondary location. + * + * @param status the status value to set. + * @return the GeoReplication object itself. + */ + @Generated + public GeoReplication setStatus(GeoReplicationStatus status) { + this.status = status; + return this; + } + + /** + * Set the lastSyncTime property: A GMT date/time value, to the second. All primary writes preceding this value are + * guaranteed to be available + * for read operations at the secondary. Primary writes after this point in time may or may not be available + * for reads. + * + * @param lastSyncTime the lastSyncTime value to set. + * @return the GeoReplication object itself. + */ + @Generated + public GeoReplication setLastSyncTime(OffsetDateTime lastSyncTime) { + if (lastSyncTime == null) { + this.lastSyncTime = null; + } else { + this.lastSyncTime = new DateTimeRfc1123(lastSyncTime); + } + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java index d763d599c1ac..de69fcfa5cb5 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.storage.queue.models; import com.azure.core.annotation.Generated; @@ -11,7 +12,6 @@ * The geo replication status. */ public final class GeoReplicationStatus extends ExpandableStringEnum { - /** * The geo replication is live. */ @@ -32,7 +32,7 @@ public final class GeoReplicationStatus extends ExpandableStringEnum { - /* - * The date-time the policy is active. + * the date-time the policy is active. */ @Generated private OffsetDateTime startsOn; /* - * The date-time the policy expires. + * the date-time the policy expires. */ @Generated private OffsetDateTime expiresOn; /* - * The permissions for the policy. + * the permissions for the acl policy. */ @Generated private String permissions; @@ -47,8 +47,8 @@ public QueueAccessPolicy() { } /** - * Get the startsOn property: The date-time the policy is active. - * + * Get the startsOn property: the date-time the policy is active. + * * @return the startsOn value. */ @Generated @@ -57,8 +57,8 @@ public OffsetDateTime getStartsOn() { } /** - * Set the startsOn property: The date-time the policy is active. - * + * Set the startsOn property: the date-time the policy is active. + * * @param startsOn the startsOn value to set. * @return the QueueAccessPolicy object itself. */ @@ -69,8 +69,8 @@ public QueueAccessPolicy setStartsOn(OffsetDateTime startsOn) { } /** - * Get the expiresOn property: The date-time the policy expires. - * + * Get the expiresOn property: the date-time the policy expires. + * * @return the expiresOn value. */ @Generated @@ -79,8 +79,8 @@ public OffsetDateTime getExpiresOn() { } /** - * Set the expiresOn property: The date-time the policy expires. - * + * Set the expiresOn property: the date-time the policy expires. + * * @param expiresOn the expiresOn value to set. * @return the QueueAccessPolicy object itself. */ @@ -91,8 +91,8 @@ public QueueAccessPolicy setExpiresOn(OffsetDateTime expiresOn) { } /** - * Get the permissions property: The permissions for the policy. - * + * Get the permissions property: the permissions for the acl policy. + * * @return the permissions value. */ @Generated @@ -101,8 +101,8 @@ public String getPermissions() { } /** - * Set the permissions property: The permissions for the policy. - * + * Set the permissions property: the permissions for the acl policy. + * * @param permissions the permissions value to set. * @return the QueueAccessPolicy object itself. */ @@ -133,7 +133,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueAccessPolicy from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueAccessPolicy if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. @@ -146,7 +146,7 @@ public static QueueAccessPolicy fromXml(XmlReader xmlReader) throws XMLStreamExc /** * Reads an instance of QueueAccessPolicy from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -162,6 +162,7 @@ public static QueueAccessPolicy fromXml(XmlReader xmlReader, String rootElementN QueueAccessPolicy deserializedQueueAccessPolicy = new QueueAccessPolicy(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); + if ("Start".equals(elementName.getLocalPart())) { deserializedQueueAccessPolicy.startsOn = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); @@ -174,6 +175,7 @@ public static QueueAccessPolicy fromXml(XmlReader xmlReader, String rootElementN reader.skipElement(); } } + return deserializedQueueAccessPolicy; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java index 0acd385d90af..b010b1bc9a93 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java @@ -19,41 +19,37 @@ public final class QueueAnalyticsLogging implements XmlSerializable { /* - * The version of the logging properties. + * The version of Storage Analytics to configure. */ @Generated private String version; /* - * Whether delete operation is logged. + * Indicates whether all delete requests should be logged. */ @Generated private boolean delete; /* - * Whether read operation is logged. + * Indicates whether all read requests should be logged. */ @Generated private boolean read; /* - * Whether write operation is logged. + * Indicates whether all write requests should be logged. */ @Generated private boolean write; /* - * The retention policy of the logs. + * the retention policy. */ @Generated private QueueRetentionPolicy retentionPolicy; - @Generated - public QueueAnalyticsLogging() { - } - /** - * Get the version property: The version of the logging properties. + * Get the version property: The version of Storage Analytics to configure. * * @return the version value. */ @@ -62,14 +58,8 @@ public String getVersion() { return this.version; } - @Generated - public QueueAnalyticsLogging setVersion(String version) { - this.version = version; - return this; - } - /** - * Get the delete property: Whether delete operation is logged. + * Get the delete property: Indicates whether all delete requests should be logged. * * @return the delete value. */ @@ -78,14 +68,8 @@ public boolean isDelete() { return this.delete; } - @Generated - public QueueAnalyticsLogging setDelete(boolean delete) { - this.delete = delete; - return this; - } - /** - * Get the read property: Whether read operation is logged. + * Get the read property: Indicates whether all read requests should be logged. * * @return the read value. */ @@ -94,14 +78,8 @@ public boolean isRead() { return this.read; } - @Generated - public QueueAnalyticsLogging setRead(boolean read) { - this.read = read; - return this; - } - /** - * Get the write property: Whether write operation is logged. + * Get the write property: Indicates whether all write requests should be logged. * * @return the write value. */ @@ -110,14 +88,8 @@ public boolean isWrite() { return this.write; } - @Generated - public QueueAnalyticsLogging setWrite(boolean write) { - this.write = write; - return this; - } - /** - * Get the retentionPolicy property: The retention policy of the logs. + * Get the retentionPolicy property: the retention policy. * * @return the retentionPolicy value. */ @@ -126,12 +98,6 @@ public QueueRetentionPolicy getRetentionPolicy() { return this.retentionPolicy; } - @Generated - public QueueAnalyticsLogging setRetentionPolicy(QueueRetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -213,4 +179,71 @@ public static QueueAnalyticsLogging fromXml(XmlReader xmlReader, String rootElem } }); } + + /** + * Creates an instance of QueueAnalyticsLogging class. + */ + @Generated + public QueueAnalyticsLogging() { + } + + /** + * Set the version property: The version of Storage Analytics to configure. + * + * @param version the version value to set. + * @return the QueueAnalyticsLogging object itself. + */ + @Generated + public QueueAnalyticsLogging setVersion(String version) { + this.version = version; + return this; + } + + /** + * Set the delete property: Indicates whether all delete requests should be logged. + * + * @param delete the delete value to set. + * @return the QueueAnalyticsLogging object itself. + */ + @Generated + public QueueAnalyticsLogging setDelete(boolean delete) { + this.delete = delete; + return this; + } + + /** + * Set the read property: Indicates whether all read requests should be logged. + * + * @param read the read value to set. + * @return the QueueAnalyticsLogging object itself. + */ + @Generated + public QueueAnalyticsLogging setRead(boolean read) { + this.read = read; + return this; + } + + /** + * Set the write property: Indicates whether all write requests should be logged. + * + * @param write the write value to set. + * @return the QueueAnalyticsLogging object itself. + */ + @Generated + public QueueAnalyticsLogging setWrite(boolean write) { + this.write = write; + return this; + } + + /** + * Set the retentionPolicy property: the retention policy. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the QueueAnalyticsLogging object itself. + */ + @Generated + public QueueAnalyticsLogging setRetentionPolicy(QueueRetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java index 14caab32973b..6f037e379db6 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java @@ -13,47 +13,53 @@ import javax.xml.stream.XMLStreamException; /** - * The CORS rules. + * CORS is an HTTP feature that enables a web application running under one domain to access resources in another + * domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from + * calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs + * in another domain. */ @Fluent public final class QueueCorsRule implements XmlSerializable { /* - * The allowed origins. + * The origin domains that are permitted to make a request against the storage service via CORS. The origin domain + * is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with + * the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all + * origin domains to make requests via CORS. */ @Generated private String allowedOrigins; /* - * The allowed methods. + * The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated). */ @Generated private String allowedMethods; /* - * The allowed headers. + * the request headers that the origin domain may specify on the CORS request. */ @Generated private String allowedHeaders; /* - * The exposed headers. + * The response headers that may be sent in the response to the CORS request and exposed by the browser to the + * request issuer. */ @Generated private String exposedHeaders; /* - * The maximum age in seconds. + * The maximum amount time that a browser should cache the preflight OPTIONS request. */ @Generated private int maxAgeInSeconds; - @Generated - public QueueCorsRule() { - } - /** - * Get the allowedOrigins property: The allowed origins. + * Get the allowedOrigins property: The origin domains that are permitted to make a request against the storage + * service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be + * an exact case-sensitive match with the origin that the user age sends to the service. You can also use the + * wildcard character '*' to allow all origin domains to make requests via CORS. * * @return the allowedOrigins value. */ @@ -62,14 +68,9 @@ public String getAllowedOrigins() { return this.allowedOrigins; } - @Generated - public QueueCorsRule setAllowedOrigins(String allowedOrigins) { - this.allowedOrigins = allowedOrigins; - return this; - } - /** - * Get the allowedMethods property: The allowed methods. + * Get the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS + * request. (comma separated). * * @return the allowedMethods value. */ @@ -78,14 +79,8 @@ public String getAllowedMethods() { return this.allowedMethods; } - @Generated - public QueueCorsRule setAllowedMethods(String allowedMethods) { - this.allowedMethods = allowedMethods; - return this; - } - /** - * Get the allowedHeaders property: The allowed headers. + * Get the allowedHeaders property: the request headers that the origin domain may specify on the CORS request. * * @return the allowedHeaders value. */ @@ -94,14 +89,9 @@ public String getAllowedHeaders() { return this.allowedHeaders; } - @Generated - public QueueCorsRule setAllowedHeaders(String allowedHeaders) { - this.allowedHeaders = allowedHeaders; - return this; - } - /** - * Get the exposedHeaders property: The exposed headers. + * Get the exposedHeaders property: The response headers that may be sent in the response to the CORS request and + * exposed by the browser to the request issuer. * * @return the exposedHeaders value. */ @@ -110,14 +100,9 @@ public String getExposedHeaders() { return this.exposedHeaders; } - @Generated - public QueueCorsRule setExposedHeaders(String exposedHeaders) { - this.exposedHeaders = exposedHeaders; - return this; - } - /** - * Get the maxAgeInSeconds property: The maximum age in seconds. + * Get the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS + * request. * * @return the maxAgeInSeconds value. */ @@ -126,12 +111,6 @@ public int getMaxAgeInSeconds() { return this.maxAgeInSeconds; } - @Generated - public QueueCorsRule setMaxAgeInSeconds(int maxAgeInSeconds) { - this.maxAgeInSeconds = maxAgeInSeconds; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -213,4 +192,77 @@ public static QueueCorsRule fromXml(XmlReader xmlReader, String rootElementName) } }); } + + /** + * Creates an instance of QueueCorsRule class. + */ + @Generated + public QueueCorsRule() { + } + + /** + * Set the allowedOrigins property: The origin domains that are permitted to make a request against the storage + * service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be + * an exact case-sensitive match with the origin that the user age sends to the service. You can also use the + * wildcard character '*' to allow all origin domains to make requests via CORS. + * + * @param allowedOrigins the allowedOrigins value to set. + * @return the QueueCorsRule object itself. + */ + @Generated + public QueueCorsRule setAllowedOrigins(String allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Set the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS + * request. (comma separated). + * + * @param allowedMethods the allowedMethods value to set. + * @return the QueueCorsRule object itself. + */ + @Generated + public QueueCorsRule setAllowedMethods(String allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Set the allowedHeaders property: the request headers that the origin domain may specify on the CORS request. + * + * @param allowedHeaders the allowedHeaders value to set. + * @return the QueueCorsRule object itself. + */ + @Generated + public QueueCorsRule setAllowedHeaders(String allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + + /** + * Set the exposedHeaders property: The response headers that may be sent in the response to the CORS request and + * exposed by the browser to the request issuer. + * + * @param exposedHeaders the exposedHeaders value to set. + * @return the QueueCorsRule object itself. + */ + @Generated + public QueueCorsRule setExposedHeaders(String exposedHeaders) { + this.exposedHeaders = exposedHeaders; + return this; + } + + /** + * Set the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS + * request. + * + * @param maxAgeInSeconds the maxAgeInSeconds value to set. + * @return the QueueCorsRule object itself. + */ + @Generated + public QueueCorsRule setMaxAgeInSeconds(int maxAgeInSeconds) { + this.maxAgeInSeconds = maxAgeInSeconds; + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java index 76b6b7f20af1..36a9aff25b15 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueItem.java @@ -21,23 +21,19 @@ public final class QueueItem implements XmlSerializable { /* - * The name of the queue. + * The name of the Queue. */ @Generated private String name; /* - * The metadata of the queue. + * Dictionary of . */ @Generated private Map metadata; - @Generated - public QueueItem() { - } - /** - * Get the name property: The name of the queue. + * Get the name property: The name of the Queue. * * @return the name value. */ @@ -46,14 +42,8 @@ public String getName() { return this.name; } - @Generated - public QueueItem setName(String name) { - this.name = name; - return this; - } - /** - * Get the metadata property: The metadata of the queue. + * Get the metadata property: Dictionary of <string>. * * @return the metadata value. */ @@ -62,12 +52,6 @@ public Map getMetadata() { return this.metadata; } - @Generated - public QueueItem setMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -142,4 +126,35 @@ public static QueueItem fromXml(XmlReader xmlReader, String rootElementName) thr return deserializedQueueItem; }); } + + /** + * Creates an instance of QueueItem class. + */ + @Generated + public QueueItem() { + } + + /** + * Set the name property: The name of the Queue. + * + * @param name the name value to set. + * @return the QueueItem object itself. + */ + @Generated + public QueueItem setName(String name) { + this.name = name; + return this; + } + + /** + * Set the metadata property: Dictionary of <string>. + * + * @param metadata the metadata value to set. + * @return the QueueItem object itself. + */ + @Generated + public QueueItem setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java index f88633ca6b68..c83b5c244444 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueMetrics.java @@ -13,41 +13,37 @@ import javax.xml.stream.XMLStreamException; /** - * The metrics properties. + * a summary of request statistics grouped by API in hour or minute aggregates for queues. */ @Fluent public final class QueueMetrics implements XmlSerializable { /* - * The version of the metrics properties. + * The version of Storage Analytics to configure. */ @Generated private String version; /* - * Whether it is enabled. + * Indicates whether metrics are enabled for the Queue service. */ @Generated private boolean enabled; /* - * Whether to include API in the metrics. + * Indicates whether metrics should generate summary statistics for called API operations. */ @Generated private Boolean includeApis; /* - * The retention policy of the metrics. + * the retention policy. */ @Generated private QueueRetentionPolicy retentionPolicy; - @Generated - public QueueMetrics() { - } - /** - * Get the version property: The version of the metrics properties. + * Get the version property: The version of Storage Analytics to configure. * * @return the version value. */ @@ -57,7 +53,7 @@ public String getVersion() { } /** - * Set the version property: The version of the metrics properties. + * Set the version property: The version of Storage Analytics to configure. * * @param version the version value to set. * @return the QueueMetrics object itself. @@ -69,7 +65,7 @@ public QueueMetrics setVersion(String version) { } /** - * Get the enabled property: Whether it is enabled. + * Get the enabled property: Indicates whether metrics are enabled for the Queue service. * * @return the enabled value. */ @@ -78,14 +74,9 @@ public boolean isEnabled() { return this.enabled; } - @Generated - public QueueMetrics setEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - /** - * Get the includeApis property: Whether to include API in the metrics. + * Get the includeApis property: Indicates whether metrics should generate summary statistics for called API + * operations. * * @return the includeApis value. */ @@ -95,7 +86,8 @@ public Boolean isIncludeApis() { } /** - * Set the includeApis property: Whether to include API in the metrics. + * Set the includeApis property: Indicates whether metrics should generate summary statistics for called API + * operations. * * @param includeApis the includeApis value to set. * @return the QueueMetrics object itself. @@ -107,7 +99,7 @@ public QueueMetrics setIncludeApis(Boolean includeApis) { } /** - * Get the retentionPolicy property: The retention policy of the metrics. + * Get the retentionPolicy property: the retention policy. * * @return the retentionPolicy value. */ @@ -117,7 +109,7 @@ public QueueRetentionPolicy getRetentionPolicy() { } /** - * Set the retentionPolicy property: The retention policy of the metrics. + * Set the retentionPolicy property: the retention policy. * * @param retentionPolicy the retentionPolicy value to set. * @return the QueueMetrics object itself. @@ -202,4 +194,23 @@ public static QueueMetrics fromXml(XmlReader xmlReader, String rootElementName) return deserializedQueueMetrics; }); } + + /** + * Creates an instance of QueueMetrics class. + */ + @Generated + public QueueMetrics() { + } + + /** + * Set the enabled property: Indicates whether metrics are enabled for the Queue service. + * + * @param enabled the enabled value to set. + * @return the QueueMetrics object itself. + */ + @Generated + public QueueMetrics setEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java index 2f54272e1c87..7d112ecde9b7 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java @@ -13,29 +13,26 @@ import javax.xml.stream.XMLStreamException; /** - * The retention policy. + * the retention policy. */ @Fluent public final class QueueRetentionPolicy implements XmlSerializable { /* - * Whether to enable the retention policy. + * Indicates whether a retention policy is enabled for the storage service. */ @Generated private boolean enabled; /* - * The number of days to retain the logs. + * Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than + * this value will be deleted. */ @Generated private Integer days; - @Generated - public QueueRetentionPolicy() { - } - /** - * Get the enabled property: Whether to enable the retention policy. + * Get the enabled property: Indicates whether a retention policy is enabled for the storage service. * * @return the enabled value. */ @@ -44,14 +41,9 @@ public boolean isEnabled() { return this.enabled; } - @Generated - public QueueRetentionPolicy setEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - /** - * Get the days property: The number of days to retain the logs. + * Get the days property: Indicates the number of days that metrics or logging or soft-deleted data should be + * retained. All data older than this value will be deleted. * * @return the days value. */ @@ -61,7 +53,8 @@ public Integer getDays() { } /** - * Set the days property: The number of days to retain the logs. + * Set the days property: Indicates the number of days that metrics or logging or soft-deleted data should be + * retained. All data older than this value will be deleted. * * @param days the days value to set. * @return the QueueRetentionPolicy object itself. @@ -136,4 +129,23 @@ public static QueueRetentionPolicy fromXml(XmlReader xmlReader, String rootEleme return deserializedQueueRetentionPolicy; }); } + + /** + * Creates an instance of QueueRetentionPolicy class. + */ + @Generated + public QueueRetentionPolicy() { + } + + /** + * Set the enabled property: Indicates whether a retention policy is enabled for the storage service. + * + * @param enabled the enabled value to set. + * @return the QueueRetentionPolicy object itself. + */ + @Generated + public QueueRetentionPolicy setEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java index 54ce1163313c..cd3bea54e024 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.storage.queue.models; import com.azure.core.annotation.Fluent; @@ -15,25 +16,30 @@ import javax.xml.stream.XMLStreamException; /** - * The service properties. + * Storage Service Properties. */ @Fluent public final class QueueServiceProperties implements XmlSerializable { + /* + * Azure Analytics Logging settings. + */ + @Generated + private QueueAnalyticsLogging analyticsLogging; /* - * The hour metrics properties. + * A summary of request statistics grouped by API in hourly aggregates for queues. */ @Generated private QueueMetrics hourMetrics; /* - * The minute metrics properties. + * a summary of request statistics grouped by API in minute aggregates for queues. */ @Generated private QueueMetrics minuteMetrics; /* - * The CORS properties. + * The set of CORS rules. */ @Generated private List cors; @@ -46,8 +52,30 @@ public QueueServiceProperties() { } /** - * Get the hourMetrics property: The hour metrics properties. - * + * Get the analyticsLogging property: Azure Analytics Logging settings. + * + * @return the analyticsLogging value. + */ + @Generated + public QueueAnalyticsLogging getAnalyticsLogging() { + return this.analyticsLogging; + } + + /** + * Set the analyticsLogging property: Azure Analytics Logging settings. + * + * @param analyticsLogging the analyticsLogging value to set. + * @return the QueueServiceProperties object itself. + */ + @Generated + public QueueServiceProperties setAnalyticsLogging(QueueAnalyticsLogging analyticsLogging) { + this.analyticsLogging = analyticsLogging; + return this; + } + + /** + * Get the hourMetrics property: A summary of request statistics grouped by API in hourly aggregates for queues. + * * @return the hourMetrics value. */ @Generated @@ -56,8 +84,20 @@ public QueueMetrics getHourMetrics() { } /** - * Get the minuteMetrics property: The minute metrics properties. - * + * Set the hourMetrics property: A summary of request statistics grouped by API in hourly aggregates for queues. + * + * @param hourMetrics the hourMetrics value to set. + * @return the QueueServiceProperties object itself. + */ + @Generated + public QueueServiceProperties setHourMetrics(QueueMetrics hourMetrics) { + this.hourMetrics = hourMetrics; + return this; + } + + /** + * Get the minuteMetrics property: a summary of request statistics grouped by API in minute aggregates for queues. + * * @return the minuteMetrics value. */ @Generated @@ -66,8 +106,20 @@ public QueueMetrics getMinuteMetrics() { } /** - * Get the cors property: The CORS properties. - * + * Set the minuteMetrics property: a summary of request statistics grouped by API in minute aggregates for queues. + * + * @param minuteMetrics the minuteMetrics value to set. + * @return the QueueServiceProperties object itself. + */ + @Generated + public QueueServiceProperties setMinuteMetrics(QueueMetrics minuteMetrics) { + this.minuteMetrics = minuteMetrics; + return this; + } + + /** + * Get the cors property: The set of CORS rules. + * * @return the cors value. */ @Generated @@ -79,8 +131,8 @@ public List getCors() { } /** - * Set the cors property: The CORS properties. - * + * Set the cors property: The set of CORS rules. + * * @param cors the cors value to set. * @return the QueueServiceProperties object itself. */ @@ -117,7 +169,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueueServiceProperties from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueueServiceProperties if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. @@ -130,7 +182,7 @@ public static QueueServiceProperties fromXml(XmlReader xmlReader) throws XMLStre /** * Reads an instance of QueueServiceProperties from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -147,6 +199,7 @@ public static QueueServiceProperties fromXml(XmlReader xmlReader, String rootEle QueueServiceProperties deserializedQueueServiceProperties = new QueueServiceProperties(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); + if ("Logging".equals(elementName.getLocalPart())) { deserializedQueueServiceProperties.analyticsLogging = QueueAnalyticsLogging.fromXml(reader, "Logging"); @@ -170,59 +223,8 @@ public static QueueServiceProperties fromXml(XmlReader xmlReader, String rootEle reader.skipElement(); } } + return deserializedQueueServiceProperties; }); } - - /* - * The logging properties. - */ - @Generated - private QueueAnalyticsLogging analyticsLogging; - - /** - * Get the analyticsLogging property: The logging properties. - * - * @return the analyticsLogging value. - */ - @Generated - public QueueAnalyticsLogging getAnalyticsLogging() { - return this.analyticsLogging; - } - - /** - * Set the analyticsLogging property: The logging properties. - * - * @param analyticsLogging the analyticsLogging value to set. - * @return the QueueServiceProperties object itself. - */ - @Generated - public QueueServiceProperties setAnalyticsLogging(QueueAnalyticsLogging analyticsLogging) { - this.analyticsLogging = analyticsLogging; - return this; - } - - /** - * Set the hourMetrics property: The hour metrics properties. - * - * @param hourMetrics the hourMetrics value to set. - * @return the QueueServiceProperties object itself. - */ - @Generated - public QueueServiceProperties setHourMetrics(QueueMetrics hourMetrics) { - this.hourMetrics = hourMetrics; - return this; - } - - /** - * Set the minuteMetrics property: The minute metrics properties. - * - * @param minuteMetrics the minuteMetrics value to set. - * @return the QueueServiceProperties object itself. - */ - @Generated - public QueueServiceProperties setMinuteMetrics(QueueMetrics minuteMetrics) { - this.minuteMetrics = minuteMetrics; - return this; - } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java index 11ac770f28d4..b913f6ad7b80 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java @@ -13,23 +13,19 @@ import javax.xml.stream.XMLStreamException; /** - * Statistics for the storage queue service. + * Stats for the storage service. */ @Fluent public final class QueueServiceStatistics implements XmlSerializable { /* - * The geo replication stats. + * Geo-Replication information for the Secondary Storage Service. */ @Generated private GeoReplication geoReplication; - @Generated - public QueueServiceStatistics() { - } - /** - * Get the geoReplication property: The geo replication stats. + * Get the geoReplication property: Geo-Replication information for the Secondary Storage Service. * * @return the geoReplication value. */ @@ -38,12 +34,6 @@ public GeoReplication getGeoReplication() { return this.geoReplication; } - @Generated - public QueueServiceStatistics setGeoReplication(GeoReplication geoReplication) { - this.geoReplication = geoReplication; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -102,4 +92,23 @@ public static QueueServiceStatistics fromXml(XmlReader xmlReader, String rootEle return deserializedQueueServiceStatistics; }); } + + /** + * Creates an instance of QueueServiceStatistics class. + */ + @Generated + public QueueServiceStatistics() { + } + + /** + * Set the geoReplication property: Geo-Replication information for the Secondary Storage Service. + * + * @param geoReplication the geoReplication value to set. + * @return the QueueServiceStatistics object itself. + */ + @Generated + public QueueServiceStatistics setGeoReplication(GeoReplication geoReplication) { + this.geoReplication = geoReplication; + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java index 111b7859981f..fc1da64ae777 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java @@ -13,29 +13,25 @@ import javax.xml.stream.XMLStreamException; /** - * The signed identifier. + * signed identifier. */ @Fluent public final class QueueSignedIdentifier implements XmlSerializable { /* - * The unique ID for the signed identifier. + * a unique id. */ @Generated private String id; /* - * The access policy for the signed identifier. + * The access policy. */ @Generated private QueueAccessPolicy accessPolicy; - @Generated - public QueueSignedIdentifier() { - } - /** - * Get the id property: The unique ID for the signed identifier. + * Get the id property: a unique id. * * @return the id value. */ @@ -44,14 +40,8 @@ public String getId() { return this.id; } - @Generated - public QueueSignedIdentifier setId(String id) { - this.id = id; - return this; - } - /** - * Get the accessPolicy property: The access policy for the signed identifier. + * Get the accessPolicy property: The access policy. * * @return the accessPolicy value. */ @@ -60,12 +50,6 @@ public QueueAccessPolicy getAccessPolicy() { return this.accessPolicy; } - @Generated - public QueueSignedIdentifier setAccessPolicy(QueueAccessPolicy accessPolicy) { - this.accessPolicy = accessPolicy; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -132,4 +116,35 @@ public static QueueSignedIdentifier fromXml(XmlReader xmlReader, String rootElem } }); } + + /** + * Creates an instance of QueueSignedIdentifier class. + */ + @Generated + public QueueSignedIdentifier() { + } + + /** + * Set the id property: a unique id. + * + * @param id the id value to set. + * @return the QueueSignedIdentifier object itself. + */ + @Generated + public QueueSignedIdentifier setId(String id) { + this.id = id; + return this; + } + + /** + * Set the accessPolicy property: The access policy. + * + * @param accessPolicy the accessPolicy value to set. + * @return the QueueSignedIdentifier object itself. + */ + @Generated + public QueueSignedIdentifier setAccessPolicy(QueueAccessPolicy accessPolicy) { + this.accessPolicy = accessPolicy; + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java index e55244afb301..8c4046e88bb1 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java @@ -16,48 +16,44 @@ import javax.xml.stream.XMLStreamException; /** - * The sent queue message. + * The object returned in the QueueMessageList array when calling Put Message on a Queue. */ @Fluent public final class SendMessageResult implements XmlSerializable { /* - * The ID of the message. + * The Id of the Message. */ @Generated private String messageId; /* - * The time the message was inserted into the queue. + * The time the Message was inserted into the Queue. */ @Generated private DateTimeRfc1123 insertionTime; /* - * The time that the message will expire and be automatically deleted. + * The time that the Message will expire and be automatically deleted. */ @Generated private DateTimeRfc1123 expirationTime; /* - * An opaque value required to delete the message. If deletion fails using this - * PopReceipt then the message has been dequeued by another client. + * This value is required to delete the Message. If deletion fails using this popreceipt then the message has been + * dequeued by another client. */ @Generated private String popReceipt; /* - * The time that the message will again become visible in the queue. + * The time that the message will again become visible in the Queue. */ @Generated private DateTimeRfc1123 timeNextVisible; - @Generated - public SendMessageResult() { - } - /** - * Get the messageId property: The ID of the message. + * Get the messageId property: The Id of the Message. * * @return the messageId value. */ @@ -66,14 +62,8 @@ public String getMessageId() { return this.messageId; } - @Generated - public SendMessageResult setMessageId(String messageId) { - this.messageId = messageId; - return this; - } - /** - * Get the insertionTime property: The time the message was inserted into the queue. + * Get the insertionTime property: The time the Message was inserted into the Queue. * * @return the insertionTime value. */ @@ -85,18 +75,8 @@ public OffsetDateTime getInsertionTime() { return this.insertionTime.getDateTime(); } - @Generated - public SendMessageResult setInsertionTime(OffsetDateTime insertionTime) { - if (insertionTime == null) { - this.insertionTime = null; - } else { - this.insertionTime = new DateTimeRfc1123(insertionTime); - } - return this; - } - /** - * Get the expirationTime property: The time that the message will expire and be automatically deleted. + * Get the expirationTime property: The time that the Message will expire and be automatically deleted. * * @return the expirationTime value. */ @@ -108,19 +88,9 @@ public OffsetDateTime getExpirationTime() { return this.expirationTime.getDateTime(); } - @Generated - public SendMessageResult setExpirationTime(OffsetDateTime expirationTime) { - if (expirationTime == null) { - this.expirationTime = null; - } else { - this.expirationTime = new DateTimeRfc1123(expirationTime); - } - return this; - } - /** - * Get the popReceipt property: An opaque value required to delete the message. If deletion fails using this - * PopReceipt then the message has been dequeued by another client. + * Get the popReceipt property: This value is required to delete the Message. If deletion fails using this + * popreceipt then the message has been dequeued by another client. * * @return the popReceipt value. */ @@ -129,14 +99,8 @@ public String getPopReceipt() { return this.popReceipt; } - @Generated - public SendMessageResult setPopReceipt(String popReceipt) { - this.popReceipt = popReceipt; - return this; - } - /** - * Get the timeNextVisible property: The time that the message will again become visible in the queue. + * Get the timeNextVisible property: The time that the message will again become visible in the Queue. * * @return the timeNextVisible value. */ @@ -148,16 +112,6 @@ public OffsetDateTime getTimeNextVisible() { return this.timeNextVisible.getDateTime(); } - @Generated - public SendMessageResult setTimeNextVisible(OffsetDateTime timeNextVisible) { - if (timeNextVisible == null) { - this.timeNextVisible = null; - } else { - this.timeNextVisible = new DateTimeRfc1123(timeNextVisible); - } - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -251,4 +205,84 @@ public static SendMessageResult fromXml(XmlReader xmlReader, String rootElementN } }); } + + /** + * Creates an instance of SendMessageResult class. + */ + @Generated + public SendMessageResult() { + } + + /** + * Set the messageId property: The Id of the Message. + * + * @param messageId the messageId value to set. + * @return the SendMessageResult object itself. + */ + @Generated + public SendMessageResult setMessageId(String messageId) { + this.messageId = messageId; + return this; + } + + /** + * Set the insertionTime property: The time the Message was inserted into the Queue. + * + * @param insertionTime the insertionTime value to set. + * @return the SendMessageResult object itself. + */ + @Generated + public SendMessageResult setInsertionTime(OffsetDateTime insertionTime) { + if (insertionTime == null) { + this.insertionTime = null; + } else { + this.insertionTime = new DateTimeRfc1123(insertionTime); + } + return this; + } + + /** + * Set the expirationTime property: The time that the Message will expire and be automatically deleted. + * + * @param expirationTime the expirationTime value to set. + * @return the SendMessageResult object itself. + */ + @Generated + public SendMessageResult setExpirationTime(OffsetDateTime expirationTime) { + if (expirationTime == null) { + this.expirationTime = null; + } else { + this.expirationTime = new DateTimeRfc1123(expirationTime); + } + return this; + } + + /** + * Set the popReceipt property: This value is required to delete the Message. If deletion fails using this + * popreceipt then the message has been dequeued by another client. + * + * @param popReceipt the popReceipt value to set. + * @return the SendMessageResult object itself. + */ + @Generated + public SendMessageResult setPopReceipt(String popReceipt) { + this.popReceipt = popReceipt; + return this; + } + + /** + * Set the timeNextVisible property: The time that the message will again become visible in the Queue. + * + * @param timeNextVisible the timeNextVisible value to set. + * @return the SendMessageResult object itself. + */ + @Generated + public SendMessageResult setTimeNextVisible(OffsetDateTime timeNextVisible) { + if (timeNextVisible == null) { + this.timeNextVisible = null; + } else { + this.timeNextVisible = new DateTimeRfc1123(timeNextVisible); + } + return this; + } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/UserDelegationKey.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/UserDelegationKey.java index af3fb6db03d4..ff367f3012b1 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/UserDelegationKey.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/UserDelegationKey.java @@ -21,6 +21,18 @@ @Fluent public final class UserDelegationKey implements XmlSerializable { + /* + * The Azure Active Directory object ID in GUID format. + */ + @Generated + private String signedObjectId; + + /* + * The Azure Active Directory tenant ID in GUID format. + */ + @Generated + private String signedTenantId; + /* * The date-time the key is active. */ @@ -34,25 +46,47 @@ public final class UserDelegationKey implements XmlSerializable Date: Tue, 4 Aug 2026 17:48:25 +0530 Subject: [PATCH 08/13] drop autorest header classes, read response headers directly --- .../main/java/QueueStorageCustomizations.java | 20 ++ .../azure/storage/queue/QueueAsyncClient.java | 20 +- .../com/azure/storage/queue/QueueClient.java | 40 ++-- .../storage/queue/QueueServiceClient.java | 2 - .../queue/implementation/ServicesImpl.java | 104 ++++++++- .../queue/implementation/XmlSerializer.java | 78 +++++++ .../XmlSerializerProviders.java | 29 +++ .../models/MessageIdsDeleteHeaders.java | 128 ----------- .../models/MessageIdsUpdateHeaders.java | 202 ----------------- .../models/MessagesClearHeaders.java | 128 ----------- .../models/MessagesDequeueHeaders.java | 128 ----------- .../models/MessagesEnqueueHeaders.java | 128 ----------- .../models/MessagesPeekHeaders.java | 128 ----------- .../models/QueuesCreateHeaders.java | 128 ----------- .../models/QueuesDeleteHeaders.java | 128 ----------- .../models/QueuesGetAccessPolicyHeaders.java | 128 ----------- .../models/QueuesGetPropertiesHeaders.java | 204 ------------------ .../models/QueuesSetAccessPolicyHeaders.java | 128 ----------- .../models/QueuesSetMetadataHeaders.java | 128 ----------- .../models/ServicesGetPropertiesHeaders.java | 85 -------- .../models/ServicesGetStatisticsHeaders.java | 128 ----------- .../ServicesGetUserDelegationKeyHeaders.java | 157 -------------- .../ServicesListQueuesSegmentHeaders.java | 128 ----------- .../ServicesListQueuesSegmentNextHeaders.java | 128 ----------- .../models/ServicesSetPropertiesHeaders.java | 85 -------- .../implementation/util/ModelHelper.java | 32 ++- 26 files changed, 272 insertions(+), 2450 deletions(-) create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/XmlSerializer.java create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/XmlSerializerProviders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsDeleteHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsUpdateHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesClearHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesDequeueHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesEnqueueHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesPeekHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesCreateHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesDeleteHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetAccessPolicyHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesSetAccessPolicyHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesSetMetadataHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetPropertiesHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetStatisticsHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetUserDelegationKeyHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesListQueuesSegmentHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesListQueuesSegmentNextHeaders.java delete mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesSetPropertiesHeaders.java diff --git a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java index 49bb171bd868..32b3308391a3 100644 --- a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java +++ b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java @@ -79,6 +79,7 @@ public class QueueStorageCustomizations extends Customization { public void customize(LibraryCustomization customization, Logger logger) { Editor editor = customization.getRawEditor(); removeGeneratedFiles(editor, logger); + fixXmlSerializerRedundantCast(editor, logger); retargetServiceVersionReferences(editor, logger); restoreFluentModels(customization, logger); exposeRawListQueuesResponse(customization.getPackage(IMPL_PACKAGE), logger); @@ -310,6 +311,25 @@ private static void removeFileIfPresent(Editor editor, String path, Logger logge } } + // The generated XmlSerializer casts typeReference.getJavaClass() (already Class) to Class -- a redundant + // cast that trips the module's -Werror build. The file is emitter-generated and wired into ServicesImpl (XML + // pageable responses), so it can't be removed; drop the redundant cast here instead. + private static void fixXmlSerializerRedundantCast(Editor editor, Logger logger) { + String path = PKG_ROOT + "implementation/XmlSerializer.java"; + String content = editor.getContents().get(path); + if (content == null) { + logger.info("XmlSerializer not present in editor; skipping cast fix."); + return; + } + String updated = content.replace("(Class) typeReference.getJavaClass()", "typeReference.getJavaClass()"); + if (!updated.equals(content)) { + editor.replaceFile(path, updated); + logger.info("Removed redundant cast in XmlSerializer."); + } else { + logger.info("XmlSerializer redundant cast not found; skipping."); + } + } + private static void updateImplToMapInternalException(PackageCustomization implPackage, Logger logger) { List implsToUpdate = Arrays.asList("MessageIdsImpl", "MessagesImpl", "QueuesImpl", "ServicesImpl"); for (String implToUpdate : implsToUpdate) { diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java index 1e06193a1ebd..81e2d01f057c 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java @@ -20,17 +20,12 @@ import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.implementation.SasImplUtils; import com.azure.storage.queue.implementation.AzureQueueStorageImpl; -import com.azure.storage.queue.implementation.models.MessageIdsUpdateHeaders; -import com.azure.storage.queue.implementation.models.MessagesDequeueHeaders; -import com.azure.storage.queue.implementation.models.MessagesPeekHeaders; import com.azure.storage.queue.implementation.models.PeekedMessageItemInternal; import com.azure.storage.queue.implementation.models.PeekedMessageItemInternalWrapper; import com.azure.storage.queue.implementation.models.QueueMessage; import com.azure.storage.queue.implementation.models.QueueMessageItemInternal; import com.azure.storage.queue.implementation.models.QueueMessageItemInternalWrapper; import com.azure.storage.queue.implementation.models.QueueSignedIdentifierWrapper; -import com.azure.storage.queue.implementation.models.QueuesGetAccessPolicyHeaders; -import com.azure.storage.queue.implementation.models.QueuesGetPropertiesHeaders; import com.azure.storage.queue.implementation.models.SendMessageResultWrapper; import com.azure.storage.queue.implementation.util.ModelHelper; import com.azure.storage.queue.implementation.util.QueueSasImplUtil; @@ -501,7 +496,7 @@ public Mono> getPropertiesWithResponse() { return withContext(context -> client.getQueues() .getPropertiesWithResponseAsync(ModelHelper.requestOptions(context)) .map(response -> new SimpleResponse<>(response, - ModelHelper.transformQueueProperties(new QueuesGetPropertiesHeaders(response.getHeaders()))))); + ModelHelper.transformQueueProperties(response.getHeaders())))); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -620,7 +615,7 @@ public PagedFlux getAccessPolicy() { .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), ModelHelper.deserializeXmlBody(response.getValue(), QueueSignedIdentifierWrapper::fromXml).items(), - null, new QueuesGetAccessPolicyHeaders(response.getHeaders()))); + null, null)); return new PagedFlux<>(() -> retriever.apply(null), retriever); } catch (RuntimeException ex) { @@ -1092,7 +1087,7 @@ public PagedFlux receiveMessages(Integer maxMessages, Duration } } - private Mono> + private Mono> transformMessagesDequeueResponse(Response response) { QueueMessageItemInternalWrapper wrapper = ModelHelper.deserializeXmlBody(response.getValue(), QueueMessageItemInternalWrapper::fromXml); @@ -1127,7 +1122,7 @@ public PagedFlux receiveMessages(Integer maxMessages, Duration })) .collectList() .map(queueMessageItems -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), queueMessageItems, null, new MessagesDequeueHeaders(response.getHeaders()))); + response.getHeaders(), queueMessageItems, null, null)); } /** @@ -1209,7 +1204,7 @@ public PagedFlux peekMessages(Integer maxMessages) { } } - private Mono> + private Mono> transformMessagesPeekResponse(Response response) { PeekedMessageItemInternalWrapper wrapper = ModelHelper.deserializeXmlBody(response.getValue(), PeekedMessageItemInternalWrapper::fromXml); @@ -1244,7 +1239,7 @@ public PagedFlux peekMessages(Integer maxMessages) { })) .collectList() .map(peekedMessageItems -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), peekedMessageItems, null, new MessagesPeekHeaders(response.getHeaders()))); + response.getHeaders(), peekedMessageItems, null, null)); } /** @@ -1353,9 +1348,8 @@ public Mono> updateMessageWithResponse(String mess return client.getMessageIds() .updateWithResponseAsync(messageId, popReceipt, (int) visTimeout.getSeconds(), requestOptions) .map(response -> { - MessageIdsUpdateHeaders headers = new MessageIdsUpdateHeaders(response.getHeaders()); return new SimpleResponse<>(response, - new UpdateMessageResult(headers.getXMsPopreceipt(), headers.getXMsTimeNextVisible())); + ModelHelper.transformUpdateMessageResult(response.getHeaders())); }); }); } catch (RuntimeException ex) { diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java index e04f5a7e7f73..8137d1b91723 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java @@ -19,17 +19,12 @@ import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.implementation.SasImplUtils; import com.azure.storage.queue.implementation.AzureQueueStorageImpl; -import com.azure.storage.queue.implementation.models.MessageIdsUpdateHeaders; -import com.azure.storage.queue.implementation.models.MessagesDequeueHeaders; -import com.azure.storage.queue.implementation.models.MessagesPeekHeaders; import com.azure.storage.queue.implementation.models.PeekedMessageItemInternal; import com.azure.storage.queue.implementation.models.PeekedMessageItemInternalWrapper; import com.azure.storage.queue.implementation.models.QueueMessage; import com.azure.storage.queue.implementation.models.QueueMessageItemInternal; import com.azure.storage.queue.implementation.models.QueueMessageItemInternalWrapper; import com.azure.storage.queue.implementation.models.QueueSignedIdentifierWrapper; -import com.azure.storage.queue.implementation.models.QueuesGetAccessPolicyHeaders; -import com.azure.storage.queue.implementation.models.QueuesGetPropertiesHeaders; import com.azure.storage.queue.implementation.models.SendMessageResultWrapper; import com.azure.storage.queue.models.UserDelegationKey; import com.azure.storage.queue.implementation.util.ModelHelper; @@ -488,8 +483,7 @@ public Response getPropertiesWithResponse(Duration timeout, Con .getPropertiesWithResponse(ModelHelper.requestOptions(finalContext)); Response response = submitThreadPool(operation, LOGGER, timeout); - return new SimpleResponse<>(response, - ModelHelper.transformQueueProperties(new QueuesGetPropertiesHeaders(response.getHeaders()))); + return new SimpleResponse<>(response, ModelHelper.transformQueueProperties(response.getHeaders())); } /** @@ -609,7 +603,7 @@ public PagedIterable getAccessPolicy() { = () -> new PagedResponseBase<>(responseBase.getRequest(), responseBase.getStatusCode(), responseBase.getHeaders(), ModelHelper.deserializeXmlBody(responseBase.getValue(), QueueSignedIdentifierWrapper::fromXml).items(), - null, new QueuesGetAccessPolicyHeaders(responseBase.getHeaders())); + null, null); return new PagedIterable<>(response); } @@ -1047,18 +1041,15 @@ PagedIterable receiveMessagesWithOptionalTimeout(Integer maxMe Response response = submitThreadPool(operation, LOGGER, timeout); - PagedResponseBase transformedMessages - = transformMessagesDequeueResponse(response); + PagedResponseBase transformedMessages = transformMessagesDequeueResponse(response); - Supplier> res - = () -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - transformedMessages, new MessagesDequeueHeaders(response.getHeaders())); + Supplier> res = () -> new PagedResponseBase<>(response.getRequest(), + response.getStatusCode(), response.getHeaders(), transformedMessages, null); return new PagedIterable<>(res); } - private PagedResponseBase - transformMessagesDequeueResponse(Response response) { + private PagedResponseBase transformMessagesDequeueResponse(Response response) { QueueMessageItemInternalWrapper wrapper = ModelHelper.deserializeXmlBody(response.getValue(), QueueMessageItemInternalWrapper::fromXml); List queueMessageInternalItems @@ -1092,7 +1083,7 @@ PagedIterable receiveMessagesWithOptionalTimeout(Integer maxMe } } return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - messageItems, null, new MessagesDequeueHeaders(response.getHeaders())); + messageItems, null, null); } /** @@ -1173,16 +1164,13 @@ PagedIterable peekMessagesWithOptionalTimeout(Integer maxMess Response response = submitThreadPool(operation, LOGGER, timeout); - PagedResponseBase transformedMessages - = transformMessagesPeekResponse(response); - Supplier> res - = () -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - transformedMessages, new MessagesPeekHeaders(response.getHeaders())); + PagedResponseBase transformedMessages = transformMessagesPeekResponse(response); + Supplier> res = () -> new PagedResponseBase<>(response.getRequest(), + response.getStatusCode(), response.getHeaders(), transformedMessages, null); return new PagedIterable<>(res); } - private PagedResponseBase - transformMessagesPeekResponse(Response response) { + private PagedResponseBase transformMessagesPeekResponse(Response response) { PeekedMessageItemInternalWrapper wrapper = ModelHelper.deserializeXmlBody(response.getValue(), PeekedMessageItemInternalWrapper::fromXml); List peekedMessageInternalItems @@ -1216,7 +1204,7 @@ PagedIterable peekMessagesWithOptionalTimeout(Integer maxMess } } return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - messageItems, null, new MessagesPeekHeaders(response.getHeaders())); + messageItems, null, null); } /** @@ -1314,9 +1302,7 @@ public Response updateMessageWithResponse(String messageId, Response response = submitThreadPool(operation, LOGGER, timeout); - MessageIdsUpdateHeaders headers = new MessageIdsUpdateHeaders(response.getHeaders()); - UpdateMessageResult result - = new UpdateMessageResult(headers.getXMsPopreceipt(), headers.getXMsTimeNextVisible()); + UpdateMessageResult result = ModelHelper.transformUpdateMessageResult(response.getHeaders()); return new SimpleResponse<>(response, result); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java index e9d76849ea83..b12d335f662f 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java @@ -24,8 +24,6 @@ import com.azure.storage.queue.implementation.AzureQueueStorageImpl; import com.azure.storage.queue.implementation.util.ModelHelper; import com.azure.storage.queue.implementation.models.KeyInfo; -import com.azure.storage.queue.implementation.models.ServicesGetStatisticsHeaders; -import com.azure.storage.queue.implementation.models.ServicesGetUserDelegationKeyHeaders; import com.azure.storage.queue.models.QueueCorsRule; import com.azure.storage.queue.models.QueueGetUserDelegationKeyOptions; import com.azure.storage.queue.models.QueueItem; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java index f7de7be8f206..ab80a174582e 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java @@ -691,7 +691,14 @@ private Mono> getQueuesSinglePageAsync(RequestOptions this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "Queues"), null, null)); + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData.fromObject(com.azure.storage.queue.models.QueueItem.fromXml(reader, "Queue"), + XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Queues", "Queue"), null, null)); } /** @@ -796,7 +803,14 @@ private PagedResponse getQueuesSinglePage(RequestOptions requestOpti Response res = service.getQueuesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "Queues"), null, null); + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData.fromObject(com.azure.storage.queue.models.QueueItem.fromXml(reader, "Queue"), + XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Queues", "Queue"), null, null); } catch (QueueStorageExceptionInternal internalException) { throw ModelHelper.mapToQueueStorageException(internalException); } @@ -852,11 +866,14 @@ public PagedIterable getQueues(RequestOptions requestOptions) { return new PagedIterable<>(() -> getQueuesSinglePage(requestOptions)); } - private List getValues(BinaryData binaryData, String path) { + private List getValues(BinaryData binaryData, String... path) { try { try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map) value).get(segment); + } + List values = (List) value; return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); } catch (RuntimeException e) { return null; @@ -866,11 +883,14 @@ private List getValues(BinaryData binaryData, String path) { } } - private String getNextLink(BinaryData binaryData, String path) { + private String getNextLink(BinaryData binaryData, String... path) { try { try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map) value).get(segment); + } + return (String) value; } catch (RuntimeException e) { return null; } @@ -879,6 +899,74 @@ private String getNextLink(BinaryData binaryData, String path) { } } + private static final com.azure.core.util.serializer.ObjectSerializer XML_SERIALIZER + = XmlSerializerProviders.createInstance(); + + private List getXmlValues(BinaryData binaryData, + java.util.function.Function valueReader, String... path) { + try { + try (com.azure.xml.XmlReader reader = com.azure.xml.XmlReader.fromStream(binaryData.toStream())) { + reader.nextElement(); + return getXmlValues(reader, valueReader, path, 0); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException("Failed to read XML pageable response.", e); + } + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } + } + + private List getXmlValues(com.azure.xml.XmlReader reader, + java.util.function.Function valueReader, String[] path, int pathIndex) + throws javax.xml.stream.XMLStreamException { + try { + List values = new java.util.ArrayList<>(); + while (reader.nextElement() != com.azure.xml.XmlToken.END_ELEMENT) { + if (!reader.elementNameMatches(path[pathIndex])) { + reader.skipElement(); + } else if (pathIndex == path.length - 1) { + values.add(valueReader.apply(reader)); + } else { + values.addAll(getXmlValues(reader, valueReader, path, pathIndex + 1)); + } + } + return values; + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } + } + + private String getXmlNextLink(BinaryData binaryData, String... path) { + try { + try (com.azure.xml.XmlReader reader = com.azure.xml.XmlReader.fromStream(binaryData.toStream())) { + reader.nextElement(); + return getXmlNextLink(reader, path, 0); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException("Failed to read XML pageable response.", e); + } + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } + } + + private String getXmlNextLink(com.azure.xml.XmlReader reader, String[] path, int pathIndex) + throws javax.xml.stream.XMLStreamException { + try { + while (reader.nextElement() != com.azure.xml.XmlToken.END_ELEMENT) { + if (!reader.elementNameMatches(path[pathIndex])) { + reader.skipElement(); + } else if (pathIndex == path.length - 1) { + return reader.getStringElement(); + } else { + return getXmlNextLink(reader, path, pathIndex + 1); + } + } + return null; + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } + } + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getQueuesWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/XmlSerializer.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/XmlSerializer.java new file mode 100644 index 000000000000..4c1ce51a74dd --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/XmlSerializer.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.storage.queue.implementation; + +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UncheckedIOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.concurrent.ConcurrentHashMap; +import javax.xml.stream.XMLStreamException; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +/** + * An {@link ObjectSerializer} implementation that serializes and deserializes {@link XmlSerializable} types using + * {@code azure-xml}. Deserialization relies on the generated static {@code fromXml(XmlReader)} factory method on the + * target type. + */ +public final class XmlSerializer implements ObjectSerializer { + + private static final ConcurrentHashMap, Method> FROM_XML_CACHE = new ConcurrentHashMap<>(); + + @Override + @SuppressWarnings("unchecked") + public T deserialize(InputStream stream, TypeReference typeReference) { + Class clazz = typeReference.getJavaClass(); + Method fromXml = FROM_XML_CACHE.computeIfAbsent(clazz, c -> { + try { + return c.getDeclaredMethod("fromXml", XmlReader.class); + } catch (NoSuchMethodException e) { + throw new IllegalStateException( + "Type " + c.getName() + " does not have a static fromXml(XmlReader) method.", e); + } + }); + try (XmlReader xmlReader = XmlReader.fromStream(stream)) { + return (T) fromXml.invoke(null, xmlReader); + } catch (XMLStreamException | IllegalAccessException e) { + throw new IllegalStateException(e); + } catch (InvocationTargetException e) { + throw new IllegalStateException(e.getCause() == null ? e : e.getCause()); + } + } + + @Override + public Mono deserializeAsync(InputStream stream, TypeReference typeReference) { + return Mono.fromCallable(() -> deserialize(stream, typeReference)); + } + + @Override + public void serialize(OutputStream stream, Object value) { + if (!(value instanceof XmlSerializable)) { + throw new IllegalArgumentException("Value must implement XmlSerializable to be serialized as XML, but was: " + + (value == null ? "null" : value.getClass().getName())); + } + try (XmlWriter xmlWriter = XmlWriter.toStream(stream)) { + xmlWriter.writeStartDocument(); + xmlWriter.writeXml((XmlSerializable) value); + xmlWriter.flush(); + } catch (XMLStreamException e) { + throw new UncheckedIOException(new IOException(e)); + } + } + + @Override + public Mono serializeAsync(OutputStream stream, Object value) { + return Mono.fromRunnable(() -> serialize(stream, value)); + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/XmlSerializerProviders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/XmlSerializerProviders.java new file mode 100644 index 000000000000..b258540509aa --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/XmlSerializerProviders.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.storage.queue.implementation; + +import com.azure.core.util.serializer.ObjectSerializer; + +// DO NOT modify this helper class + +/** + * This class is a proxy for creating an {@link ObjectSerializer} that serializes and deserializes XML payloads using + * {@code azure-xml}. It mirrors the pattern of {@code JsonSerializerProviders} in {@code azure-core}, but for XML. + */ +public final class XmlSerializerProviders { + + /** + * Creates an instance of an XML {@link ObjectSerializer}. + * + * @return A new instance of an XML {@link ObjectSerializer}. + */ + public static ObjectSerializer createInstance() { + return new XmlSerializer(); + } + + private XmlSerializerProviders() { + // no-op + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsDeleteHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsDeleteHeaders.java deleted file mode 100644 index 093768d96624..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsDeleteHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The MessageIdsDeleteHeaders model. - */ -@Fluent -public final class MessageIdsDeleteHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of MessageIdsDeleteHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public MessageIdsDeleteHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the MessageIdsDeleteHeaders object itself. - */ - @Generated - public MessageIdsDeleteHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the MessageIdsDeleteHeaders object itself. - */ - @Generated - public MessageIdsDeleteHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the MessageIdsDeleteHeaders object itself. - */ - @Generated - public MessageIdsDeleteHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsUpdateHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsUpdateHeaders.java deleted file mode 100644 index 1b83c4de5098..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsUpdateHeaders.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The MessageIdsUpdateHeaders model. - */ -@Fluent -public final class MessageIdsUpdateHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - /* - * The x-ms-popreceipt property. - */ - @Generated - private String xMsPopreceipt; - - /* - * The x-ms-time-next-visible property. - */ - @Generated - private DateTimeRfc1123 xMsTimeNextVisible; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - private static final HttpHeaderName X_MS_POPRECEIPT = HttpHeaderName.fromString("x-ms-popreceipt"); - - private static final HttpHeaderName X_MS_TIME_NEXT_VISIBLE = HttpHeaderName.fromString("x-ms-time-next-visible"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of MessageIdsUpdateHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public MessageIdsUpdateHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - this.xMsPopreceipt = rawHeaders.getValue(X_MS_POPRECEIPT); - String xMsTimeNextVisible = rawHeaders.getValue(X_MS_TIME_NEXT_VISIBLE); - if (xMsTimeNextVisible != null) { - this.xMsTimeNextVisible = new DateTimeRfc1123(xMsTimeNextVisible); - } else { - this.xMsTimeNextVisible = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the MessageIdsUpdateHeaders object itself. - */ - @Generated - public MessageIdsUpdateHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the MessageIdsUpdateHeaders object itself. - */ - @Generated - public MessageIdsUpdateHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the MessageIdsUpdateHeaders object itself. - */ - @Generated - public MessageIdsUpdateHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } - - /** - * Get the xMsPopreceipt property: The x-ms-popreceipt property. - * - * @return the xMsPopreceipt value. - */ - @Generated - public String getXMsPopreceipt() { - return this.xMsPopreceipt; - } - - /** - * Set the xMsPopreceipt property: The x-ms-popreceipt property. - * - * @param xMsPopreceipt the xMsPopreceipt value to set. - * @return the MessageIdsUpdateHeaders object itself. - */ - @Generated - public MessageIdsUpdateHeaders setXMsPopreceipt(String xMsPopreceipt) { - this.xMsPopreceipt = xMsPopreceipt; - return this; - } - - /** - * Get the xMsTimeNextVisible property: The x-ms-time-next-visible property. - * - * @return the xMsTimeNextVisible value. - */ - @Generated - public OffsetDateTime getXMsTimeNextVisible() { - if (this.xMsTimeNextVisible == null) { - return null; - } - return this.xMsTimeNextVisible.getDateTime(); - } - - /** - * Set the xMsTimeNextVisible property: The x-ms-time-next-visible property. - * - * @param xMsTimeNextVisible the xMsTimeNextVisible value to set. - * @return the MessageIdsUpdateHeaders object itself. - */ - @Generated - public MessageIdsUpdateHeaders setXMsTimeNextVisible(OffsetDateTime xMsTimeNextVisible) { - if (xMsTimeNextVisible == null) { - this.xMsTimeNextVisible = null; - } else { - this.xMsTimeNextVisible = new DateTimeRfc1123(xMsTimeNextVisible); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesClearHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesClearHeaders.java deleted file mode 100644 index 5854125e2944..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesClearHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The MessagesClearHeaders model. - */ -@Fluent -public final class MessagesClearHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of MessagesClearHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public MessagesClearHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the MessagesClearHeaders object itself. - */ - @Generated - public MessagesClearHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the MessagesClearHeaders object itself. - */ - @Generated - public MessagesClearHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the MessagesClearHeaders object itself. - */ - @Generated - public MessagesClearHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesDequeueHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesDequeueHeaders.java deleted file mode 100644 index b27f839f9e52..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesDequeueHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The MessagesDequeueHeaders model. - */ -@Fluent -public final class MessagesDequeueHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of MessagesDequeueHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public MessagesDequeueHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the MessagesDequeueHeaders object itself. - */ - @Generated - public MessagesDequeueHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the MessagesDequeueHeaders object itself. - */ - @Generated - public MessagesDequeueHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the MessagesDequeueHeaders object itself. - */ - @Generated - public MessagesDequeueHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesEnqueueHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesEnqueueHeaders.java deleted file mode 100644 index 5bd7ffec6fb0..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesEnqueueHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The MessagesEnqueueHeaders model. - */ -@Fluent -public final class MessagesEnqueueHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of MessagesEnqueueHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public MessagesEnqueueHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the MessagesEnqueueHeaders object itself. - */ - @Generated - public MessagesEnqueueHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the MessagesEnqueueHeaders object itself. - */ - @Generated - public MessagesEnqueueHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the MessagesEnqueueHeaders object itself. - */ - @Generated - public MessagesEnqueueHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesPeekHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesPeekHeaders.java deleted file mode 100644 index eefaa79faf95..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessagesPeekHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The MessagesPeekHeaders model. - */ -@Fluent -public final class MessagesPeekHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of MessagesPeekHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public MessagesPeekHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the MessagesPeekHeaders object itself. - */ - @Generated - public MessagesPeekHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the MessagesPeekHeaders object itself. - */ - @Generated - public MessagesPeekHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the MessagesPeekHeaders object itself. - */ - @Generated - public MessagesPeekHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesCreateHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesCreateHeaders.java deleted file mode 100644 index b1b2c6c7b728..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesCreateHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The QueuesCreateHeaders model. - */ -@Fluent -public final class QueuesCreateHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of QueuesCreateHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public QueuesCreateHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the QueuesCreateHeaders object itself. - */ - @Generated - public QueuesCreateHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the QueuesCreateHeaders object itself. - */ - @Generated - public QueuesCreateHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the QueuesCreateHeaders object itself. - */ - @Generated - public QueuesCreateHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesDeleteHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesDeleteHeaders.java deleted file mode 100644 index 58487958fcb9..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesDeleteHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The QueuesDeleteHeaders model. - */ -@Fluent -public final class QueuesDeleteHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of QueuesDeleteHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public QueuesDeleteHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the QueuesDeleteHeaders object itself. - */ - @Generated - public QueuesDeleteHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the QueuesDeleteHeaders object itself. - */ - @Generated - public QueuesDeleteHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the QueuesDeleteHeaders object itself. - */ - @Generated - public QueuesDeleteHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetAccessPolicyHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetAccessPolicyHeaders.java deleted file mode 100644 index 6c4bca8f533e..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetAccessPolicyHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The QueuesGetAccessPolicyHeaders model. - */ -@Fluent -public final class QueuesGetAccessPolicyHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of QueuesGetAccessPolicyHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public QueuesGetAccessPolicyHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the QueuesGetAccessPolicyHeaders object itself. - */ - @Generated - public QueuesGetAccessPolicyHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the QueuesGetAccessPolicyHeaders object itself. - */ - @Generated - public QueuesGetAccessPolicyHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the QueuesGetAccessPolicyHeaders object itself. - */ - @Generated - public QueuesGetAccessPolicyHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java deleted file mode 100644 index 9daac6030ab4..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * The QueuesGetPropertiesHeaders model. - */ -@Fluent -public final class QueuesGetPropertiesHeaders { - /* - * The x-ms-meta- property. - */ - @Generated - private Map xMsMeta; - - /* - * The x-ms-approximate-messages-count property. - */ - @Generated - private Long xMsApproximateMessagesCount; - - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_APPROXIMATE_MESSAGES_COUNT - = HttpHeaderName.fromString("x-ms-approximate-messages-count"); - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of QueuesGetPropertiesHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public QueuesGetPropertiesHeaders(HttpHeaders rawHeaders) { - String xMsApproximateMessagesCount = rawHeaders.getValue(X_MS_APPROXIMATE_MESSAGES_COUNT); - if (xMsApproximateMessagesCount != null) { - this.xMsApproximateMessagesCount = Long.parseLong(xMsApproximateMessagesCount); - } else { - this.xMsApproximateMessagesCount = null; - } - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); - - rawHeaders.stream().forEach(header -> { - String headerName = header.getName(); - if (headerName.startsWith("x-ms-meta-")) { - xMsMetaHeaderCollection.put(headerName.substring(10), header.getValue()); - } - }); - this.xMsMeta = xMsMetaHeaderCollection; - } - - /** - * Get the xMsMeta property: The x-ms-meta- property. - * - * @return the xMsMeta value. - */ - @Generated - public Map getXMsMeta() { - return this.xMsMeta; - } - - /** - * Set the xMsMeta property: The x-ms-meta- property. - * - * @param xMsMeta the xMsMeta value to set. - * @return the QueuesGetPropertiesHeaders object itself. - */ - @Generated - public QueuesGetPropertiesHeaders setXMsMeta(Map xMsMeta) { - this.xMsMeta = xMsMeta; - return this; - } - - /** - * Get the xMsApproximateMessagesCount property: The x-ms-approximate-messages-count property. - * - * @return the xMsApproximateMessagesCount value. - */ - @Generated - public Long getXMsApproximateMessagesCount() { - return this.xMsApproximateMessagesCount; - } - - /** - * Set the xMsApproximateMessagesCount property: The x-ms-approximate-messages-count property. - * - * @param xMsApproximateMessagesCount the xMsApproximateMessagesCount value to set. - * @return the QueuesGetPropertiesHeaders object itself. - */ - @Generated - public QueuesGetPropertiesHeaders setXMsApproximateMessagesCount(Long xMsApproximateMessagesCount) { - this.xMsApproximateMessagesCount = xMsApproximateMessagesCount; - return this; - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the QueuesGetPropertiesHeaders object itself. - */ - @Generated - public QueuesGetPropertiesHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the QueuesGetPropertiesHeaders object itself. - */ - @Generated - public QueuesGetPropertiesHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the QueuesGetPropertiesHeaders object itself. - */ - @Generated - public QueuesGetPropertiesHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesSetAccessPolicyHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesSetAccessPolicyHeaders.java deleted file mode 100644 index 7adf9fed3ad9..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesSetAccessPolicyHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The QueuesSetAccessPolicyHeaders model. - */ -@Fluent -public final class QueuesSetAccessPolicyHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of QueuesSetAccessPolicyHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public QueuesSetAccessPolicyHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the QueuesSetAccessPolicyHeaders object itself. - */ - @Generated - public QueuesSetAccessPolicyHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the QueuesSetAccessPolicyHeaders object itself. - */ - @Generated - public QueuesSetAccessPolicyHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the QueuesSetAccessPolicyHeaders object itself. - */ - @Generated - public QueuesSetAccessPolicyHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesSetMetadataHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesSetMetadataHeaders.java deleted file mode 100644 index c69ab94185cb..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesSetMetadataHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The QueuesSetMetadataHeaders model. - */ -@Fluent -public final class QueuesSetMetadataHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of QueuesSetMetadataHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public QueuesSetMetadataHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the QueuesSetMetadataHeaders object itself. - */ - @Generated - public QueuesSetMetadataHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the QueuesSetMetadataHeaders object itself. - */ - @Generated - public QueuesSetMetadataHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the QueuesSetMetadataHeaders object itself. - */ - @Generated - public QueuesSetMetadataHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetPropertiesHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetPropertiesHeaders.java deleted file mode 100644 index 9cc098ea2313..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetPropertiesHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The ServicesGetPropertiesHeaders model. - */ -@Fluent -public final class ServicesGetPropertiesHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of ServicesGetPropertiesHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public ServicesGetPropertiesHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the ServicesGetPropertiesHeaders object itself. - */ - @Generated - public ServicesGetPropertiesHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the ServicesGetPropertiesHeaders object itself. - */ - @Generated - public ServicesGetPropertiesHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetStatisticsHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetStatisticsHeaders.java deleted file mode 100644 index f42573d678b2..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetStatisticsHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The ServicesGetStatisticsHeaders model. - */ -@Fluent -public final class ServicesGetStatisticsHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of ServicesGetStatisticsHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public ServicesGetStatisticsHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the ServicesGetStatisticsHeaders object itself. - */ - @Generated - public ServicesGetStatisticsHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the ServicesGetStatisticsHeaders object itself. - */ - @Generated - public ServicesGetStatisticsHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the ServicesGetStatisticsHeaders object itself. - */ - @Generated - public ServicesGetStatisticsHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetUserDelegationKeyHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetUserDelegationKeyHeaders.java deleted file mode 100644 index f4882f4ecbb0..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesGetUserDelegationKeyHeaders.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The ServicesGetUserDelegationKeyHeaders model. - */ -@Fluent -public final class ServicesGetUserDelegationKeyHeaders { - /* - * The x-ms-client-request-id property. - */ - @Generated - private String xMsClientRequestId; - - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of ServicesGetUserDelegationKeyHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public ServicesGetUserDelegationKeyHeaders(HttpHeaders rawHeaders) { - this.xMsClientRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_CLIENT_REQUEST_ID); - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsClientRequestId property: The x-ms-client-request-id property. - * - * @return the xMsClientRequestId value. - */ - @Generated - public String getXMsClientRequestId() { - return this.xMsClientRequestId; - } - - /** - * Set the xMsClientRequestId property: The x-ms-client-request-id property. - * - * @param xMsClientRequestId the xMsClientRequestId value to set. - * @return the ServicesGetUserDelegationKeyHeaders object itself. - */ - @Generated - public ServicesGetUserDelegationKeyHeaders setXMsClientRequestId(String xMsClientRequestId) { - this.xMsClientRequestId = xMsClientRequestId; - return this; - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the ServicesGetUserDelegationKeyHeaders object itself. - */ - @Generated - public ServicesGetUserDelegationKeyHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the ServicesGetUserDelegationKeyHeaders object itself. - */ - @Generated - public ServicesGetUserDelegationKeyHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the ServicesGetUserDelegationKeyHeaders object itself. - */ - @Generated - public ServicesGetUserDelegationKeyHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesListQueuesSegmentHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesListQueuesSegmentHeaders.java deleted file mode 100644 index 23ef483052a1..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesListQueuesSegmentHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The ServicesListQueuesSegmentHeaders model. - */ -@Fluent -public final class ServicesListQueuesSegmentHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of ServicesListQueuesSegmentHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public ServicesListQueuesSegmentHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the ServicesListQueuesSegmentHeaders object itself. - */ - @Generated - public ServicesListQueuesSegmentHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the ServicesListQueuesSegmentHeaders object itself. - */ - @Generated - public ServicesListQueuesSegmentHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the ServicesListQueuesSegmentHeaders object itself. - */ - @Generated - public ServicesListQueuesSegmentHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesListQueuesSegmentNextHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesListQueuesSegmentNextHeaders.java deleted file mode 100644 index 054c5ac9a685..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesListQueuesSegmentNextHeaders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.util.DateTimeRfc1123; -import java.time.OffsetDateTime; - -/** - * The ServicesListQueuesSegmentNextHeaders model. - */ -@Fluent -public final class ServicesListQueuesSegmentNextHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - /* - * The Date property. - */ - @Generated - private DateTimeRfc1123 date; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of ServicesListQueuesSegmentNextHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public ServicesListQueuesSegmentNextHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - String date = rawHeaders.getValue(HttpHeaderName.DATE); - if (date != null) { - this.date = new DateTimeRfc1123(date); - } else { - this.date = null; - } - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the ServicesListQueuesSegmentNextHeaders object itself. - */ - @Generated - public ServicesListQueuesSegmentNextHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the ServicesListQueuesSegmentNextHeaders object itself. - */ - @Generated - public ServicesListQueuesSegmentNextHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } - - /** - * Get the date property: The Date property. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - if (this.date == null) { - return null; - } - return this.date.getDateTime(); - } - - /** - * Set the date property: The Date property. - * - * @param date the date value to set. - * @return the ServicesListQueuesSegmentNextHeaders object itself. - */ - @Generated - public ServicesListQueuesSegmentNextHeaders setDate(OffsetDateTime date) { - if (date == null) { - this.date = null; - } else { - this.date = new DateTimeRfc1123(date); - } - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesSetPropertiesHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesSetPropertiesHeaders.java deleted file mode 100644 index d1d721a93f8e..000000000000 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/ServicesSetPropertiesHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.queue.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The ServicesSetPropertiesHeaders model. - */ -@Fluent -public final class ServicesSetPropertiesHeaders { - /* - * The x-ms-request-id property. - */ - @Generated - private String xMsRequestId; - - /* - * The x-ms-version property. - */ - @Generated - private String xMsVersion; - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of ServicesSetPropertiesHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public ServicesSetPropertiesHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - @Generated - public String getXMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the ServicesSetPropertiesHeaders object itself. - */ - @Generated - public ServicesSetPropertiesHeaders setXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the xMsVersion property: The x-ms-version property. - * - * @return the xMsVersion value. - */ - @Generated - public String getXMsVersion() { - return this.xMsVersion; - } - - /** - * Set the xMsVersion property: The x-ms-version property. - * - * @param xMsVersion the xMsVersion value to set. - * @return the ServicesSetPropertiesHeaders object itself. - */ - @Generated - public ServicesSetPropertiesHeaders setXMsVersion(String xMsVersion) { - this.xMsVersion = xMsVersion; - return this; - } -} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java index 01552760f45d..bc332d908905 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java @@ -3,12 +3,16 @@ package com.azure.storage.queue.implementation.util; +import com.azure.core.http.HttpHeader; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; +import com.azure.core.util.DateTimeRfc1123; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.queue.QueueMessageEncoding; @@ -16,12 +20,12 @@ import com.azure.storage.queue.implementation.models.PeekedMessageItemInternal; import com.azure.storage.queue.implementation.models.QueueMessageItemInternal; import com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal; -import com.azure.storage.queue.implementation.models.QueuesGetPropertiesHeaders; import com.azure.storage.queue.models.PeekedMessageItem; import com.azure.storage.queue.models.QueueItem; import com.azure.storage.queue.models.QueueMessageItem; import com.azure.storage.queue.models.QueueProperties; import com.azure.storage.queue.models.QueueStorageException; +import com.azure.storage.queue.models.UpdateMessageResult; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlWriter; @@ -30,12 +34,20 @@ import java.io.ByteArrayOutputStream; import java.util.Base64; import java.util.Collections; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import java.util.Objects; public class ModelHelper { private static final ClientLogger LOGGER = new ClientLogger(ModelHelper.class); + private static final String X_MS_META_PREFIX = "x-ms-meta-"; + private static final HttpHeaderName X_MS_APPROXIMATE_MESSAGES_COUNT + = HttpHeaderName.fromString("x-ms-approximate-messages-count"); + private static final HttpHeaderName X_MS_POPRECEIPT = HttpHeaderName.fromString("x-ms-popreceipt"); + private static final HttpHeaderName X_MS_TIME_NEXT_VISIBLE = HttpHeaderName.fromString("x-ms-time-next-visible"); + private static BinaryData decodeMessageBody(String messageText, QueueMessageEncoding messageEncoding) { if (messageText == null) { return null; @@ -100,8 +112,22 @@ public static String encodeMessage(BinaryData message, QueueMessageEncoding mess } } - public static QueueProperties transformQueueProperties(QueuesGetPropertiesHeaders headers) { - return new QueueProperties(headers.getXMsMeta(), headers.getXMsApproximateMessagesCount()); + public static QueueProperties transformQueueProperties(HttpHeaders headers) { + Map metadata = new LinkedHashMap<>(); + for (HttpHeader header : headers) { + String name = header.getName(); + if (name.regionMatches(true, 0, X_MS_META_PREFIX, 0, X_MS_META_PREFIX.length())) { + metadata.put(name.substring(X_MS_META_PREFIX.length()), header.getValue()); + } + } + String count = headers.getValue(X_MS_APPROXIMATE_MESSAGES_COUNT); + return new QueueProperties(metadata, count == null ? null : Long.parseLong(count)); + } + + public static UpdateMessageResult transformUpdateMessageResult(HttpHeaders headers) { + String timeNextVisible = headers.getValue(X_MS_TIME_NEXT_VISIBLE); + return new UpdateMessageResult(headers.getValue(X_MS_POPRECEIPT), + timeNextVisible == null ? null : new DateTimeRfc1123(timeNextVisible).getDateTime()); } /** From 24d768879238e55113f2c58e1cb2f14008cd7a34 Mon Sep 17 00:00:00 2001 From: Gunjan Singh Date: Tue, 4 Aug 2026 19:10:48 +0530 Subject: [PATCH 09/13] preserve autorest url behavior, drop slash sanitizer --- .../implementation/util/BuilderHelper.java | 4 ++ .../util/QueueUrlTrailingSlashPolicy.java | 54 +++++++++++++++++++ .../azure/storage/queue/QueueTestBase.java | 7 --- 3 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/QueueUrlTrailingSlashPolicy.java diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/BuilderHelper.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/BuilderHelper.java index 9917c979bd6a..244bf669f351 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/BuilderHelper.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/BuilderHelper.java @@ -185,6 +185,10 @@ public static HttpPipeline buildPipeline(StorageSharedKeyCredential storageShare } policies.add(new MetadataValidationPolicy()); + // Restore the AutoRest request URL shape (drop the trailing slash RestProxy adds for query-only queue-scoped + // routes). Placed before the credential policy since the URL is part of the shared-key string-to-sign. + policies.add(new QueueUrlTrailingSlashPolicy()); + if (storageSharedKeyCredential != null) { policies.add(new StorageSharedKeyCredentialPolicy(storageSharedKeyCredential)); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/QueueUrlTrailingSlashPolicy.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/QueueUrlTrailingSlashPolicy.java new file mode 100644 index 000000000000..604c3b178836 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/QueueUrlTrailingSlashPolicy.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.queue.implementation.util; + +import com.azure.core.http.HttpPipelineCallContext; +import com.azure.core.http.HttpPipelineNextPolicy; +import com.azure.core.http.HttpPipelineNextSyncPolicy; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.util.UrlBuilder; +import com.azure.core.util.logging.ClientLogger; +import reactor.core.publisher.Mono; + +/** + * Restores the pre-TypeSpec (AutoRest) request URL shape for queue-scoped operations. + *

+ * The TypeSpec-generated protocol layer carries the queue name in the client base URL and addresses queue-scoped + * operations with query-only path templates (e.g. {@code @Get("?comp=metadata")}). azure-core's {@code RestProxy} + * assembles those into {@code .../{queue}/?comp=metadata} -- a slash before the query -- whereas AutoRest emitted + * {@code .../{queue}?comp=metadata} (the queue name was a path parameter). This policy strips that single trailing + * path slash so the wire URL is identical to the AutoRest behavior, keeping the account-root slash for service-scoped + * operations (path {@code "/"}) untouched. It must run before the credential policy so the shared-key signature is + * computed over the corrected URL. + */ +public final class QueueUrlTrailingSlashPolicy implements HttpPipelinePolicy { + private static final ClientLogger LOGGER = new ClientLogger(QueueUrlTrailingSlashPolicy.class); + + @Override + public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { + normalizeUrl(context); + return next.process(); + } + + @Override + public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next) { + normalizeUrl(context); + return next.processSync(); + } + + private static void normalizeUrl(HttpPipelineCallContext context) { + UrlBuilder urlBuilder = UrlBuilder.parse(context.getHttpRequest().getUrl()); + String path = urlBuilder.getPath(); + // Only strip a trailing slash on a non-root path (queue-scoped ops); leave the account-root "/" alone. + if (path != null && path.length() > 1 && path.charAt(path.length() - 1) == '/') { + urlBuilder.setPath(path.substring(0, path.length() - 1)); + try { + context.getHttpRequest().setUrl(urlBuilder.toUrl()); + } catch (java.net.MalformedURLException e) { + throw LOGGER.logExceptionAsError(new IllegalStateException(e)); + } + } + } +} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java index fd88087ef673..1a9ed8a6432f 100644 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java @@ -43,13 +43,6 @@ public void beforeTest() { if (getTestMode() != TestMode.LIVE) { interceptorManager .addSanitizers(Arrays.asList(new TestProxySanitizer("sig=(.*)", "REDACTED", TestProxySanitizerType.URL), - // The TypeSpec-generated protocol layer carries the queue name in the client base URL and addresses - // queue-scoped operations with query-only path templates (e.g. @Get("?comp=metadata")). azure-core's - // RestProxy assembles those into '.../{queue}/?comp=metadata' (a slash before the query), whereas the - // AutoRest recordings captured '.../{queue}?comp=metadata'. The trailing slash is semantically - // insignificant to the Queue service (LIVE behavior is identical), so normalize it away for playback - // matching rather than treating it as a behavior change. - new TestProxySanitizer("(?/)[?]comp=", "", TestProxySanitizerType.URL).setGroupForReplace("s"), // Strip the empty 'include=' left in older recordings; non-empty 'include=metadata' is preserved. new TestProxySanitizer("(?&include=)(?=&|$)", "", TestProxySanitizerType.URL) .setGroupForReplace("inc"))); From 801c87c3f0fdd706e2d28a5e43da05ccde4484ad Mon Sep 17 00:00:00 2001 From: Gunjan Singh Date: Tue, 4 Aug 2026 19:56:22 +0530 Subject: [PATCH 10/13] match autorest include= wire behavior, drop include sanitizer --- .../storage/queue/implementation/util/ModelHelper.java | 4 +++- .../test/java/com/azure/storage/queue/QueueTestBase.java | 7 ++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java index bc332d908905..61609c3a977b 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java @@ -263,7 +263,9 @@ public static RequestOptions listQueuesRequestOptions(Context context, String pr addOptionalQueryParam(requestOptions, "prefix", prefix); addOptionalQueryParam(requestOptions, "marker", marker); addOptionalQueryParam(requestOptions, "maxresults", maxResults); - if (include != null && !include.isEmpty()) { + // Match the AutoRest wire behavior: emit "include=" whenever the list is non-null (an empty list produces an + // empty value), rather than omitting it. Keeps the request URL identical to the pre-migration implementation. + if (include != null) { requestOptions.addQueryParam("include", String.join(",", include)); } return requestOptions; diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java index 1a9ed8a6432f..5450d951115b 100644 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java @@ -41,11 +41,8 @@ public void beforeTest() { prefix = StorageCommonTestUtils.getCrc32(testContextManager.getTestPlaybackRecordingName()); if (getTestMode() != TestMode.LIVE) { - interceptorManager - .addSanitizers(Arrays.asList(new TestProxySanitizer("sig=(.*)", "REDACTED", TestProxySanitizerType.URL), - // Strip the empty 'include=' left in older recordings; non-empty 'include=metadata' is preserved. - new TestProxySanitizer("(?&include=)(?=&|$)", "", TestProxySanitizerType.URL) - .setGroupForReplace("inc"))); + interceptorManager.addSanitizers( + Arrays.asList(new TestProxySanitizer("sig=(.*)", "REDACTED", TestProxySanitizerType.URL))); } // Ignore changes to the order of query parameters and wholly ignore the 'sv' (service version) query parameter From 9f4558b0b06f46dc6b68169564ecf5caed28dab7 Mon Sep 17 00:00:00 2001 From: Gunjan Singh Date: Tue, 4 Aug 2026 20:41:25 +0530 Subject: [PATCH 11/13] fix checkstyle in analyze --- .../checkstyle-suppressions.xml | 2 ++ .../main/java/QueueStorageCustomizations.java | 18 ++++++++++----- .../queue/QueueServiceAsyncClient.java | 1 - .../storage/queue/QueueServiceClient.java | 2 -- .../storage/queue/models/GeoReplication.java | 11 ++++------ .../queue/models/QueueAnalyticsLogging.java | 16 ++++++-------- .../storage/queue/models/QueueCorsRule.java | 16 ++++++-------- .../queue/models/QueueSignedIdentifier.java | 10 ++++----- .../queue/models/SendMessageResult.java | 22 +++++++++---------- .../azure/storage/queue/QueueTestBase.java | 1 - 10 files changed, 46 insertions(+), 53 deletions(-) diff --git a/sdk/storage/azure-storage-queue/checkstyle-suppressions.xml b/sdk/storage/azure-storage-queue/checkstyle-suppressions.xml index 10b84decdca4..c17009ecf9c5 100644 --- a/sdk/storage/azure-storage-queue/checkstyle-suppressions.xml +++ b/sdk/storage/azure-storage-queue/checkstyle-suppressions.xml @@ -8,4 +8,6 @@ + + diff --git a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java index 32b3308391a3..b3ca79a3edf4 100644 --- a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java +++ b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java @@ -183,17 +183,23 @@ private static void rewriteFromXmlConstruction(ClassOrInterfaceDeclaration clazz offset++; } } else { - // Shape: `return new X(args);` -> introduce a local, assign, and return it. + // Shape: `return new X(args);` -> introduce a local, assign its fields, and return it. The statements are + // inserted directly into the enclosing block (not wrapped in a nested block, which Checkstyle rejects). ReturnStmt ret = findAncestor(oce, ReturnStmt.class).orElseThrow( () -> new IllegalStateException("Unexpected " + className + " construction context.")); + BlockStmt block = (BlockStmt) ret.getParentNode().orElseThrow( + () -> new IllegalStateException("No enclosing block for " + className + " return.")); String localName = "deserialized" + className; - BlockStmt rebuilt = new BlockStmt(); - rebuilt.addStatement(StaticJavaParser.parseStatement(className + " " + localName + " = new " + className + "();")); + int idx = block.getStatements().indexOf(ret); + block.addStatement(idx, + StaticJavaParser.parseStatement(className + " " + localName + " = new " + className + "();")); + int offset = 1; for (String argName : argNames) { - rebuilt.addStatement(StaticJavaParser.parseStatement(fieldAssignment(clazz, localName, argName))); + block.addStatement(idx + offset, StaticJavaParser.parseStatement( + fieldAssignment(clazz, localName, argName))); + offset++; } - rebuilt.addStatement(new ReturnStmt(StaticJavaParser.parseExpression(localName))); - ret.replace(rebuilt); + ret.setExpression(StaticJavaParser.parseExpression(localName)); } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java index b6692ddc20a4..562692bf211f 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java @@ -16,7 +16,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.implementation.AccountSasImplUtil; -import com.azure.storage.common.implementation.Constants; import com.azure.storage.common.implementation.SasImplUtils; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.sas.AccountSasSignatureValues; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java index b12d335f662f..0a946cf746db 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java @@ -10,14 +10,12 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.implementation.AccountSasImplUtil; -import com.azure.storage.common.implementation.Constants; import com.azure.storage.common.implementation.SasImplUtils; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.sas.AccountSasSignatureValues; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java index dfbdfcf35880..9890a352ba90 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/GeoReplication.java @@ -122,13 +122,10 @@ public static GeoReplication fromXml(XmlReader xmlReader, String rootElementName reader.skipElement(); } } - { - GeoReplication deserializedGeoReplication = new GeoReplication(); - deserializedGeoReplication.status = status; - deserializedGeoReplication.lastSyncTime - = lastSyncTime == null ? null : new DateTimeRfc1123(lastSyncTime); - return deserializedGeoReplication; - } + GeoReplication deserializedGeoReplication = new GeoReplication(); + deserializedGeoReplication.status = status; + deserializedGeoReplication.lastSyncTime = lastSyncTime == null ? null : new DateTimeRfc1123(lastSyncTime); + return deserializedGeoReplication; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java index b010b1bc9a93..5a1da3ecb65c 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java @@ -168,15 +168,13 @@ public static QueueAnalyticsLogging fromXml(XmlReader xmlReader, String rootElem reader.skipElement(); } } - { - QueueAnalyticsLogging deserializedQueueAnalyticsLogging = new QueueAnalyticsLogging(); - deserializedQueueAnalyticsLogging.version = version; - deserializedQueueAnalyticsLogging.delete = delete; - deserializedQueueAnalyticsLogging.read = read; - deserializedQueueAnalyticsLogging.write = write; - deserializedQueueAnalyticsLogging.retentionPolicy = retentionPolicy; - return deserializedQueueAnalyticsLogging; - } + QueueAnalyticsLogging deserializedQueueAnalyticsLogging = new QueueAnalyticsLogging(); + deserializedQueueAnalyticsLogging.version = version; + deserializedQueueAnalyticsLogging.delete = delete; + deserializedQueueAnalyticsLogging.read = read; + deserializedQueueAnalyticsLogging.write = write; + deserializedQueueAnalyticsLogging.retentionPolicy = retentionPolicy; + return deserializedQueueAnalyticsLogging; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java index 6f037e379db6..dd96bf54f80e 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueCorsRule.java @@ -181,15 +181,13 @@ public static QueueCorsRule fromXml(XmlReader xmlReader, String rootElementName) reader.skipElement(); } } - { - QueueCorsRule deserializedQueueCorsRule = new QueueCorsRule(); - deserializedQueueCorsRule.allowedOrigins = allowedOrigins; - deserializedQueueCorsRule.allowedMethods = allowedMethods; - deserializedQueueCorsRule.allowedHeaders = allowedHeaders; - deserializedQueueCorsRule.exposedHeaders = exposedHeaders; - deserializedQueueCorsRule.maxAgeInSeconds = maxAgeInSeconds; - return deserializedQueueCorsRule; - } + QueueCorsRule deserializedQueueCorsRule = new QueueCorsRule(); + deserializedQueueCorsRule.allowedOrigins = allowedOrigins; + deserializedQueueCorsRule.allowedMethods = allowedMethods; + deserializedQueueCorsRule.allowedHeaders = allowedHeaders; + deserializedQueueCorsRule.exposedHeaders = exposedHeaders; + deserializedQueueCorsRule.maxAgeInSeconds = maxAgeInSeconds; + return deserializedQueueCorsRule; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java index fc1da64ae777..e5d6ebdd2118 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java @@ -108,12 +108,10 @@ public static QueueSignedIdentifier fromXml(XmlReader xmlReader, String rootElem reader.skipElement(); } } - { - QueueSignedIdentifier deserializedQueueSignedIdentifier = new QueueSignedIdentifier(); - deserializedQueueSignedIdentifier.id = id; - deserializedQueueSignedIdentifier.accessPolicy = accessPolicy; - return deserializedQueueSignedIdentifier; - } + QueueSignedIdentifier deserializedQueueSignedIdentifier = new QueueSignedIdentifier(); + deserializedQueueSignedIdentifier.id = id; + deserializedQueueSignedIdentifier.accessPolicy = accessPolicy; + return deserializedQueueSignedIdentifier; }); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java index 8c4046e88bb1..d58af8c30e35 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/SendMessageResult.java @@ -191,18 +191,16 @@ public static SendMessageResult fromXml(XmlReader xmlReader, String rootElementN reader.skipElement(); } } - { - SendMessageResult deserializedSendMessageResult = new SendMessageResult(); - deserializedSendMessageResult.messageId = messageId; - deserializedSendMessageResult.insertionTime - = insertionTime == null ? null : new DateTimeRfc1123(insertionTime); - deserializedSendMessageResult.expirationTime - = expirationTime == null ? null : new DateTimeRfc1123(expirationTime); - deserializedSendMessageResult.popReceipt = popReceipt; - deserializedSendMessageResult.timeNextVisible - = timeNextVisible == null ? null : new DateTimeRfc1123(timeNextVisible); - return deserializedSendMessageResult; - } + SendMessageResult deserializedSendMessageResult = new SendMessageResult(); + deserializedSendMessageResult.messageId = messageId; + deserializedSendMessageResult.insertionTime + = insertionTime == null ? null : new DateTimeRfc1123(insertionTime); + deserializedSendMessageResult.expirationTime + = expirationTime == null ? null : new DateTimeRfc1123(expirationTime); + deserializedSendMessageResult.popReceipt = popReceipt; + deserializedSendMessageResult.timeNextVisible + = timeNextVisible == null ? null : new DateTimeRfc1123(timeNextVisible); + return deserializedSendMessageResult; }); } diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java index 5450d951115b..7b25125e7195 100644 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueTestBase.java @@ -20,7 +20,6 @@ import java.time.Duration; import java.util.Arrays; -import java.util.Collections; /** * Base class for Azure Storage Queue tests. From b41b5712a6d5c7c61e388868ba25b9ac572d0851 Mon Sep 17 00:00:00 2001 From: Gunjan Singh Date: Mon, 10 Aug 2026 19:28:51 +0530 Subject: [PATCH 12/13] Fix SpotBugs violations in azure-storage-queue TypeSpec migration - Remove the unused generated getXmlNextLink helpers from ServicesImpl. exposeRawListQueuesResponse replaces the emitter's paginated path, so the private getXmlNextLink helpers are never called, tripping SpotBugs UPM_UNCALLED_PRIVATE_METHOD. Add removeUnusedXmlNextLinkHelpers to the customization so the removal is reproduced on regeneration. - ModelHelper.transformQueueProperties: default approximate-messages-count to 0L (was null) to avoid a null unboxed into the primitive QueueProperties field (SpotBugs null-dereference). SpotBugs: BugInstance size is 0. All 323 playback tests pass. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_019uaMNtk1vxEK8FSsfCUTwQ --- .../main/java/QueueStorageCustomizations.java | 19 ++++++++++++ .../queue/implementation/ServicesImpl.java | 31 ------------------- .../implementation/util/ModelHelper.java | 2 +- 3 files changed, 20 insertions(+), 32 deletions(-) diff --git a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java index b3ca79a3edf4..2ae28e7c4bdd 100644 --- a/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java +++ b/sdk/storage/azure-storage-queue/customization/src/main/java/QueueStorageCustomizations.java @@ -83,6 +83,7 @@ public void customize(LibraryCustomization customization, Logger logger) { retargetServiceVersionReferences(editor, logger); restoreFluentModels(customization, logger); exposeRawListQueuesResponse(customization.getPackage(IMPL_PACKAGE), logger); + removeUnusedXmlNextLinkHelpers(customization.getPackage(IMPL_PACKAGE), logger); updateImplToMapInternalException(customization.getPackage(IMPL_PACKAGE), logger); } @@ -280,6 +281,24 @@ private static void exposeRawListQueuesResponse(PackageCustomization implPackage })); } + // exposeRawListQueuesResponse replaces the emitter's paginated path, leaving the generated getXmlNextLink + // helpers uncalled and tripping SpotBugs UPM_UNCALLED_PRIVATE_METHOD. + private static void removeUnusedXmlNextLinkHelpers(PackageCustomization implPackage, Logger logger) { + if (implPackage.getClass("ServicesImpl") == null) { + logger.info("ServicesImpl not present; skipping getXmlNextLink removal."); + return; + } + implPackage.getClass("ServicesImpl").customizeAst(ast -> ast.getClassByName("ServicesImpl").ifPresent(clazz -> { + List unused = clazz.getMethodsByName("getXmlNextLink"); + if (unused.isEmpty()) { + logger.info("No getXmlNextLink methods found in ServicesImpl; skipping removal."); + return; + } + new ArrayList<>(unused).forEach(MethodDeclaration::remove); + logger.info("Removed {} unused getXmlNextLink method(s) from ServicesImpl.", unused.size()); + })); + } + private static void retargetServiceVersionReferences(Editor editor, Logger logger) { String implDir = PKG_ROOT + "implementation/"; for (String fileName : new String[] { diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java index ab80a174582e..ae0dc528ceb8 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java @@ -936,37 +936,6 @@ private List getXmlValues(com.azure.xml.XmlReader reader, } } - private String getXmlNextLink(BinaryData binaryData, String... path) { - try { - try (com.azure.xml.XmlReader reader = com.azure.xml.XmlReader.fromStream(binaryData.toStream())) { - reader.nextElement(); - return getXmlNextLink(reader, path, 0); - } catch (javax.xml.stream.XMLStreamException e) { - throw new IllegalStateException("Failed to read XML pageable response.", e); - } - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - - private String getXmlNextLink(com.azure.xml.XmlReader reader, String[] path, int pathIndex) - throws javax.xml.stream.XMLStreamException { - try { - while (reader.nextElement() != com.azure.xml.XmlToken.END_ELEMENT) { - if (!reader.elementNameMatches(path[pathIndex])) { - reader.skipElement(); - } else if (pathIndex == path.length - 1) { - return reader.getStringElement(); - } else { - return getXmlNextLink(reader, path, pathIndex + 1); - } - } - return null; - } catch (QueueStorageExceptionInternal internalException) { - throw ModelHelper.mapToQueueStorageException(internalException); - } - } - @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getQueuesWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java index 61609c3a977b..70972685975c 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java @@ -121,7 +121,7 @@ public static QueueProperties transformQueueProperties(HttpHeaders headers) { } } String count = headers.getValue(X_MS_APPROXIMATE_MESSAGES_COUNT); - return new QueueProperties(metadata, count == null ? null : Long.parseLong(count)); + return new QueueProperties(metadata, count == null ? 0L : Long.parseLong(count)); } public static UpdateMessageResult transformUpdateMessageResult(HttpHeaders headers) { From 6d20d971e3715022a76e71d1d85a123913804cb7 Mon Sep 17 00:00:00 2001 From: Gunjan Singh Date: Mon, 10 Aug 2026 21:11:12 +0530 Subject: [PATCH 13/13] queue: generate response-header models via responseHeadersAsModel option Adopts Weidong's typespec-java responseHeadersAsModel client option (typespec#11420, emitter >= 0.45.11) for the two header-only queue operations whose results the hand-written clients build from response headers: Queue.getProperties and Queue.updateMessage. The spec option is set in the pinned client.tsp (fork commit 21116d8bdd) and generates QueuesGetPropertiesHeaders and MessageIdsUpdateHeaders. ModelHelper now uses those generated header models instead of reading HttpHeaders directly (typed getApproximateMessagesCount / getPopReceipt / getTimeNextVisible). The x-ms-meta-* metadata map is still read manually because the single-valued header model cannot represent it. Call sites are unchanged. Verified: clean tsp-client update reproduces the header classes; 323 playback tests pass; SpotBugs and revapi clean. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_019uaMNtk1vxEK8FSsfCUTwQ --- .../models/MessageIdsUpdateHeaders.java | 151 ++++++++++++++++++ .../models/QueuesGetPropertiesHeaders.java | 149 +++++++++++++++++ .../implementation/util/ModelHelper.java | 19 +-- .../azure-storage-queue_metadata.json | 2 +- .../azure-storage-queue/tsp-location.yaml | 2 +- 5 files changed, 310 insertions(+), 13 deletions(-) create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsUpdateHeaders.java create mode 100644 sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsUpdateHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsUpdateHeaders.java new file mode 100644 index 000000000000..92a2d163b359 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/MessageIdsUpdateHeaders.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.storage.queue.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.util.DateTimeRfc1123; +import java.time.OffsetDateTime; + +/** + * The MessageIdsUpdateHeaders model. + */ +@Immutable +public final class MessageIdsUpdateHeaders { + /* + * The x-ms-popreceipt property. + */ + @Generated + private final String popReceipt; + + /* + * The x-ms-time-next-visible property. + */ + @Generated + private final DateTimeRfc1123 timeNextVisible; + + /* + * The x-ms-version property. + */ + @Generated + private final String version; + + /* + * The x-ms-request-id property. + */ + @Generated + private final String requestId; + + /* + * The x-ms-client-request-id property. + */ + @Generated + private final String clientRequestId; + + /* + * The Date property. + */ + @Generated + private final DateTimeRfc1123 date; + + private static final HttpHeaderName X_MS_POPRECEIPT = HttpHeaderName.fromString("x-ms-popreceipt"); + + private static final HttpHeaderName X_MS_TIME_NEXT_VISIBLE = HttpHeaderName.fromString("x-ms-time-next-visible"); + + private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of MessageIdsUpdateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public MessageIdsUpdateHeaders(HttpHeaders rawHeaders) { + this.popReceipt = rawHeaders.getValue(X_MS_POPRECEIPT); + String timeNextVisible = rawHeaders.getValue(X_MS_TIME_NEXT_VISIBLE); + if (timeNextVisible != null) { + this.timeNextVisible = new DateTimeRfc1123(timeNextVisible); + } else { + this.timeNextVisible = null; + } + this.version = rawHeaders.getValue(X_MS_VERSION); + this.requestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); + this.clientRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_CLIENT_REQUEST_ID); + String date = rawHeaders.getValue(HttpHeaderName.DATE); + if (date != null) { + this.date = new DateTimeRfc1123(date); + } else { + this.date = null; + } + } + + /** + * Get the popReceipt property: The x-ms-popreceipt property. + * + * @return the popReceipt value. + */ + @Generated + public String getPopReceipt() { + return this.popReceipt; + } + + /** + * Get the timeNextVisible property: The x-ms-time-next-visible property. + * + * @return the timeNextVisible value. + */ + @Generated + public OffsetDateTime getTimeNextVisible() { + if (this.timeNextVisible == null) { + return null; + } + return this.timeNextVisible.getDateTime(); + } + + /** + * Get the version property: The x-ms-version property. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Get the requestId property: The x-ms-request-id property. + * + * @return the requestId value. + */ + @Generated + public String getRequestId() { + return this.requestId; + } + + /** + * Get the clientRequestId property: The x-ms-client-request-id property. + * + * @return the clientRequestId value. + */ + @Generated + public String getClientRequestId() { + return this.clientRequestId; + } + + /** + * Get the date property: The Date property. + * + * @return the date value. + */ + @Generated + public OffsetDateTime getDate() { + if (this.date == null) { + return null; + } + return this.date.getDateTime(); + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java new file mode 100644 index 000000000000..a7980fc9d195 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.storage.queue.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.util.DateTimeRfc1123; +import java.time.OffsetDateTime; + +/** + * The QueuesGetPropertiesHeaders model. + */ +@Immutable +public final class QueuesGetPropertiesHeaders { + /* + * The x-ms-meta property. + */ + @Generated + private final String metadata; + + /* + * The x-ms-approximate-messages-count property. + */ + @Generated + private final Long approximateMessagesCount; + + /* + * The x-ms-version property. + */ + @Generated + private final String version; + + /* + * The x-ms-request-id property. + */ + @Generated + private final String requestId; + + /* + * The x-ms-client-request-id property. + */ + @Generated + private final String clientRequestId; + + /* + * The Date property. + */ + @Generated + private final DateTimeRfc1123 date; + + private static final HttpHeaderName X_MS_META = HttpHeaderName.fromString("x-ms-meta"); + + private static final HttpHeaderName X_MS_APPROXIMATE_MESSAGES_COUNT + = HttpHeaderName.fromString("x-ms-approximate-messages-count"); + + private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of QueuesGetPropertiesHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public QueuesGetPropertiesHeaders(HttpHeaders rawHeaders) { + this.metadata = rawHeaders.getValue(X_MS_META); + String approximateMessagesCount = rawHeaders.getValue(X_MS_APPROXIMATE_MESSAGES_COUNT); + if (approximateMessagesCount != null) { + this.approximateMessagesCount = Long.parseLong(approximateMessagesCount); + } else { + this.approximateMessagesCount = null; + } + this.version = rawHeaders.getValue(X_MS_VERSION); + this.requestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); + this.clientRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_CLIENT_REQUEST_ID); + String date = rawHeaders.getValue(HttpHeaderName.DATE); + if (date != null) { + this.date = new DateTimeRfc1123(date); + } else { + this.date = null; + } + } + + /** + * Get the metadata property: The x-ms-meta property. + * + * @return the metadata value. + */ + @Generated + public String getMetadata() { + return this.metadata; + } + + /** + * Get the approximateMessagesCount property: The x-ms-approximate-messages-count property. + * + * @return the approximateMessagesCount value. + */ + @Generated + public Long getApproximateMessagesCount() { + return this.approximateMessagesCount; + } + + /** + * Get the version property: The x-ms-version property. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Get the requestId property: The x-ms-request-id property. + * + * @return the requestId value. + */ + @Generated + public String getRequestId() { + return this.requestId; + } + + /** + * Get the clientRequestId property: The x-ms-client-request-id property. + * + * @return the clientRequestId value. + */ + @Generated + public String getClientRequestId() { + return this.clientRequestId; + } + + /** + * Get the date property: The Date property. + * + * @return the date value. + */ + @Generated + public OffsetDateTime getDate() { + if (this.date == null) { + return null; + } + return this.date.getDateTime(); + } +} diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java index 70972685975c..bbed27620fd1 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java @@ -4,7 +4,6 @@ package com.azure.storage.queue.implementation.util; import com.azure.core.http.HttpHeader; -import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; @@ -12,13 +11,14 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; -import com.azure.core.util.DateTimeRfc1123; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.queue.QueueMessageEncoding; import com.azure.storage.queue.implementation.models.ListQueuesSegmentResponse; +import com.azure.storage.queue.implementation.models.MessageIdsUpdateHeaders; import com.azure.storage.queue.implementation.models.PeekedMessageItemInternal; import com.azure.storage.queue.implementation.models.QueueMessageItemInternal; +import com.azure.storage.queue.implementation.models.QueuesGetPropertiesHeaders; import com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal; import com.azure.storage.queue.models.PeekedMessageItem; import com.azure.storage.queue.models.QueueItem; @@ -43,10 +43,6 @@ public class ModelHelper { private static final ClientLogger LOGGER = new ClientLogger(ModelHelper.class); private static final String X_MS_META_PREFIX = "x-ms-meta-"; - private static final HttpHeaderName X_MS_APPROXIMATE_MESSAGES_COUNT - = HttpHeaderName.fromString("x-ms-approximate-messages-count"); - private static final HttpHeaderName X_MS_POPRECEIPT = HttpHeaderName.fromString("x-ms-popreceipt"); - private static final HttpHeaderName X_MS_TIME_NEXT_VISIBLE = HttpHeaderName.fromString("x-ms-time-next-visible"); private static BinaryData decodeMessageBody(String messageText, QueueMessageEncoding messageEncoding) { if (messageText == null) { @@ -120,14 +116,15 @@ public static QueueProperties transformQueueProperties(HttpHeaders headers) { metadata.put(name.substring(X_MS_META_PREFIX.length()), header.getValue()); } } - String count = headers.getValue(X_MS_APPROXIMATE_MESSAGES_COUNT); - return new QueueProperties(metadata, count == null ? 0L : Long.parseLong(count)); + // The generated header model provides the typed approximate-messages-count; the metadata map is a dynamic + // x-ms-meta-* collection the single-valued header model cannot represent, so it is still read manually. + Long count = new QueuesGetPropertiesHeaders(headers).getApproximateMessagesCount(); + return new QueueProperties(metadata, count == null ? 0L : count); } public static UpdateMessageResult transformUpdateMessageResult(HttpHeaders headers) { - String timeNextVisible = headers.getValue(X_MS_TIME_NEXT_VISIBLE); - return new UpdateMessageResult(headers.getValue(X_MS_POPRECEIPT), - timeNextVisible == null ? null : new DateTimeRfc1123(timeNextVisible).getDateTime()); + MessageIdsUpdateHeaders updateHeaders = new MessageIdsUpdateHeaders(headers); + return new UpdateMessageResult(updateHeaders.getPopReceipt(), updateHeaders.getTimeNextVisible()); } /** diff --git a/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json b/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json index d865d32f5fb9..298a54f25d97 100644 --- a/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json +++ b/sdk/storage/azure-storage-queue/src/main/resources/META-INF/azure-storage-queue_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Storage.Queues":"2026-04-06"},"crossLanguagePackageId":"Storage.Queues","crossLanguageVersion":"a43d239665bc","crossLanguageDefinitions":{"com.azure.storage.queue.AzureQueueStorageBuilder":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsAsyncClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient":"Storage.Queues","com.azure.storage.queue.MessageIdsClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessagesAsyncClient":"Storage.Queues","com.azure.storage.queue.MessagesAsyncClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesAsyncClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient":"Storage.Queues","com.azure.storage.queue.MessagesClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.QueueAsyncClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueAsyncClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueAsyncClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.ServiceAsyncClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceAsyncClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceAsyncClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceAsyncClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.implementation.models.KeyInfo":"Storage.Queues.KeyInfo","com.azure.storage.queue.implementation.models.ListOfSentMessage":"Storage.Queues.ListOfSentMessage","com.azure.storage.queue.implementation.models.ListQueuesIncludeType":"Storage.Queues.ListQueuesIncludeType","com.azure.storage.queue.implementation.models.PeekedMessageItemInternal":"Storage.Queues.PeekedMessage","com.azure.storage.queue.implementation.models.PeekedMessages":"Storage.Queues.PeekedMessages","com.azure.storage.queue.implementation.models.QueueMessage":"Storage.Queues.QueueMessage","com.azure.storage.queue.implementation.models.QueueMessageItemInternal":"Storage.Queues.ReceivedMessage","com.azure.storage.queue.implementation.models.ReceivedMessages":"Storage.Queues.ReceivedMessages","com.azure.storage.queue.implementation.models.SignedIdentifiers":"Storage.Queues.SignedIdentifiers","com.azure.storage.queue.models.GeoReplication":"Storage.Queues.GeoReplication","com.azure.storage.queue.models.GeoReplicationStatus":"Storage.Queues.GeoReplicationStatus","com.azure.storage.queue.models.QueueAccessPolicy":"Storage.Queues.AccessPolicy","com.azure.storage.queue.models.QueueAnalyticsLogging":"Storage.Queues.Logging","com.azure.storage.queue.models.QueueCorsRule":"Storage.Queues.CorsRule","com.azure.storage.queue.models.QueueItem":"Storage.Queues.QueueItem","com.azure.storage.queue.models.QueueMetrics":"Storage.Queues.Metrics","com.azure.storage.queue.models.QueueRetentionPolicy":"Storage.Queues.RetentionPolicy","com.azure.storage.queue.models.QueueServiceProperties":"Storage.Queues.QueueServiceProperties","com.azure.storage.queue.models.QueueServiceStatistics":"Storage.Queues.QueueServiceStats","com.azure.storage.queue.models.QueueSignedIdentifier":"Storage.Queues.SignedIdentifier","com.azure.storage.queue.models.SendMessageResult":"Storage.Queues.SentMessage","com.azure.storage.queue.models.UserDelegationKey":"Storage.Queues.UserDelegationKey"},"generatedFiles":["src/main/java/com/azure/storage/queue/AzureQueueStorageBuilder.java","src/main/java/com/azure/storage/queue/MessageIdsAsyncClient.java","src/main/java/com/azure/storage/queue/MessageIdsClient.java","src/main/java/com/azure/storage/queue/MessagesAsyncClient.java","src/main/java/com/azure/storage/queue/MessagesClient.java","src/main/java/com/azure/storage/queue/QueueAsyncClient.java","src/main/java/com/azure/storage/queue/QueueClient.java","src/main/java/com/azure/storage/queue/QueuesServiceVersion.java","src/main/java/com/azure/storage/queue/ServiceAsyncClient.java","src/main/java/com/azure/storage/queue/ServiceClient.java","src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java","src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java","src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java","src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java","src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java","src/main/java/com/azure/storage/queue/implementation/XmlSerializer.java","src/main/java/com/azure/storage/queue/implementation/XmlSerializerProviders.java","src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java","src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java","src/main/java/com/azure/storage/queue/implementation/models/ListQueuesIncludeType.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessage.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java","src/main/java/com/azure/storage/queue/implementation/models/package-info.java","src/main/java/com/azure/storage/queue/implementation/package-info.java","src/main/java/com/azure/storage/queue/models/GeoReplication.java","src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java","src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java","src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java","src/main/java/com/azure/storage/queue/models/QueueCorsRule.java","src/main/java/com/azure/storage/queue/models/QueueItem.java","src/main/java/com/azure/storage/queue/models/QueueMetrics.java","src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java","src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java","src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java","src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java","src/main/java/com/azure/storage/queue/models/SendMessageResult.java","src/main/java/com/azure/storage/queue/models/UserDelegationKey.java","src/main/java/com/azure/storage/queue/models/package-info.java","src/main/java/com/azure/storage/queue/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Storage.Queues":"2026-04-06"},"crossLanguagePackageId":"Storage.Queues","crossLanguageVersion":"b46cb9eb31bd","crossLanguageDefinitions":{"com.azure.storage.queue.AzureQueueStorageBuilder":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient":"Storage.Queues","com.azure.storage.queue.MessageIdsAsyncClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsAsyncClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsAsyncClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient":"Storage.Queues","com.azure.storage.queue.MessageIdsClient.delete":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.deleteWithResponse":"Storage.Queues.Queue.deleteMessage","com.azure.storage.queue.MessageIdsClient.update":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessageIdsClient.updateWithResponse":"Storage.Queues.Queue.updateMessage","com.azure.storage.queue.MessagesAsyncClient":"Storage.Queues","com.azure.storage.queue.MessagesAsyncClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesAsyncClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesAsyncClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesAsyncClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesAsyncClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient":"Storage.Queues","com.azure.storage.queue.MessagesClient.clear":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.clearWithResponse":"Storage.Queues.Queue.clear","com.azure.storage.queue.MessagesClient.dequeue":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.dequeueWithResponse":"Storage.Queues.Queue.receiveMessages","com.azure.storage.queue.MessagesClient.enqueue":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.enqueueWithResponse":"Storage.Queues.Queue.sendMessage","com.azure.storage.queue.MessagesClient.peek":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.MessagesClient.peekWithResponse":"Storage.Queues.Queue.peekMessages","com.azure.storage.queue.QueueAsyncClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueAsyncClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueAsyncClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueAsyncClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueAsyncClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueAsyncClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueAsyncClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueAsyncClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient":"Storage.Queues.Queue","com.azure.storage.queue.QueueClient.create":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.createWithResponse":"Storage.Queues.Queue.create","com.azure.storage.queue.QueueClient.delete":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.deleteWithResponse":"Storage.Queues.Queue.delete","com.azure.storage.queue.QueueClient.getAccessPolicy":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getAccessPolicyWithResponse":"Storage.Queues.Queue.getAccessPolicy","com.azure.storage.queue.QueueClient.getProperties":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.getPropertiesWithResponse":"Storage.Queues.Queue.getProperties","com.azure.storage.queue.QueueClient.setAccessPolicy":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setAccessPolicyWithResponse":"Storage.Queues.Queue.setAccessPolicy","com.azure.storage.queue.QueueClient.setMetadata":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.QueueClient.setMetadataWithResponse":"Storage.Queues.Queue.setMetadata","com.azure.storage.queue.ServiceAsyncClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceAsyncClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceAsyncClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceAsyncClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceAsyncClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceAsyncClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient":"Storage.Queues.Service","com.azure.storage.queue.ServiceClient.getProperties":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getPropertiesWithResponse":"Storage.Queues.Service.getProperties","com.azure.storage.queue.ServiceClient.getQueues":"Storage.Queues.Service.getQueues","com.azure.storage.queue.ServiceClient.getStatistics":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getStatisticsWithResponse":"Storage.Queues.Service.getStatistics","com.azure.storage.queue.ServiceClient.getUserDelegationKey":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.getUserDelegationKeyWithResponse":"Storage.Queues.Service.getUserDelegationKey","com.azure.storage.queue.ServiceClient.setProperties":"Storage.Queues.Service.setProperties","com.azure.storage.queue.ServiceClient.setPropertiesWithResponse":"Storage.Queues.Service.setProperties","com.azure.storage.queue.implementation.models.KeyInfo":"Storage.Queues.KeyInfo","com.azure.storage.queue.implementation.models.ListOfSentMessage":"Storage.Queues.ListOfSentMessage","com.azure.storage.queue.implementation.models.ListQueuesIncludeType":"Storage.Queues.ListQueuesIncludeType","com.azure.storage.queue.implementation.models.MessageIdsUpdateHeaders":null,"com.azure.storage.queue.implementation.models.PeekedMessageItemInternal":"Storage.Queues.PeekedMessage","com.azure.storage.queue.implementation.models.PeekedMessages":"Storage.Queues.PeekedMessages","com.azure.storage.queue.implementation.models.QueueMessage":"Storage.Queues.QueueMessage","com.azure.storage.queue.implementation.models.QueueMessageItemInternal":"Storage.Queues.ReceivedMessage","com.azure.storage.queue.implementation.models.QueuesGetPropertiesHeaders":null,"com.azure.storage.queue.implementation.models.ReceivedMessages":"Storage.Queues.ReceivedMessages","com.azure.storage.queue.implementation.models.SignedIdentifiers":"Storage.Queues.SignedIdentifiers","com.azure.storage.queue.models.GeoReplication":"Storage.Queues.GeoReplication","com.azure.storage.queue.models.GeoReplicationStatus":"Storage.Queues.GeoReplicationStatus","com.azure.storage.queue.models.QueueAccessPolicy":"Storage.Queues.AccessPolicy","com.azure.storage.queue.models.QueueAnalyticsLogging":"Storage.Queues.Logging","com.azure.storage.queue.models.QueueCorsRule":"Storage.Queues.CorsRule","com.azure.storage.queue.models.QueueItem":"Storage.Queues.QueueItem","com.azure.storage.queue.models.QueueMetrics":"Storage.Queues.Metrics","com.azure.storage.queue.models.QueueRetentionPolicy":"Storage.Queues.RetentionPolicy","com.azure.storage.queue.models.QueueServiceProperties":"Storage.Queues.QueueServiceProperties","com.azure.storage.queue.models.QueueServiceStatistics":"Storage.Queues.QueueServiceStats","com.azure.storage.queue.models.QueueSignedIdentifier":"Storage.Queues.SignedIdentifier","com.azure.storage.queue.models.SendMessageResult":"Storage.Queues.SentMessage","com.azure.storage.queue.models.UserDelegationKey":"Storage.Queues.UserDelegationKey"},"generatedFiles":["src/main/java/com/azure/storage/queue/AzureQueueStorageBuilder.java","src/main/java/com/azure/storage/queue/MessageIdsAsyncClient.java","src/main/java/com/azure/storage/queue/MessageIdsClient.java","src/main/java/com/azure/storage/queue/MessagesAsyncClient.java","src/main/java/com/azure/storage/queue/MessagesClient.java","src/main/java/com/azure/storage/queue/QueueAsyncClient.java","src/main/java/com/azure/storage/queue/QueueClient.java","src/main/java/com/azure/storage/queue/QueuesServiceVersion.java","src/main/java/com/azure/storage/queue/ServiceAsyncClient.java","src/main/java/com/azure/storage/queue/ServiceClient.java","src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java","src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java","src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java","src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java","src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java","src/main/java/com/azure/storage/queue/implementation/XmlSerializer.java","src/main/java/com/azure/storage/queue/implementation/XmlSerializerProviders.java","src/main/java/com/azure/storage/queue/implementation/models/KeyInfo.java","src/main/java/com/azure/storage/queue/implementation/models/ListOfSentMessage.java","src/main/java/com/azure/storage/queue/implementation/models/ListQueuesIncludeType.java","src/main/java/com/azure/storage/queue/implementation/models/MessageIdsUpdateHeaders.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/PeekedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessage.java","src/main/java/com/azure/storage/queue/implementation/models/QueueMessageItemInternal.java","src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java","src/main/java/com/azure/storage/queue/implementation/models/ReceivedMessages.java","src/main/java/com/azure/storage/queue/implementation/models/SignedIdentifiers.java","src/main/java/com/azure/storage/queue/implementation/models/package-info.java","src/main/java/com/azure/storage/queue/implementation/package-info.java","src/main/java/com/azure/storage/queue/models/GeoReplication.java","src/main/java/com/azure/storage/queue/models/GeoReplicationStatus.java","src/main/java/com/azure/storage/queue/models/QueueAccessPolicy.java","src/main/java/com/azure/storage/queue/models/QueueAnalyticsLogging.java","src/main/java/com/azure/storage/queue/models/QueueCorsRule.java","src/main/java/com/azure/storage/queue/models/QueueItem.java","src/main/java/com/azure/storage/queue/models/QueueMetrics.java","src/main/java/com/azure/storage/queue/models/QueueRetentionPolicy.java","src/main/java/com/azure/storage/queue/models/QueueServiceProperties.java","src/main/java/com/azure/storage/queue/models/QueueServiceStatistics.java","src/main/java/com/azure/storage/queue/models/QueueSignedIdentifier.java","src/main/java/com/azure/storage/queue/models/SendMessageResult.java","src/main/java/com/azure/storage/queue/models/UserDelegationKey.java","src/main/java/com/azure/storage/queue/models/package-info.java","src/main/java/com/azure/storage/queue/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/tsp-location.yaml b/sdk/storage/azure-storage-queue/tsp-location.yaml index ed0f0940fac9..5df33062ffaa 100644 --- a/sdk/storage/azure-storage-queue/tsp-location.yaml +++ b/sdk/storage/azure-storage-queue/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/storage/data-plane/QueueStorage -commit: 7f4ef5a27a0d350c7162ef3bcdd86b328f7f062f +commit: 21116d8bddf1bda117c09517d629d3ab2f0c2681 repo: gunjansingh-msft/azure-rest-api-specs additionalDirectories: []