From 8eaaf25e4b708f35d6a17a6304776337d2314742 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 4 Jun 2019 13:43:15 -0700 Subject: [PATCH 1/2] add queue.json in swagger --- .../azure-storage-queue/swagger/queue.json | 1856 +++++++++++++++++ 1 file changed, 1856 insertions(+) create mode 100644 sdk/storage/azure-storage-queue/swagger/queue.json diff --git a/sdk/storage/azure-storage-queue/swagger/queue.json b/sdk/storage/azure-storage-queue/swagger/queue.json new file mode 100644 index 000000000000..35feb8a083b6 --- /dev/null +++ b/sdk/storage/azure-storage-queue/swagger/queue.json @@ -0,0 +1,1856 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Queue Storage", + "version": "2018-03-28", + "x-ms-code-generation-settings": { + "header": "MIT", + "strictSpecAdherence": false + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{url}", + "useSchemePrefix": false, + "positionInOperation": "first", + "parameters": [ + { + "$ref": "#/parameters/Url" + } + ] + }, + "securityDefinitions": { + "queue_shared_key": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "schemes": [ + "https" + ], + "consumes": [ + "application/xml" + ], + "produces": [ + "application/xml" + ], + "paths": {}, + "x-ms-paths": { + "/?restype=service&comp=properties": { + "put": { + "tags": [ + "service" + ], + "operationId": "Service_SetProperties", + "description": "Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules", + "parameters": [ + { + "$ref": "#/parameters/StorageServiceProperties" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Success (Accepted)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetProperties", + "description": "gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/?restype=service&comp=stats": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetStatistics", + "description": "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.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceStats" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "stats" + ] + } + ] + }, + "/?comp=list": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_ListQueuesSegment", + "description": "The List Queues Segment operation returns a list of the queues under the specified account", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListQueuesInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListQueuesSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{queueName}": { + "put": { + "tags": [ + "service" + ], + "operationId": "Queue_Create", + "description": "creates a new queue under the given account.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "Success, queue created.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "204": { + "description": "Success, queue created.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "queue" + ], + "operationId": "Queue_Delete", + "description": "operation permanently deletes the specified queue", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{queueName}?comp=metadata": { + "get": { + "tags": [ + "queue" + ], + "operationId": "Queue_GetProperties", + "description": "Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the queue as name-values pairs.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "x-ms-approximate-messages-count": { + "type": "integer", + "x-ms-client-name": "ApproximateMessagesCount", + "description": "The approximate number of messages in the queue. This number is not lower than the actual number of messages in the queue, but could be higher." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "put": { + "tags": [ + "queue" + ], + "operationId": "Queue_SetMetadata", + "description": "sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{queueName}?comp=acl": { + "get": { + "tags": [ + "queue" + ], + "operationId": "Queue_GetAccessPolicy", + "description": "returns details about any stored access policies specified on the queue that may be used with Shared Access Signatures.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "put": { + "tags": [ + "queue" + ], + "operationId": "Queue_SetAccessPolicy", + "description": "sets stored access policies for the queue that may be used with Shared Access Signatures", + "parameters": [ + { + "$ref": "#/parameters/QueueAcl" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "acl" + ] + } + ] + }, + "/{queueName}/messages": { + "get": { + "tags": [ + "message" + ], + "operationId": "Messages_Dequeue", + "description": "The Dequeue operation retrieves one or more messages from the front of the queue.", + "parameters": [ + { + "$ref": "#/parameters/NumOfMessages" + }, + { + "$ref": "#/parameters/VisibilityTimeout" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/DequeuedMessagesList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "message" + ], + "operationId": "Messages_Clear", + "description": "The Clear operation deletes all messages from the specified queue.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{queueName}/messages?visibilitytimeout={visibilityTimeout}&messagettl={messageTimeToLive}": { + "post": { + "tags": [ + "message" + ], + "operationId": "Messages_Enqueue", + "description": "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.", + "parameters": [ + { + "$ref": "#/parameters/QueueMessage" + }, + { + "$ref": "#/parameters/VisibilityTimeout" + }, + { + "$ref": "#/parameters/MessageTTL" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/EnqueuedMessageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{queueName}/messages?peekonly=true": { + "get": { + "tags": [ + "message" + ], + "operationId": "Messages_Peek", + "description": "The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility of the message.", + "parameters": [ + { + "$ref": "#/parameters/NumOfMessages" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PeekedMessagesList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "peekonly", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "true" + ] + } + ] + }, + "/{queueName}/messages/{messageid}?popreceipt={popReceipt}&visibilitytimeout={visibilityTimeout}": { + "put": { + "tags": [ + "messageId" + ], + "operationId": "MessageId_Update", + "description": "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.", + "parameters": [ + { + "$ref": "#/parameters/QueueMessage" + }, + { + "$ref": "#/parameters/PopReceipt" + }, + { + "$ref": "#/parameters/VisibilityTimeoutRequired" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-popreceipt": { + "x-ms-client-name": "PopReceipt", + "type": "string", + "description": "The pop receipt of the queue message." + }, + "x-ms-time-next-visible": { + "x-ms-client-name": "TimeNextVisible", + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value that represents when the message will be visible on the queue." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{queueName}/messages/{messageid}?popreceipt={popReceipt}": { + "delete": { + "tags": [ + "messageId" + ], + "operationId": "MessageId_Delete", + "description": "The Delete operation deletes the specified message.", + "parameters": [ + { + "$ref": "#/parameters/PopReceipt" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + } + }, + "definitions": { + "AccessPolicy": { + "type": "object", + "required": [ + "Start", + "Expiry", + "Permission" + ], + "description": "An Access policy", + "properties": { + "Start": { + "description": "the date-time the policy is active", + "type": "string", + "format": "date-time" + }, + "Expiry": { + "description": "the date-time the policy expires", + "type": "string", + "format": "date-time" + }, + "Permission": { + "description": "the permissions for the acl policy", + "type": "string" + } + } + }, + "ListQueuesSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "The object returned when calling List Queues on a Queue Service.", + "type": "object", + "required": [ + "ServiceEndpoint", + "Prefix", + "MaxResults", + "NextMarker" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "QueueItems": { + "xml": { + "wrapped": true, + "name": "Queues" + }, + "type": "array", + "items": { + "$ref": "#/definitions/QueueItem" + } + }, + "NextMarker": { + "type": "string" + } + } + }, + "CorsRule": { + "description": "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", + "type": "object", + "required": [ + "AllowedOrigins", + "AllowedMethods", + "AllowedHeaders", + "ExposedHeaders", + "MaxAgeInSeconds" + ], + "properties": { + "AllowedOrigins": { + "description": "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.", + "type": "string" + }, + "AllowedMethods": { + "description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated)", + "type": "string" + }, + "AllowedHeaders": { + "description": "the request headers that the origin domain may specify on the CORS request.", + "type": "string" + }, + "ExposedHeaders": { + "description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer", + "type": "string" + }, + "MaxAgeInSeconds": { + "description": "The maximum amount time that a browser should cache the preflight OPTIONS request.", + "type": "integer", + "minimum": 0 + } + } + }, + "ErrorCode": { + "description": "Error codes returned by the service", + "type": "string", + "enum": [ + "AccountAlreadyExists", + "AccountBeingCreated", + "AccountIsDisabled", + "AuthenticationFailed", + "AuthorizationFailure", + "ConditionHeadersNotSupported", + "ConditionNotMet", + "EmptyMetadataKey", + "InsufficientAccountPermissions", + "InternalError", + "InvalidAuthenticationInfo", + "InvalidHeaderValue", + "InvalidHttpVerb", + "InvalidInput", + "InvalidMd5", + "InvalidMetadata", + "InvalidQueryParameterValue", + "InvalidRange", + "InvalidResourceName", + "InvalidUri", + "InvalidXmlDocument", + "InvalidXmlNodeValue", + "Md5Mismatch", + "MetadataTooLarge", + "MissingContentLengthHeader", + "MissingRequiredQueryParameter", + "MissingRequiredHeader", + "MissingRequiredXmlNode", + "MultipleConditionHeadersNotSupported", + "OperationTimedOut", + "OutOfRangeInput", + "OutOfRangeQueryParameterValue", + "RequestBodyTooLarge", + "ResourceTypeMismatch", + "RequestUrlFailedToParse", + "ResourceAlreadyExists", + "ResourceNotFound", + "ServerBusy", + "UnsupportedHeader", + "UnsupportedXmlNode", + "UnsupportedQueryParameter", + "UnsupportedHttpVerb", + "InvalidMarker", + "MessageNotFound", + "MessageTooLarge", + "PopReceiptMismatch", + "QueueAlreadyExists", + "QueueBeingDeleted", + "QueueDisabled", + "QueueNotEmpty", + "QueueNotFound" + ], + "x-ms-enum": { + "name": "StorageErrorCode", + "modelAsString": true + } + }, + "GeoReplication": { + "type": "object", + "required": [ + "Status", + "LastSyncTime" + ], + "properties": { + "Status": { + "description": "The status of the secondary location", + "type": "string", + "enum": [ + "live", + "bootstrap", + "unavailable" + ], + "x-ms-enum": { + "name": "GeoReplicationStatusType", + "modelAsString": true + } + }, + "LastSyncTime": { + "description": "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.", + "type": "string", + "format": "date-time-rfc1123" + } + } + }, + "Logging": { + "description": "Azure Analytics Logging settings.", + "type": "object", + "required": [ + "Version", + "Delete", + "Read", + "Write", + "RetentionPolicy" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Delete": { + "description": "Indicates whether all delete requests should be logged.", + "type": "boolean" + }, + "Read": { + "description": "Indicates whether all read requests should be logged.", + "type": "boolean" + }, + "Write": { + "description": "Indicates whether all write requests should be logged.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "Metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "StorageError": { + "type": "object", + "properties": { + "Message": { + "type": "string" + } + } + }, + "Metrics": { + "description": "", + "required": [ + "Enabled" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Enabled": { + "description": "Indicates whether metrics are enabled for the Queue service.", + "type": "boolean" + }, + "IncludeAPIs": { + "description": "Indicates whether metrics should generate summary statistics for called API operations.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "QueueItem": { + "description": "An Azure Storage Queue.", + "type": "object", + "required": [ + "Name" + ], + "properties": { + "Name": { + "type": "string", + "description": "The name of the Queue." + }, + "Metadata": { + "$ref": "#/definitions/Metadata" + } + }, + "xml": { + "name": "Queue" + } + }, + "QueueMessage": { + "description": "A Message object which can be stored in a Queue", + "type": "object", + "required": [ + "MessageText" + ], + "properties": { + "MessageText": { + "type": "string", + "description": "The content of the message" + } + } + }, + "DequeuedMessageItem": { + "description": "The object returned in the QueueMessageList array when calling Get Messages on a Queue.", + "type": "object", + "required": [ + "MessageId", + "InsertionTime", + "ExpirationTime", + "PopReceipt", + "TimeNextVisible", + "DequeueCount", + "MessageText" + ], + "properties": { + "MessageId": { + "type": "string", + "description": "The Id of the Message." + }, + "InsertionTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the Message was inserted into the Queue." + }, + "ExpirationTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the Message will expire and be automatically deleted." + }, + "PopReceipt": { + "type": "string", + "description": "This value is required to delete the Message. If deletion fails using this popreceipt then the message has been dequeued by another client." + }, + "TimeNextVisible": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the message will again become visible in the Queue." + }, + "DequeueCount": { + "type": "integer", + "format": "int64", + "description": "The number of times the message has been dequeued." + }, + "MessageText": { + "type": "string", + "description": "The content of the Message." + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessage" + } + }, + "PeekedMessageItem": { + "description": "The object returned in the QueueMessageList array when calling Peek Messages on a Queue", + "type": "object", + "required": [ + "MessageId", + "InsertionTime", + "ExpirationTime", + "DequeueCount", + "MessageText" + ], + "properties": { + "MessageId": { + "type": "string", + "description": "The Id of the Message." + }, + "InsertionTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the Message was inserted into the Queue." + }, + "ExpirationTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the Message will expire and be automatically deleted." + }, + "DequeueCount": { + "type": "integer", + "format": "int64", + "description": "The number of times the message has been dequeued." + }, + "MessageText": { + "type": "string", + "description": "The content of the Message." + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessage" + } + }, + "EnqueuedMessage": { + "description": "The object returned in the QueueMessageList array when calling Put Message on a Queue", + "type": "object", + "required": [ + "MessageId", + "InsertionTime", + "ExpirationTime", + "PopReceipt", + "TimeNextVisible" + ], + "properties": { + "MessageId": { + "type": "string", + "description": "The Id of the Message." + }, + "InsertionTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the Message was inserted into the Queue." + }, + "ExpirationTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the Message will expire and be automatically deleted." + }, + "PopReceipt": { + "type": "string", + "description": "This value is required to delete the Message. If deletion fails using this popreceipt then the message has been dequeued by another client." + }, + "TimeNextVisible": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the message will again become visible in the Queue." + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessage" + } + }, + "DequeuedMessagesList": { + "description": "The object returned when calling Get Messages on a Queue", + "type": "array", + "items": { + "$ref": "#/definitions/DequeuedMessageItem", + "xml": { + "name": "QueueMessage" + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessagesList" + } + }, + "PeekedMessagesList": { + "description": "The object returned when calling Peek Messages on a Queue", + "type": "array", + "items": { + "$ref": "#/definitions/PeekedMessageItem", + "xml": { + "name": "QueueMessage" + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessagesList" + } + }, + "EnqueuedMessageList": { + "description": "The object returned when calling Put Message on a Queue", + "type": "array", + "items": { + "$ref": "#/definitions/EnqueuedMessage", + "xml": { + "name": "QueueMessage" + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessagesList" + } + }, + "RetentionPolicy": { + "description": "the retention policy", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether a retention policy is enabled for the storage service", + "type": "boolean" + }, + "Days": { + "description": "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", + "type": "integer", + "minimum": 1 + } + } + }, + "SignedIdentifier": { + "description": "signed identifier", + "type": "object", + "required": [ + "Id", + "AccessPolicy" + ], + "properties": { + "Id": { + "type": "string", + "description": "a unique id" + }, + "AccessPolicy": { + "description": "The access policy", + "$ref": "#/definitions/AccessPolicy" + } + } + }, + "SignedIdentifiers": { + "description": "a collection of signed identifiers", + "type": "array", + "items": { + "$ref": "#/definitions/SignedIdentifier", + "xml": { + "name": "SignedIdentifier" + } + }, + "xml": { + "wrapped": true, + "name": "SignedIdentifiers" + } + }, + "StorageServiceProperties": { + "description": "Storage Service Properties.", + "type": "object", + "properties": { + "Logging": { + "description": "Azure Analytics Logging settings", + "$ref": "#/definitions/Logging" + }, + "HourMetrics": { + "description": "A summary of request statistics grouped by API in hourly aggregates for queues", + "$ref": "#/definitions/Metrics" + }, + "MinuteMetrics": { + "description": "a summary of request statistics grouped by API in minute aggregates for queues", + "$ref": "#/definitions/Metrics" + }, + "Cors": { + "description": "The set of CORS rules.", + "type": "array", + "items": { + "$ref": "#/definitions/CorsRule", + "xml": { + "name": "CorsRule" + } + }, + "xml": { + "wrapped": true + } + } + } + }, + "StorageServiceStats": { + "description": "Stats for the storage service.", + "type": "object", + "properties": { + "GeoReplication": { + "description": "Geo-Replication information for the Secondary Storage Service", + "$ref": "#/definitions/GeoReplication" + } + } + } + }, + "parameters": { + "Url": { + "name": "url", + "description": "The URL of the service account, queue or message that is the targe of the desired operation.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "ApiVersionParameter": { + "name": "x-ms-version", + "x-ms-client-name": "version", + "in": "header", + "required": true, + "type": "string", + "description": "Specifies the version of the operation to use for this request.", + "enum": [ + "2018-03-28" + ] + }, + "Body": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "format": "file" + }, + "x-ms-parameter-location": "method", + "description": "Initial data" + }, + "QueueAcl": { + "name": "queueAcl", + "in": "body", + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + }, + "x-ms-parameter-location": "method", + "description": "the acls for the queue" + }, + "ClientRequestId": { + "name": "x-ms-client-request-id", + "x-ms-client-name": "requestId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "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." + }, + "ContentLength": { + "name": "Content-Length", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "The length of the request." + }, + "ListQueuesInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "array", + "collectionFormat": "csv", + "items": { + "type": "string", + "enum": [ + "metadata" + ], + "x-ms-enum": { + "name": "ListQueuesIncludeType", + "modelAsString": false + } + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify that the queues's metadata be returned as part of the response body." + }, + "Marker": { + "name": "marker", + "in": "query", + "required": false, + "type": "string", + "description": "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.", + "x-ms-parameter-location": "method" + }, + "MaxResults": { + "name": "maxresults", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method", + "description": "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." + }, + "MessageId": { + "name": "messageid", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The container name." + }, + "MessageTTL": { + "name": "messagettl", + "x-ms-client-name": "MessageTimeToLive", + "in": "query", + "required": false, + "type": "integer", + "minimum": -1, + "x-ms-parameter-location": "method", + "description": "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." + }, + "Metadata": { + "name": "x-ms-meta", + "x-ms-client-name": "metadata", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "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.", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "NumOfMessages": { + "name": "numofmessages", + "x-ms-client-name": "numberOfMessages", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method", + "description": "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." + }, + "PopReceipt": { + "name": "popreceipt", + "x-ms-client-name": "popReceipt", + "in": "query", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. Specifies the valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation.", + "type": "string" + }, + "Prefix": { + "name": "prefix", + "in": "query", + "required": false, + "type": "string", + "description": "Filters the results to return only queues whose name begins with the specified prefix.", + "x-ms-parameter-location": "method" + }, + "QueueMessage": { + "name": "QueueMessage", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/QueueMessage" + }, + "x-ms-parameter-location": "method", + "description": "A Message object which can be stored in a Queue" + }, + "QueueName": { + "name": "queueName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The queue name." + }, + "StorageServiceProperties": { + "name": "StorageServiceProperties", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + }, + "x-ms-parameter-location": "method", + "description": "The StorageService properties." + }, + "Timeout": { + "name": "timeout", + "in": "query", + "required": false, + "type": "integer", + "minimum": 0, + "x-ms-parameter-location": "method", + "description": "The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations." + }, + "VisibilityTimeout": { + "name": "visibilitytimeout", + "in": "query", + "required": false, + "type": "integer", + "minimum": 0, + "maximum": 604800, + "x-ms-parameter-location": "method", + "description": "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." + }, + "VisibilityTimeoutRequired": { + "name": "visibilitytimeout", + "in": "query", + "required": true, + "type": "integer", + "minimum": 0, + "maximum": 604800, + "x-ms-parameter-location": "method", + "description": "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." + } + } +} \ No newline at end of file From e3af9a8b8a639f58be3a49fbb1074d6ff114c9a6 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 4 Jun 2019 17:05:06 -0700 Subject: [PATCH 2/2] Add autorest layer --- .../storage/queue/_generated/__init__.py | 15 + .../queue/_generated/_azure_queue_storage.py | 62 ++ .../queue/_generated/_configuration.py | 50 ++ .../storage/queue/_generated/aio/__init__.py | 10 + .../aio/_azure_queue_storage_async.py | 63 ++ .../_generated/aio/_configuration_async.py | 49 ++ .../aio/operations_async/__init__.py | 18 + .../_message_id_operations_async.py | 177 ++++++ .../_messages_operations_async.py | 343 ++++++++++ .../_queue_operations_async.py | 427 +++++++++++++ .../_service_operations_async.py | 344 ++++++++++ .../queue/_generated/models/__init__.py | 68 ++ .../models/_azure_queue_storage_enums.py | 75 +++ .../queue/_generated/models/_models.py | 591 ++++++++++++++++++ .../queue/_generated/models/_models_py3.py | 591 ++++++++++++++++++ .../queue/_generated/operations/__init__.py | 18 + .../operations/_message_id_operations.py | 177 ++++++ .../operations/_messages_operations.py | 343 ++++++++++ .../operations/_queue_operations.py | 427 +++++++++++++ .../operations/_service_operations.py | 344 ++++++++++ .../azure/storage/queue/_generated/version.py | 9 + 21 files changed, 4201 insertions(+) create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/__init__.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_azure_queue_storage.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_configuration.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/__init__.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_azure_queue_storage_async.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_configuration_async.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/__init__.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_message_id_operations_async.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_messages_operations_async.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_queue_operations_async.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_service_operations_async.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/models/__init__.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/models/_azure_queue_storage_enums.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/models/_models.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/models/_models_py3.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/__init__.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_message_id_operations.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_messages_operations.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_queue_operations.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_service_operations.py create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_generated/version.py diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/__init__.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/__init__.py new file mode 100644 index 000000000000..beb459532937 --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import AzureQueueStorageConfiguration +from ._azure_queue_storage import AzureQueueStorage +__all__ = ['AzureQueueStorage', 'AzureQueueStorageConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_azure_queue_storage.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_azure_queue_storage.py new file mode 100644 index 000000000000..076e89e96881 --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_azure_queue_storage.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.core import PipelineClient +from msrest import Serializer, Deserializer + +from ._configuration import AzureQueueStorageConfiguration +from azure.core.exceptions import map_error +from .operations import ServiceOperations +from .operations import QueueOperations +from .operations import MessagesOperations +from .operations import MessageIdOperations +from . import models + + +class AzureQueueStorage(object): + """AzureQueueStorage + + + :ivar service: Service operations + :vartype service: queue.operations.ServiceOperations + :ivar queue: Queue operations + :vartype queue: queue.operations.QueueOperations + :ivar messages: Messages operations + :vartype messages: queue.operations.MessagesOperations + :ivar message_id: MessageId operations + :vartype message_id: queue.operations.MessageIdOperations + + :param url: The URL of the service account, queue or message that is the + targe of the desired operation. + :type url: str + """ + + def __init__(self, url, config=None, **kwargs): + + base_url = '{url}' + self._config = config or AzureQueueStorageConfiguration(url, **kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-03-28' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.service = ServiceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue = QueueOperations( + self._client, self._config, self._serialize, self._deserialize) + self.messages = MessagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.message_id = MessageIdOperations( + self._client, self._config, self._serialize, self._deserialize) + + def __enter__(self): + self._client.__enter__() + return self + def __exit__(self, *exc_details): + self._client.__exit__(*exc_details) diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_configuration.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_configuration.py new file mode 100644 index 000000000000..8da01fc14f94 --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_configuration.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.core.configuration import Configuration, ConnectionConfiguration +from azure.core.pipeline import policies + +from .version import VERSION + + +class AzureQueueStorageConfiguration(Configuration): + """Configuration for AzureQueueStorage + Note that all parameters used to create this instance are saved as instance + attributes. + + :param url: The URL of the service account, queue or message that is the + targe of the desired operation. + :type url: str + :ivar version: Specifies the version of the operation to use for this + request. + :type version: str + """ + + def __init__(self, url, **kwargs): + + if url is None: + raise ValueError("Parameter 'url' must not be None.") + + super(AzureQueueStorageConfiguration, self).__init__(**kwargs) + self._configure(**kwargs) + + self.user_agent_policy.add_user_agent('azurequeuestorage/{}'.format(VERSION)) + self.generate_client_request_id = True + self.accept_language = None + + self.url = url + self.version = "2018-03-28" + + def _configure(self, **kwargs): + self.connection = ConnectionConfiguration(**kwargs) + self.user_agent_policy = policies.UserAgentPolicy(**kwargs) + self.headers_policy = policies.HeadersPolicy(**kwargs) + self.proxy_policy = policies.ProxyPolicy(**kwargs) + self.logging_policy = policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = policies.RetryPolicy(**kwargs) + self.custom_hook_policy = policies.CustomHookPolicy(**kwargs) + self.redirect_policy = policies.RedirectPolicy(**kwargs) diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/__init__.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/__init__.py new file mode 100644 index 000000000000..2e7dbc5e617f --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._azure_queue_storage_async import AzureQueueStorage +from ._configuration_async import AzureQueueStorageConfiguration +__all__ = ['AzureQueueStorage', 'AzureQueueStorageConfiguration'] diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_azure_queue_storage_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_azure_queue_storage_async.py new file mode 100644 index 000000000000..9aa6234b6702 --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_azure_queue_storage_async.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.core import AsyncPipelineClient +from msrest import Serializer, Deserializer + +from ._configuration_async import AzureQueueStorageConfiguration +from azure.core.exceptions import map_error +from .operations_async import ServiceOperations +from .operations_async import QueueOperations +from .operations_async import MessagesOperations +from .operations_async import MessageIdOperations +from .. import models + + +class AzureQueueStorage(object): + """AzureQueueStorage + + + :ivar service: Service operations + :vartype service: queue.aio.operations_async.ServiceOperations + :ivar queue: Queue operations + :vartype queue: queue.aio.operations_async.QueueOperations + :ivar messages: Messages operations + :vartype messages: queue.aio.operations_async.MessagesOperations + :ivar message_id: MessageId operations + :vartype message_id: queue.aio.operations_async.MessageIdOperations + + :param url: The URL of the service account, queue or message that is the + targe of the desired operation. + :type url: str + """ + + def __init__( + self, url, config=None, **kwargs): + + base_url = '{url}' + self._config = config or AzureQueueStorageConfiguration(url, **kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-03-28' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.service = ServiceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue = QueueOperations( + self._client, self._config, self._serialize, self._deserialize) + self.messages = MessagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.message_id = MessageIdOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def __aenter__(self): + await self._client.__aenter__() + return self + async def __aexit__(self, *exc_details): + await self._client.__aexit__(*exc_details) diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_configuration_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_configuration_async.py new file mode 100644 index 000000000000..835144617df2 --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_configuration_async.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.core.configuration import Configuration, ConnectionConfiguration +from azure.core.pipeline import policies + +from ..version import VERSION + + +class AzureQueueStorageConfiguration(Configuration): + """Configuration for AzureQueueStorage + Note that all parameters used to create this instance are saved as instance + attributes. + + :param url: The URL of the service account, queue or message that is the + targe of the desired operation. + :type url: str + :ivar version: Specifies the version of the operation to use for this + request. + :type version: str + """ + + def __init__(self, url, **kwargs): + + if url is None: + raise ValueError("Parameter 'url' must not be None.") + + super(AzureQueueStorageConfiguration, self).__init__(**kwargs) + self._configure(**kwargs) + + self.user_agent_policy.add_user_agent('azurequeuestorage/{}'.format(VERSION)) + self.generate_client_request_id = True + self.accept_language = None + + self.url = url + self.version = "2018-03-28" + + def _configure(self, **kwargs): + self.connection = ConnectionConfiguration(**kwargs) + self.user_agent_policy = policies.UserAgentPolicy(**kwargs) + self.headers_policy = policies.HeadersPolicy(**kwargs) + self.proxy_policy = policies.ProxyPolicy(**kwargs) + self.logging_policy = policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = policies.AsyncRetryPolicy(**kwargs) + self.redirect_policy = policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/__init__.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/__init__.py new file mode 100644 index 000000000000..5881e5821dae --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._service_operations_async import ServiceOperations +from ._queue_operations_async import QueueOperations +from ._messages_operations_async import MessagesOperations +from ._message_id_operations_async import MessageIdOperations + +__all__ = [ + 'ServiceOperations', + 'QueueOperations', + 'MessagesOperations', + 'MessageIdOperations', +] diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_message_id_operations_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_message_id_operations_async.py new file mode 100644 index 000000000000..f839bdd54bbd --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_message_id_operations_async.py @@ -0,0 +1,177 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import map_error + +from ... import models + + +class MessageIdOperations: + """MessageIdOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self._config = config + + async def update(self, queue_message, pop_receipt, visibilitytimeout, timeout=None, request_id=None, *, cls=None, **kwargs): + """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 queue_message: A Message object which can be stored in a Queue + :type queue_message: ~queue.models.QueueMessage + :param pop_receipt: Required. Specifies the valid pop receipt value + returned from an earlier call to the Get Messages or Update Message + operation. + :type pop_receipt: str + :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. + :type visibilitytimeout: int + :param timeout: The The timeout parameter is expressed in seconds. For + more information, see None: + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self._config = config + self.peekonly = "true" + + async def dequeue(self, number_of_messages=None, visibilitytimeout=None, timeout=None, request_id=None, *, cls=None, **kwargs): + """The Dequeue operation retrieves one or more messages from the front of + the queue. + + :param number_of_messages: 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. + :type number_of_messages: int + :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. + :type visibilitytimeout: int + :param timeout: The The timeout parameter is expressed in seconds. For + more information, see None: + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self._config = config + + async def create(self, timeout=None, metadata=None, request_id=None, *, cls=None, **kwargs): + """creates a new queue under the given account. + + :param timeout: The The timeout parameter is expressed in seconds. For + more information, see None: + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self._config = config + self.restype = "service" + + async def set_properties(self, storage_service_properties, timeout=None, request_id=None, *, cls=None, **kwargs): + """Sets properties for a storage account's Queue service endpoint, + including properties for Storage Analytics and CORS (Cross-Origin + Resource Sharing) rules. + + :param storage_service_properties: The StorageService properties. + :type storage_service_properties: + ~queue.models.StorageServiceProperties + :param timeout: The The timeout parameter is expressed in seconds. For + more information, see None: + super(AccessPolicy, self).__init__(**kwargs) + self.start = start + self.expiry = expiry + self.permission = permission + + +class CorsRule(Model): + """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. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. 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. + :type allowed_origins: str + :param allowed_methods: Required. The methods (HTTP request verbs) that + the origin domain may use for a CORS request. (comma separated) + :type allowed_methods: str + :param allowed_headers: Required. the request headers that the origin + domain may specify on the CORS request. + :type allowed_headers: str + :param exposed_headers: Required. The response headers that may be sent in + the response to the CORS request and exposed by the browser to the request + issuer + :type exposed_headers: str + :param max_age_in_seconds: Required. The maximum amount time that a + browser should cache the preflight OPTIONS request. + :type max_age_in_seconds: int + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'allowed_headers': {'required': True}, + 'exposed_headers': {'required': True}, + 'max_age_in_seconds': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'AllowedOrigins', 'type': 'str'}, + 'allowed_methods': {'key': 'AllowedMethods', 'type': 'str'}, + 'allowed_headers': {'key': 'AllowedHeaders', 'type': 'str'}, + 'exposed_headers': {'key': 'ExposedHeaders', 'type': 'str'}, + 'max_age_in_seconds': {'key': 'MaxAgeInSeconds', 'type': 'int'}, + } + + def __init__(self, *, allowed_origins: str, allowed_methods: str, allowed_headers: str, exposed_headers: str, max_age_in_seconds: int, **kwargs) -> None: + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.allowed_headers = allowed_headers + self.exposed_headers = exposed_headers + self.max_age_in_seconds = max_age_in_seconds + + +class DequeuedMessageItem(Model): + """The object returned in the QueueMessageList array when calling Get Messages + on a Queue. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The Id of the Message. + :type message_id: str + :param insertion_time: Required. The time the Message was inserted into + the Queue. + :type insertion_time: datetime + :param expiration_time: Required. The time that the Message will expire + and be automatically deleted. + :type expiration_time: datetime + :param pop_receipt: Required. This value is required to delete the + Message. If deletion fails using this popreceipt then the message has been + dequeued by another client. + :type pop_receipt: str + :param time_next_visible: Required. The time that the message will again + become visible in the Queue. + :type time_next_visible: datetime + :param dequeue_count: Required. The number of times the message has been + dequeued. + :type dequeue_count: long + :param message_text: Required. The content of the Message. + :type message_text: str + """ + + _validation = { + 'message_id': {'required': True}, + 'insertion_time': {'required': True}, + 'expiration_time': {'required': True}, + 'pop_receipt': {'required': True}, + 'time_next_visible': {'required': True}, + 'dequeue_count': {'required': True}, + 'message_text': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'MessageId', 'type': 'str'}, + 'insertion_time': {'key': 'InsertionTime', 'type': 'rfc-1123'}, + 'expiration_time': {'key': 'ExpirationTime', 'type': 'rfc-1123'}, + 'pop_receipt': {'key': 'PopReceipt', 'type': 'str'}, + 'time_next_visible': {'key': 'TimeNextVisible', 'type': 'rfc-1123'}, + 'dequeue_count': {'key': 'DequeueCount', 'type': 'long'}, + 'message_text': {'key': 'MessageText', 'type': 'str'}, + } + + def __init__(self, *, message_id: str, insertion_time, expiration_time, pop_receipt: str, time_next_visible, dequeue_count: int, message_text: str, **kwargs) -> None: + super(DequeuedMessageItem, self).__init__(**kwargs) + self.message_id = message_id + self.insertion_time = insertion_time + self.expiration_time = expiration_time + self.pop_receipt = pop_receipt + self.time_next_visible = time_next_visible + self.dequeue_count = dequeue_count + self.message_text = message_text + + +class EnqueuedMessage(Model): + """The object returned in the QueueMessageList array when calling Put Message + on a Queue. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The Id of the Message. + :type message_id: str + :param insertion_time: Required. The time the Message was inserted into + the Queue. + :type insertion_time: datetime + :param expiration_time: Required. The time that the Message will expire + and be automatically deleted. + :type expiration_time: datetime + :param pop_receipt: Required. This value is required to delete the + Message. If deletion fails using this popreceipt then the message has been + dequeued by another client. + :type pop_receipt: str + :param time_next_visible: Required. The time that the message will again + become visible in the Queue. + :type time_next_visible: datetime + """ + + _validation = { + 'message_id': {'required': True}, + 'insertion_time': {'required': True}, + 'expiration_time': {'required': True}, + 'pop_receipt': {'required': True}, + 'time_next_visible': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'MessageId', 'type': 'str'}, + 'insertion_time': {'key': 'InsertionTime', 'type': 'rfc-1123'}, + 'expiration_time': {'key': 'ExpirationTime', 'type': 'rfc-1123'}, + 'pop_receipt': {'key': 'PopReceipt', 'type': 'str'}, + 'time_next_visible': {'key': 'TimeNextVisible', 'type': 'rfc-1123'}, + } + + def __init__(self, *, message_id: str, insertion_time, expiration_time, pop_receipt: str, time_next_visible, **kwargs) -> None: + super(EnqueuedMessage, self).__init__(**kwargs) + self.message_id = message_id + self.insertion_time = insertion_time + self.expiration_time = expiration_time + self.pop_receipt = pop_receipt + self.time_next_visible = time_next_visible + + +class GeoReplication(Model): + """GeoReplication. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The status of the secondary location. Possible + values include: 'live', 'bootstrap', 'unavailable' + :type status: str or ~queue.models.GeoReplicationStatusType + :param last_sync_time: Required. 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. + :type last_sync_time: datetime + """ + + _validation = { + 'status': {'required': True}, + 'last_sync_time': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'Status', 'type': 'str'}, + 'last_sync_time': {'key': 'LastSyncTime', 'type': 'rfc-1123'}, + } + + def __init__(self, *, status, last_sync_time, **kwargs) -> None: + super(GeoReplication, self).__init__(**kwargs) + self.status = status + self.last_sync_time = last_sync_time + + +class ListQueuesSegmentResponse(Model): + """The object returned when calling List Queues on a Queue Service. + + All required parameters must be populated in order to send to Azure. + + :param service_endpoint: Required. + :type service_endpoint: str + :param prefix: Required. + :type prefix: str + :param marker: + :type marker: str + :param max_results: Required. + :type max_results: int + :param queue_items: + :type queue_items: list[~queue.models.QueueItem] + :param next_marker: Required. + :type next_marker: str + """ + + _validation = { + 'service_endpoint': {'required': True}, + 'prefix': {'required': True}, + 'max_results': {'required': True}, + 'next_marker': {'required': True}, + } + + _attribute_map = { + 'service_endpoint': {'key': 'ServiceEndpoint', 'type': 'str'}, + 'prefix': {'key': 'Prefix', 'type': 'str'}, + 'marker': {'key': 'Marker', 'type': 'str'}, + 'max_results': {'key': 'MaxResults', 'type': 'int'}, + 'queue_items': {'key': 'QueueItems', 'type': '[QueueItem]'}, + 'next_marker': {'key': 'NextMarker', 'type': 'str'}, + } + + def __init__(self, *, service_endpoint: str, prefix: str, max_results: int, next_marker: str, marker: str=None, queue_items=None, **kwargs) -> None: + super(ListQueuesSegmentResponse, self).__init__(**kwargs) + self.service_endpoint = service_endpoint + self.prefix = prefix + self.marker = marker + self.max_results = max_results + self.queue_items = queue_items + self.next_marker = next_marker + + +class Logging(Model): + """Azure Analytics Logging settings. + + All required parameters must be populated in order to send to Azure. + + :param version: Required. The version of Storage Analytics to configure. + :type version: str + :param delete: Required. Indicates whether all delete requests should be + logged. + :type delete: bool + :param read: Required. Indicates whether all read requests should be + logged. + :type read: bool + :param write: Required. Indicates whether all write requests should be + logged. + :type write: bool + :param retention_policy: Required. + :type retention_policy: ~queue.models.RetentionPolicy + """ + + _validation = { + 'version': {'required': True}, + 'delete': {'required': True}, + 'read': {'required': True}, + 'write': {'required': True}, + 'retention_policy': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'Version', 'type': 'str'}, + 'delete': {'key': 'Delete', 'type': 'bool'}, + 'read': {'key': 'Read', 'type': 'bool'}, + 'write': {'key': 'Write', 'type': 'bool'}, + 'retention_policy': {'key': 'RetentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, *, version: str, delete: bool, read: bool, write: bool, retention_policy, **kwargs) -> None: + super(Logging, self).__init__(**kwargs) + self.version = version + self.delete = delete + self.read = read + self.write = write + self.retention_policy = retention_policy + + +class Metrics(Model): + """Metrics. + + All required parameters must be populated in order to send to Azure. + + :param version: The version of Storage Analytics to configure. + :type version: str + :param enabled: Required. Indicates whether metrics are enabled for the + Queue service. + :type enabled: bool + :param include_ap_is: Indicates whether metrics should generate summary + statistics for called API operations. + :type include_ap_is: bool + :param retention_policy: + :type retention_policy: ~queue.models.RetentionPolicy + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'Version', 'type': 'str'}, + 'enabled': {'key': 'Enabled', 'type': 'bool'}, + 'include_ap_is': {'key': 'IncludeAPIs', 'type': 'bool'}, + 'retention_policy': {'key': 'RetentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, *, enabled: bool, version: str=None, include_ap_is: bool=None, retention_policy=None, **kwargs) -> None: + super(Metrics, self).__init__(**kwargs) + self.version = version + self.enabled = enabled + self.include_ap_is = include_ap_is + self.retention_policy = retention_policy + + +class PeekedMessageItem(Model): + """The object returned in the QueueMessageList array when calling Peek + Messages on a Queue. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The Id of the Message. + :type message_id: str + :param insertion_time: Required. The time the Message was inserted into + the Queue. + :type insertion_time: datetime + :param expiration_time: Required. The time that the Message will expire + and be automatically deleted. + :type expiration_time: datetime + :param dequeue_count: Required. The number of times the message has been + dequeued. + :type dequeue_count: long + :param message_text: Required. The content of the Message. + :type message_text: str + """ + + _validation = { + 'message_id': {'required': True}, + 'insertion_time': {'required': True}, + 'expiration_time': {'required': True}, + 'dequeue_count': {'required': True}, + 'message_text': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'MessageId', 'type': 'str'}, + 'insertion_time': {'key': 'InsertionTime', 'type': 'rfc-1123'}, + 'expiration_time': {'key': 'ExpirationTime', 'type': 'rfc-1123'}, + 'dequeue_count': {'key': 'DequeueCount', 'type': 'long'}, + 'message_text': {'key': 'MessageText', 'type': 'str'}, + } + + def __init__(self, *, message_id: str, insertion_time, expiration_time, dequeue_count: int, message_text: str, **kwargs) -> None: + super(PeekedMessageItem, self).__init__(**kwargs) + self.message_id = message_id + self.insertion_time = insertion_time + self.expiration_time = expiration_time + self.dequeue_count = dequeue_count + self.message_text = message_text + + +class QueueItem(Model): + """An Azure Storage Queue. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the Queue. + :type name: str + :param metadata: + :type metadata: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'metadata': {'key': 'Metadata', 'type': '{str}'}, + } + + def __init__(self, *, name: str, metadata=None, **kwargs) -> None: + super(QueueItem, self).__init__(**kwargs) + self.name = name + self.metadata = metadata + + +class QueueMessage(Model): + """A Message object which can be stored in a Queue. + + All required parameters must be populated in order to send to Azure. + + :param message_text: Required. The content of the message + :type message_text: str + """ + + _validation = { + 'message_text': {'required': True}, + } + + _attribute_map = { + 'message_text': {'key': 'MessageText', 'type': 'str'}, + } + + def __init__(self, *, message_text: str, **kwargs) -> None: + super(QueueMessage, self).__init__(**kwargs) + self.message_text = message_text + + +class RetentionPolicy(Model): + """the retention policy. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Indicates whether a retention policy is enabled + for the storage service + :type enabled: bool + :param days: 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 + :type days: int + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'Enabled', 'type': 'bool'}, + 'days': {'key': 'Days', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, days: int=None, **kwargs) -> None: + super(RetentionPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + + +class SignedIdentifier(Model): + """signed identifier. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. a unique id + :type id: str + :param access_policy: Required. The access policy + :type access_policy: ~queue.models.AccessPolicy + """ + + _validation = { + 'id': {'required': True}, + 'access_policy': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'Id', 'type': 'str'}, + 'access_policy': {'key': 'AccessPolicy', 'type': 'AccessPolicy'}, + } + + def __init__(self, *, id: str, access_policy, **kwargs) -> None: + super(SignedIdentifier, self).__init__(**kwargs) + self.id = id + self.access_policy = access_policy + + +class StorageError(Model): + """StorageError. + + :param message: + :type message: str + """ + + _attribute_map = { + 'message': {'key': 'Message', 'type': 'str'}, + } + + def __init__(self, *, message: str=None, **kwargs) -> None: + super(StorageError, self).__init__(**kwargs) + self.message = message + + +class StorageErrorException(HttpResponseError): + """Server responsed with exception of type: 'StorageError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, response, deserialize, *args): + + model_name = 'StorageError' + self.error = deserialize(model_name, response) + if self.error is None: + self.error = deserialize.dependencies[model_name]() + super(StorageErrorException, self).__init__(response=response) + + +class StorageServiceProperties(Model): + """Storage Service Properties. + + :param logging: Azure Analytics Logging settings + :type logging: ~queue.models.Logging + :param hour_metrics: A summary of request statistics grouped by API in + hourly aggregates for queues + :type hour_metrics: ~queue.models.Metrics + :param minute_metrics: a summary of request statistics grouped by API in + minute aggregates for queues + :type minute_metrics: ~queue.models.Metrics + :param cors: The set of CORS rules. + :type cors: list[~queue.models.CorsRule] + """ + + _attribute_map = { + 'logging': {'key': 'Logging', 'type': 'Logging'}, + 'hour_metrics': {'key': 'HourMetrics', 'type': 'Metrics'}, + 'minute_metrics': {'key': 'MinuteMetrics', 'type': 'Metrics'}, + 'cors': {'key': 'Cors', 'type': '[CorsRule]'}, + } + + def __init__(self, *, logging=None, hour_metrics=None, minute_metrics=None, cors=None, **kwargs) -> None: + super(StorageServiceProperties, self).__init__(**kwargs) + self.logging = logging + self.hour_metrics = hour_metrics + self.minute_metrics = minute_metrics + self.cors = cors + + +class StorageServiceStats(Model): + """Stats for the storage service. + + :param geo_replication: Geo-Replication information for the Secondary + Storage Service + :type geo_replication: ~queue.models.GeoReplication + """ + + _attribute_map = { + 'geo_replication': {'key': 'GeoReplication', 'type': 'GeoReplication'}, + } + + def __init__(self, *, geo_replication=None, **kwargs) -> None: + super(StorageServiceStats, self).__init__(**kwargs) + self.geo_replication = geo_replication diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/__init__.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/__init__.py new file mode 100644 index 000000000000..b003039c5ca4 --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._service_operations import ServiceOperations +from ._queue_operations import QueueOperations +from ._messages_operations import MessagesOperations +from ._message_id_operations import MessageIdOperations + +__all__ = [ + 'ServiceOperations', + 'QueueOperations', + 'MessagesOperations', + 'MessageIdOperations', +] diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_message_id_operations.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_message_id_operations.py new file mode 100644 index 000000000000..3f9e3db5ab4f --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_message_id_operations.py @@ -0,0 +1,177 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import map_error + +from .. import models + + +class MessageIdOperations(object): + """MessageIdOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self._config = config + + def update(self, queue_message, pop_receipt, visibilitytimeout, timeout=None, request_id=None, cls=None, **kwargs): + """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 queue_message: A Message object which can be stored in a Queue + :type queue_message: ~queue.models.QueueMessage + :param pop_receipt: Required. Specifies the valid pop receipt value + returned from an earlier call to the Get Messages or Update Message + operation. + :type pop_receipt: str + :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. + :type visibilitytimeout: int + :param timeout: The The timeout parameter is expressed in seconds. For + more information, see