azure_storage_queue 0.6.0

Microsoft Azure Queue client library for Rust
Documentation
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

use super::{ListQueuesIncludeType, QueueMessage};
use azure_core::{
    fmt::SafeDebug,
    http::{pager::PagerOptions, ClientMethodOptions, RequestContent, XmlFormat},
};
use std::collections::HashMap;

/// Options to be passed to `QueueClient::clear()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientClearOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::create()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientCreateOptions<'a> {
    /// The metadata headers.
    pub metadata: Option<HashMap<String, String>>,

    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::delete_message()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientDeleteMessageOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::delete()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientDeleteOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::get_access_policy()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientGetAccessPolicyOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::get_properties()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientGetPropertiesOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::peek_messages()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientPeekMessagesOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// 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.
    pub number_of_messages: Option<i32>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::receive_messages()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientReceiveMessagesOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// 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.
    pub number_of_messages: Option<i32>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,

    /// Specifies the new visibility timeout value, in seconds, relative to server time. A specified value must be
    /// larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message
    /// can be set to a value later than the expiry time.
    pub visibility_timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::send_message()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientSendMessageOptions<'a> {
    /// 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.
    pub message_time_to_live: Option<i32>,

    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,

    /// Specifies the new visibility timeout value, in seconds, relative to server time. A specified value must be
    /// larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message
    /// can be set to a value later than the expiry time.
    pub visibility_timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::set_access_policy()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientSetAccessPolicyOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::set_metadata()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientSetMetadataOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueClient::update_message()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueClientUpdateMessageOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The queue message. The message must be in a format that can be included in
    /// an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size.
    pub queue_message: Option<RequestContent<QueueMessage, XmlFormat>>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueServiceClient::get_properties()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueServiceClientGetPropertiesOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueServiceClient::get_statistics()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueServiceClientGetStatisticsOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

/// Options to be passed to `QueueServiceClient::list_queues()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueServiceClientListQueuesOptions<'a> {
    /// Specify to include additional, optional information.
    pub include: Option<Vec<ListQueuesIncludeType>>,

    /// Identifies the portion of the list of queues to be returned with the next listing operation. The operation
    /// returns the marker value if the listing operation did not return all queues remaining. The marker value can
    /// be used as the value for the marker parameter in a subsequent call to request the next page of list items.
    /// The marker value is opaque to the client.
    pub marker: Option<String>,

    /// 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.
    pub maxresults: Option<i32>,

    /// Allows customization of the method call.
    pub method_options: PagerOptions<'a>,

    /// Filters the results to return only queues whose name begins with the specified prefix.
    pub prefix: Option<String>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}

impl QueueServiceClientListQueuesOptions<'_> {
    /// Transforms this [`QueueServiceClientListQueuesOptions`] into a new `QueueServiceClientListQueuesOptions` that owns the underlying data, cloning it if necessary.
    pub fn into_owned(self) -> QueueServiceClientListQueuesOptions<'static> {
        QueueServiceClientListQueuesOptions {
            include: self.include,
            marker: self.marker,
            maxresults: self.maxresults,
            method_options: PagerOptions {
                context: self.method_options.context.into_owned(),
                ..self.method_options
            },
            prefix: self.prefix,
            timeout: self.timeout,
        }
    }
}

/// Options to be passed to `QueueServiceClient::set_properties()`
#[derive(Clone, Default, SafeDebug)]
pub struct QueueServiceClientSetPropertiesOptions<'a> {
    /// Allows customization of the method call.
    pub method_options: ClientMethodOptions<'a>,

    /// The timeout parameter is expressed in seconds. For more information, see [Setting Timeouts for Queue Service Operations.](https://learn.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations)
    pub timeout: Option<i32>,
}