#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilterExpression {
#[prost(enumeration = "FilterType", tag = "1")]
pub r#type: i32,
#[prost(string, tag = "2")]
pub expression: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetryPolicy {
#[prost(int32, tag = "1")]
pub max_attempts: i32,
#[prost(oneof = "retry_policy::Strategy", tags = "2, 3")]
pub strategy: ::core::option::Option<retry_policy::Strategy>,
}
pub mod retry_policy {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Strategy {
#[prost(message, tag = "2")]
ExponentialBackoff(super::ExponentialBackoff),
#[prost(message, tag = "3")]
CustomizedBackoff(super::CustomizedBackoff),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExponentialBackoff {
#[prost(message, optional, tag = "1")]
pub initial: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "2")]
pub max: ::core::option::Option<::prost_types::Duration>,
#[prost(float, tag = "3")]
pub multiplier: f32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CustomizedBackoff {
#[prost(message, repeated, tag = "1")]
pub next: ::prost::alloc::vec::Vec<::prost_types::Duration>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Resource {
#[prost(string, tag = "1")]
pub resource_namespace: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscriptionEntry {
#[prost(message, optional, tag = "1")]
pub topic: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub expression: ::core::option::Option<FilterExpression>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Address {
#[prost(string, tag = "1")]
pub host: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub port: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Endpoints {
#[prost(enumeration = "AddressScheme", tag = "1")]
pub scheme: i32,
#[prost(message, repeated, tag = "2")]
pub addresses: ::prost::alloc::vec::Vec<Address>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Broker {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub id: i32,
#[prost(message, optional, tag = "3")]
pub endpoints: ::core::option::Option<Endpoints>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageQueue {
#[prost(message, optional, tag = "1")]
pub topic: ::core::option::Option<Resource>,
#[prost(int32, tag = "2")]
pub id: i32,
#[prost(enumeration = "Permission", tag = "3")]
pub permission: i32,
#[prost(message, optional, tag = "4")]
pub broker: ::core::option::Option<Broker>,
#[prost(enumeration = "MessageType", repeated, tag = "5")]
pub accept_message_types: ::prost::alloc::vec::Vec<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Digest {
#[prost(enumeration = "DigestType", tag = "1")]
pub r#type: i32,
#[prost(string, tag = "2")]
pub checksum: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SystemProperties {
#[prost(string, optional, tag = "1")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub message_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub body_digest: ::core::option::Option<Digest>,
#[prost(enumeration = "Encoding", tag = "5")]
pub body_encoding: i32,
#[prost(enumeration = "MessageType", tag = "6")]
pub message_type: i32,
#[prost(message, optional, tag = "7")]
pub born_timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "8")]
pub born_host: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub store_timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "10")]
pub store_host: ::prost::alloc::string::String,
#[prost(message, optional, tag = "11")]
pub delivery_timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, optional, tag = "12")]
pub receipt_handle: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, tag = "13")]
pub queue_id: i32,
#[prost(int64, optional, tag = "14")]
pub queue_offset: ::core::option::Option<i64>,
#[prost(message, optional, tag = "15")]
pub invisible_duration: ::core::option::Option<::prost_types::Duration>,
#[prost(int32, optional, tag = "16")]
pub delivery_attempt: ::core::option::Option<i32>,
#[prost(string, optional, tag = "17")]
pub message_group: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "18")]
pub trace_context: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "19")]
pub orphaned_transaction_recovery_duration: ::core::option::Option<
::prost_types::Duration,
>,
#[prost(message, optional, tag = "20")]
pub dead_letter_queue: ::core::option::Option<DeadLetterQueue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeadLetterQueue {
#[prost(string, tag = "1")]
pub topic: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub message_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Message {
#[prost(message, optional, tag = "1")]
pub topic: ::core::option::Option<Resource>,
#[prost(map = "string, string", tag = "2")]
pub user_properties: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "3")]
pub system_properties: ::core::option::Option<SystemProperties>,
#[prost(bytes = "vec", tag = "4")]
pub body: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Assignment {
#[prost(message, optional, tag = "1")]
pub message_queue: ::core::option::Option<MessageQueue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Status {
#[prost(enumeration = "Code", tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Ua {
#[prost(enumeration = "Language", tag = "1")]
pub language: i32,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub platform: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub hostname: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Settings {
#[prost(enumeration = "ClientType", optional, tag = "1")]
pub client_type: ::core::option::Option<i32>,
#[prost(message, optional, tag = "2")]
pub access_point: ::core::option::Option<Endpoints>,
#[prost(message, optional, tag = "3")]
pub backoff_policy: ::core::option::Option<RetryPolicy>,
#[prost(message, optional, tag = "4")]
pub request_timeout: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "7")]
pub user_agent: ::core::option::Option<Ua>,
#[prost(message, optional, tag = "8")]
pub metric: ::core::option::Option<Metric>,
#[prost(oneof = "settings::PubSub", tags = "5, 6")]
pub pub_sub: ::core::option::Option<settings::PubSub>,
}
pub mod settings {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PubSub {
#[prost(message, tag = "5")]
Publishing(super::Publishing),
#[prost(message, tag = "6")]
Subscription(super::Subscription),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Publishing {
#[prost(message, repeated, tag = "1")]
pub topics: ::prost::alloc::vec::Vec<Resource>,
#[prost(int32, tag = "2")]
pub max_body_size: i32,
#[prost(bool, tag = "3")]
pub validate_message_type: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Subscription {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
#[prost(message, repeated, tag = "2")]
pub subscriptions: ::prost::alloc::vec::Vec<SubscriptionEntry>,
#[prost(bool, optional, tag = "3")]
pub fifo: ::core::option::Option<bool>,
#[prost(int32, optional, tag = "4")]
pub receive_batch_size: ::core::option::Option<i32>,
#[prost(message, optional, tag = "5")]
pub long_polling_timeout: ::core::option::Option<::prost_types::Duration>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Metric {
#[prost(bool, tag = "1")]
pub on: bool,
#[prost(message, optional, tag = "2")]
pub endpoints: ::core::option::Option<Endpoints>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TransactionResolution {
Unspecified = 0,
Commit = 1,
Rollback = 2,
}
impl TransactionResolution {
pub fn as_str_name(&self) -> &'static str {
match self {
TransactionResolution::Unspecified => "TRANSACTION_RESOLUTION_UNSPECIFIED",
TransactionResolution::Commit => "COMMIT",
TransactionResolution::Rollback => "ROLLBACK",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRANSACTION_RESOLUTION_UNSPECIFIED" => Some(Self::Unspecified),
"COMMIT" => Some(Self::Commit),
"ROLLBACK" => Some(Self::Rollback),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TransactionSource {
SourceUnspecified = 0,
SourceClient = 1,
SourceServerCheck = 2,
}
impl TransactionSource {
pub fn as_str_name(&self) -> &'static str {
match self {
TransactionSource::SourceUnspecified => "SOURCE_UNSPECIFIED",
TransactionSource::SourceClient => "SOURCE_CLIENT",
TransactionSource::SourceServerCheck => "SOURCE_SERVER_CHECK",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SOURCE_UNSPECIFIED" => Some(Self::SourceUnspecified),
"SOURCE_CLIENT" => Some(Self::SourceClient),
"SOURCE_SERVER_CHECK" => Some(Self::SourceServerCheck),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Permission {
Unspecified = 0,
None = 1,
Read = 2,
Write = 3,
ReadWrite = 4,
}
impl Permission {
pub fn as_str_name(&self) -> &'static str {
match self {
Permission::Unspecified => "PERMISSION_UNSPECIFIED",
Permission::None => "NONE",
Permission::Read => "READ",
Permission::Write => "WRITE",
Permission::ReadWrite => "READ_WRITE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PERMISSION_UNSPECIFIED" => Some(Self::Unspecified),
"NONE" => Some(Self::None),
"READ" => Some(Self::Read),
"WRITE" => Some(Self::Write),
"READ_WRITE" => Some(Self::ReadWrite),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FilterType {
Unspecified = 0,
Tag = 1,
Sql = 2,
}
impl FilterType {
pub fn as_str_name(&self) -> &'static str {
match self {
FilterType::Unspecified => "FILTER_TYPE_UNSPECIFIED",
FilterType::Tag => "TAG",
FilterType::Sql => "SQL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FILTER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"TAG" => Some(Self::Tag),
"SQL" => Some(Self::Sql),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AddressScheme {
Unspecified = 0,
IPv4 = 1,
IPv6 = 2,
DomainName = 3,
}
impl AddressScheme {
pub fn as_str_name(&self) -> &'static str {
match self {
AddressScheme::Unspecified => "ADDRESS_SCHEME_UNSPECIFIED",
AddressScheme::IPv4 => "IPv4",
AddressScheme::IPv6 => "IPv6",
AddressScheme::DomainName => "DOMAIN_NAME",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ADDRESS_SCHEME_UNSPECIFIED" => Some(Self::Unspecified),
"IPv4" => Some(Self::IPv4),
"IPv6" => Some(Self::IPv6),
"DOMAIN_NAME" => Some(Self::DomainName),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MessageType {
Unspecified = 0,
Normal = 1,
Fifo = 2,
Delay = 3,
Transaction = 4,
}
impl MessageType {
pub fn as_str_name(&self) -> &'static str {
match self {
MessageType::Unspecified => "MESSAGE_TYPE_UNSPECIFIED",
MessageType::Normal => "NORMAL",
MessageType::Fifo => "FIFO",
MessageType::Delay => "DELAY",
MessageType::Transaction => "TRANSACTION",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MESSAGE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"NORMAL" => Some(Self::Normal),
"FIFO" => Some(Self::Fifo),
"DELAY" => Some(Self::Delay),
"TRANSACTION" => Some(Self::Transaction),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DigestType {
Unspecified = 0,
Crc32 = 1,
Md5 = 2,
Sha1 = 3,
}
impl DigestType {
pub fn as_str_name(&self) -> &'static str {
match self {
DigestType::Unspecified => "DIGEST_TYPE_UNSPECIFIED",
DigestType::Crc32 => "CRC32",
DigestType::Md5 => "MD5",
DigestType::Sha1 => "SHA1",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DIGEST_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"CRC32" => Some(Self::Crc32),
"MD5" => Some(Self::Md5),
"SHA1" => Some(Self::Sha1),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ClientType {
Unspecified = 0,
Producer = 1,
PushConsumer = 2,
SimpleConsumer = 3,
PullConsumer = 4,
}
impl ClientType {
pub fn as_str_name(&self) -> &'static str {
match self {
ClientType::Unspecified => "CLIENT_TYPE_UNSPECIFIED",
ClientType::Producer => "PRODUCER",
ClientType::PushConsumer => "PUSH_CONSUMER",
ClientType::SimpleConsumer => "SIMPLE_CONSUMER",
ClientType::PullConsumer => "PULL_CONSUMER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CLIENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"PRODUCER" => Some(Self::Producer),
"PUSH_CONSUMER" => Some(Self::PushConsumer),
"SIMPLE_CONSUMER" => Some(Self::SimpleConsumer),
"PULL_CONSUMER" => Some(Self::PullConsumer),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Encoding {
Unspecified = 0,
Identity = 1,
Gzip = 2,
}
impl Encoding {
pub fn as_str_name(&self) -> &'static str {
match self {
Encoding::Unspecified => "ENCODING_UNSPECIFIED",
Encoding::Identity => "IDENTITY",
Encoding::Gzip => "GZIP",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ENCODING_UNSPECIFIED" => Some(Self::Unspecified),
"IDENTITY" => Some(Self::Identity),
"GZIP" => Some(Self::Gzip),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Code {
Unspecified = 0,
Ok = 20000,
MultipleResults = 30000,
BadRequest = 40000,
IllegalAccessPoint = 40001,
IllegalTopic = 40002,
IllegalConsumerGroup = 40003,
IllegalMessageTag = 40004,
IllegalMessageKey = 40005,
IllegalMessageGroup = 40006,
IllegalMessagePropertyKey = 40007,
InvalidTransactionId = 40008,
IllegalMessageId = 40009,
IllegalFilterExpression = 40010,
IllegalInvisibleTime = 40011,
IllegalDeliveryTime = 40012,
InvalidReceiptHandle = 40013,
MessagePropertyConflictWithType = 40014,
UnrecognizedClientType = 40015,
MessageCorrupted = 40016,
ClientIdRequired = 40017,
IllegalPollingTime = 40018,
Unauthorized = 40100,
PaymentRequired = 40200,
Forbidden = 40300,
NotFound = 40400,
MessageNotFound = 40401,
TopicNotFound = 40402,
ConsumerGroupNotFound = 40403,
RequestTimeout = 40800,
PayloadTooLarge = 41300,
MessageBodyTooLarge = 41301,
PreconditionFailed = 42800,
TooManyRequests = 42900,
RequestHeaderFieldsTooLarge = 43100,
MessagePropertiesTooLarge = 43101,
InternalError = 50000,
InternalServerError = 50001,
HaNotAvailable = 50002,
NotImplemented = 50100,
ProxyTimeout = 50400,
MasterPersistenceTimeout = 50401,
SlavePersistenceTimeout = 50402,
Unsupported = 50500,
VersionUnsupported = 50501,
VerifyFifoMessageUnsupported = 50502,
FailedToConsumeMessage = 60000,
}
impl Code {
pub fn as_str_name(&self) -> &'static str {
match self {
Code::Unspecified => "CODE_UNSPECIFIED",
Code::Ok => "OK",
Code::MultipleResults => "MULTIPLE_RESULTS",
Code::BadRequest => "BAD_REQUEST",
Code::IllegalAccessPoint => "ILLEGAL_ACCESS_POINT",
Code::IllegalTopic => "ILLEGAL_TOPIC",
Code::IllegalConsumerGroup => "ILLEGAL_CONSUMER_GROUP",
Code::IllegalMessageTag => "ILLEGAL_MESSAGE_TAG",
Code::IllegalMessageKey => "ILLEGAL_MESSAGE_KEY",
Code::IllegalMessageGroup => "ILLEGAL_MESSAGE_GROUP",
Code::IllegalMessagePropertyKey => "ILLEGAL_MESSAGE_PROPERTY_KEY",
Code::InvalidTransactionId => "INVALID_TRANSACTION_ID",
Code::IllegalMessageId => "ILLEGAL_MESSAGE_ID",
Code::IllegalFilterExpression => "ILLEGAL_FILTER_EXPRESSION",
Code::IllegalInvisibleTime => "ILLEGAL_INVISIBLE_TIME",
Code::IllegalDeliveryTime => "ILLEGAL_DELIVERY_TIME",
Code::InvalidReceiptHandle => "INVALID_RECEIPT_HANDLE",
Code::MessagePropertyConflictWithType => {
"MESSAGE_PROPERTY_CONFLICT_WITH_TYPE"
}
Code::UnrecognizedClientType => "UNRECOGNIZED_CLIENT_TYPE",
Code::MessageCorrupted => "MESSAGE_CORRUPTED",
Code::ClientIdRequired => "CLIENT_ID_REQUIRED",
Code::IllegalPollingTime => "ILLEGAL_POLLING_TIME",
Code::Unauthorized => "UNAUTHORIZED",
Code::PaymentRequired => "PAYMENT_REQUIRED",
Code::Forbidden => "FORBIDDEN",
Code::NotFound => "NOT_FOUND",
Code::MessageNotFound => "MESSAGE_NOT_FOUND",
Code::TopicNotFound => "TOPIC_NOT_FOUND",
Code::ConsumerGroupNotFound => "CONSUMER_GROUP_NOT_FOUND",
Code::RequestTimeout => "REQUEST_TIMEOUT",
Code::PayloadTooLarge => "PAYLOAD_TOO_LARGE",
Code::MessageBodyTooLarge => "MESSAGE_BODY_TOO_LARGE",
Code::PreconditionFailed => "PRECONDITION_FAILED",
Code::TooManyRequests => "TOO_MANY_REQUESTS",
Code::RequestHeaderFieldsTooLarge => "REQUEST_HEADER_FIELDS_TOO_LARGE",
Code::MessagePropertiesTooLarge => "MESSAGE_PROPERTIES_TOO_LARGE",
Code::InternalError => "INTERNAL_ERROR",
Code::InternalServerError => "INTERNAL_SERVER_ERROR",
Code::HaNotAvailable => "HA_NOT_AVAILABLE",
Code::NotImplemented => "NOT_IMPLEMENTED",
Code::ProxyTimeout => "PROXY_TIMEOUT",
Code::MasterPersistenceTimeout => "MASTER_PERSISTENCE_TIMEOUT",
Code::SlavePersistenceTimeout => "SLAVE_PERSISTENCE_TIMEOUT",
Code::Unsupported => "UNSUPPORTED",
Code::VersionUnsupported => "VERSION_UNSUPPORTED",
Code::VerifyFifoMessageUnsupported => "VERIFY_FIFO_MESSAGE_UNSUPPORTED",
Code::FailedToConsumeMessage => "FAILED_TO_CONSUME_MESSAGE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CODE_UNSPECIFIED" => Some(Self::Unspecified),
"OK" => Some(Self::Ok),
"MULTIPLE_RESULTS" => Some(Self::MultipleResults),
"BAD_REQUEST" => Some(Self::BadRequest),
"ILLEGAL_ACCESS_POINT" => Some(Self::IllegalAccessPoint),
"ILLEGAL_TOPIC" => Some(Self::IllegalTopic),
"ILLEGAL_CONSUMER_GROUP" => Some(Self::IllegalConsumerGroup),
"ILLEGAL_MESSAGE_TAG" => Some(Self::IllegalMessageTag),
"ILLEGAL_MESSAGE_KEY" => Some(Self::IllegalMessageKey),
"ILLEGAL_MESSAGE_GROUP" => Some(Self::IllegalMessageGroup),
"ILLEGAL_MESSAGE_PROPERTY_KEY" => Some(Self::IllegalMessagePropertyKey),
"INVALID_TRANSACTION_ID" => Some(Self::InvalidTransactionId),
"ILLEGAL_MESSAGE_ID" => Some(Self::IllegalMessageId),
"ILLEGAL_FILTER_EXPRESSION" => Some(Self::IllegalFilterExpression),
"ILLEGAL_INVISIBLE_TIME" => Some(Self::IllegalInvisibleTime),
"ILLEGAL_DELIVERY_TIME" => Some(Self::IllegalDeliveryTime),
"INVALID_RECEIPT_HANDLE" => Some(Self::InvalidReceiptHandle),
"MESSAGE_PROPERTY_CONFLICT_WITH_TYPE" => {
Some(Self::MessagePropertyConflictWithType)
}
"UNRECOGNIZED_CLIENT_TYPE" => Some(Self::UnrecognizedClientType),
"MESSAGE_CORRUPTED" => Some(Self::MessageCorrupted),
"CLIENT_ID_REQUIRED" => Some(Self::ClientIdRequired),
"ILLEGAL_POLLING_TIME" => Some(Self::IllegalPollingTime),
"UNAUTHORIZED" => Some(Self::Unauthorized),
"PAYMENT_REQUIRED" => Some(Self::PaymentRequired),
"FORBIDDEN" => Some(Self::Forbidden),
"NOT_FOUND" => Some(Self::NotFound),
"MESSAGE_NOT_FOUND" => Some(Self::MessageNotFound),
"TOPIC_NOT_FOUND" => Some(Self::TopicNotFound),
"CONSUMER_GROUP_NOT_FOUND" => Some(Self::ConsumerGroupNotFound),
"REQUEST_TIMEOUT" => Some(Self::RequestTimeout),
"PAYLOAD_TOO_LARGE" => Some(Self::PayloadTooLarge),
"MESSAGE_BODY_TOO_LARGE" => Some(Self::MessageBodyTooLarge),
"PRECONDITION_FAILED" => Some(Self::PreconditionFailed),
"TOO_MANY_REQUESTS" => Some(Self::TooManyRequests),
"REQUEST_HEADER_FIELDS_TOO_LARGE" => Some(Self::RequestHeaderFieldsTooLarge),
"MESSAGE_PROPERTIES_TOO_LARGE" => Some(Self::MessagePropertiesTooLarge),
"INTERNAL_ERROR" => Some(Self::InternalError),
"INTERNAL_SERVER_ERROR" => Some(Self::InternalServerError),
"HA_NOT_AVAILABLE" => Some(Self::HaNotAvailable),
"NOT_IMPLEMENTED" => Some(Self::NotImplemented),
"PROXY_TIMEOUT" => Some(Self::ProxyTimeout),
"MASTER_PERSISTENCE_TIMEOUT" => Some(Self::MasterPersistenceTimeout),
"SLAVE_PERSISTENCE_TIMEOUT" => Some(Self::SlavePersistenceTimeout),
"UNSUPPORTED" => Some(Self::Unsupported),
"VERSION_UNSUPPORTED" => Some(Self::VersionUnsupported),
"VERIFY_FIFO_MESSAGE_UNSUPPORTED" => Some(Self::VerifyFifoMessageUnsupported),
"FAILED_TO_CONSUME_MESSAGE" => Some(Self::FailedToConsumeMessage),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Language {
Unspecified = 0,
Java = 1,
Cpp = 2,
DotNet = 3,
Golang = 4,
Rust = 5,
Python = 6,
Php = 7,
NodeJs = 8,
Ruby = 9,
ObjectiveC = 10,
Dart = 11,
Kotlin = 12,
}
impl Language {
pub fn as_str_name(&self) -> &'static str {
match self {
Language::Unspecified => "LANGUAGE_UNSPECIFIED",
Language::Java => "JAVA",
Language::Cpp => "CPP",
Language::DotNet => "DOT_NET",
Language::Golang => "GOLANG",
Language::Rust => "RUST",
Language::Python => "PYTHON",
Language::Php => "PHP",
Language::NodeJs => "NODE_JS",
Language::Ruby => "RUBY",
Language::ObjectiveC => "OBJECTIVE_C",
Language::Dart => "DART",
Language::Kotlin => "KOTLIN",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LANGUAGE_UNSPECIFIED" => Some(Self::Unspecified),
"JAVA" => Some(Self::Java),
"CPP" => Some(Self::Cpp),
"DOT_NET" => Some(Self::DotNet),
"GOLANG" => Some(Self::Golang),
"RUST" => Some(Self::Rust),
"PYTHON" => Some(Self::Python),
"PHP" => Some(Self::Php),
"NODE_JS" => Some(Self::NodeJs),
"RUBY" => Some(Self::Ruby),
"OBJECTIVE_C" => Some(Self::ObjectiveC),
"DART" => Some(Self::Dart),
"KOTLIN" => Some(Self::Kotlin),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum QueryOffsetPolicy {
Beginning = 0,
End = 1,
Timestamp = 2,
}
impl QueryOffsetPolicy {
pub fn as_str_name(&self) -> &'static str {
match self {
QueryOffsetPolicy::Beginning => "BEGINNING",
QueryOffsetPolicy::End => "END",
QueryOffsetPolicy::Timestamp => "TIMESTAMP",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BEGINNING" => Some(Self::Beginning),
"END" => Some(Self::End),
"TIMESTAMP" => Some(Self::Timestamp),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRouteRequest {
#[prost(message, optional, tag = "1")]
pub topic: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub endpoints: ::core::option::Option<Endpoints>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRouteResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
#[prost(message, repeated, tag = "2")]
pub message_queues: ::prost::alloc::vec::Vec<MessageQueue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendMessageRequest {
#[prost(message, repeated, tag = "1")]
pub messages: ::prost::alloc::vec::Vec<Message>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendResultEntry {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
#[prost(string, tag = "2")]
pub message_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub transaction_id: ::prost::alloc::string::String,
#[prost(int64, tag = "4")]
pub offset: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendMessageResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
#[prost(message, repeated, tag = "2")]
pub entries: ::prost::alloc::vec::Vec<SendResultEntry>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAssignmentRequest {
#[prost(message, optional, tag = "1")]
pub topic: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub group: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "3")]
pub endpoints: ::core::option::Option<Endpoints>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAssignmentResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
#[prost(message, repeated, tag = "2")]
pub assignments: ::prost::alloc::vec::Vec<Assignment>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReceiveMessageRequest {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub message_queue: ::core::option::Option<MessageQueue>,
#[prost(message, optional, tag = "3")]
pub filter_expression: ::core::option::Option<FilterExpression>,
#[prost(int32, tag = "4")]
pub batch_size: i32,
#[prost(message, optional, tag = "5")]
pub invisible_duration: ::core::option::Option<::prost_types::Duration>,
#[prost(bool, tag = "6")]
pub auto_renew: bool,
#[prost(message, optional, tag = "7")]
pub long_polling_timeout: ::core::option::Option<::prost_types::Duration>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReceiveMessageResponse {
#[prost(oneof = "receive_message_response::Content", tags = "1, 2, 3")]
pub content: ::core::option::Option<receive_message_response::Content>,
}
pub mod receive_message_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Content {
#[prost(message, tag = "1")]
Status(super::Status),
#[prost(message, tag = "2")]
Message(super::Message),
#[prost(message, tag = "3")]
DeliveryTimestamp(::prost_types::Timestamp),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AckMessageEntry {
#[prost(string, tag = "1")]
pub message_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub receipt_handle: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AckMessageRequest {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub topic: ::core::option::Option<Resource>,
#[prost(message, repeated, tag = "3")]
pub entries: ::prost::alloc::vec::Vec<AckMessageEntry>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AckMessageResultEntry {
#[prost(string, tag = "1")]
pub message_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub receipt_handle: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub status: ::core::option::Option<Status>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AckMessageResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
#[prost(message, repeated, tag = "2")]
pub entries: ::prost::alloc::vec::Vec<AckMessageResultEntry>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ForwardMessageToDeadLetterQueueRequest {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub topic: ::core::option::Option<Resource>,
#[prost(string, tag = "3")]
pub receipt_handle: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub message_id: ::prost::alloc::string::String,
#[prost(int32, tag = "5")]
pub delivery_attempt: i32,
#[prost(int32, tag = "6")]
pub max_delivery_attempts: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ForwardMessageToDeadLetterQueueResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HeartbeatRequest {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
#[prost(enumeration = "ClientType", tag = "2")]
pub client_type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HeartbeatResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndTransactionRequest {
#[prost(message, optional, tag = "1")]
pub topic: ::core::option::Option<Resource>,
#[prost(string, tag = "2")]
pub message_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub transaction_id: ::prost::alloc::string::String,
#[prost(enumeration = "TransactionResolution", tag = "4")]
pub resolution: i32,
#[prost(enumeration = "TransactionSource", tag = "5")]
pub source: i32,
#[prost(string, tag = "6")]
pub trace_context: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndTransactionResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PrintThreadStackTraceCommand {
#[prost(string, tag = "1")]
pub nonce: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ThreadStackTrace {
#[prost(string, tag = "1")]
pub nonce: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub thread_stack_trace: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyMessageCommand {
#[prost(string, tag = "1")]
pub nonce: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub message: ::core::option::Option<Message>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyMessageResult {
#[prost(string, tag = "1")]
pub nonce: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecoverOrphanedTransactionCommand {
#[prost(message, optional, tag = "1")]
pub message: ::core::option::Option<Message>,
#[prost(string, tag = "2")]
pub transaction_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TelemetryCommand {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
#[prost(oneof = "telemetry_command::Command", tags = "2, 3, 4, 5, 6, 7")]
pub command: ::core::option::Option<telemetry_command::Command>,
}
pub mod telemetry_command {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Command {
#[prost(message, tag = "2")]
Settings(super::Settings),
#[prost(message, tag = "3")]
ThreadStackTrace(super::ThreadStackTrace),
#[prost(message, tag = "4")]
VerifyMessageResult(super::VerifyMessageResult),
#[prost(message, tag = "5")]
RecoverOrphanedTransactionCommand(super::RecoverOrphanedTransactionCommand),
#[prost(message, tag = "6")]
PrintThreadStackTraceCommand(super::PrintThreadStackTraceCommand),
#[prost(message, tag = "7")]
VerifyMessageCommand(super::VerifyMessageCommand),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotifyClientTerminationRequest {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotifyClientTerminationResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeInvisibleDurationRequest {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub topic: ::core::option::Option<Resource>,
#[prost(string, tag = "3")]
pub receipt_handle: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub invisible_duration: ::core::option::Option<::prost_types::Duration>,
#[prost(string, tag = "5")]
pub message_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeInvisibleDurationResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
#[prost(string, tag = "2")]
pub receipt_handle: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PullMessageRequest {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub message_queue: ::core::option::Option<MessageQueue>,
#[prost(int64, tag = "3")]
pub offset: i64,
#[prost(int32, tag = "4")]
pub batch_size: i32,
#[prost(message, optional, tag = "5")]
pub filter_expression: ::core::option::Option<FilterExpression>,
#[prost(message, optional, tag = "6")]
pub long_polling_timeout: ::core::option::Option<::prost_types::Duration>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PullMessageResponse {
#[prost(oneof = "pull_message_response::Content", tags = "1, 2, 3")]
pub content: ::core::option::Option<pull_message_response::Content>,
}
pub mod pull_message_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Content {
#[prost(message, tag = "1")]
Status(super::Status),
#[prost(message, tag = "2")]
Message(super::Message),
#[prost(int64, tag = "3")]
NextOffset(i64),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateOffsetRequest {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub message_queue: ::core::option::Option<MessageQueue>,
#[prost(int64, tag = "3")]
pub offset: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateOffsetResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOffsetRequest {
#[prost(message, optional, tag = "1")]
pub group: ::core::option::Option<Resource>,
#[prost(message, optional, tag = "2")]
pub message_queue: ::core::option::Option<MessageQueue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOffsetResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
#[prost(int64, tag = "2")]
pub offset: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryOffsetRequest {
#[prost(message, optional, tag = "1")]
pub message_queue: ::core::option::Option<MessageQueue>,
#[prost(enumeration = "QueryOffsetPolicy", tag = "2")]
pub query_offset_policy: i32,
#[prost(message, optional, tag = "3")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryOffsetResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<Status>,
#[prost(int64, tag = "2")]
pub offset: i64,
}
pub mod messaging_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MessagingServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MessagingServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MessagingServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> MessagingServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
MessagingServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn query_route(
&mut self,
request: impl tonic::IntoRequest<super::QueryRouteRequest>,
) -> std::result::Result<
tonic::Response<super::QueryRouteResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/QueryRoute",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("apache.rocketmq.v2.MessagingService", "QueryRoute"),
);
self.inner.unary(req, path, codec).await
}
pub async fn heartbeat(
&mut self,
request: impl tonic::IntoRequest<super::HeartbeatRequest>,
) -> std::result::Result<
tonic::Response<super::HeartbeatResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/Heartbeat",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("apache.rocketmq.v2.MessagingService", "Heartbeat"),
);
self.inner.unary(req, path, codec).await
}
pub async fn send_message(
&mut self,
request: impl tonic::IntoRequest<super::SendMessageRequest>,
) -> std::result::Result<
tonic::Response<super::SendMessageResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/SendMessage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("apache.rocketmq.v2.MessagingService", "SendMessage"),
);
self.inner.unary(req, path, codec).await
}
pub async fn query_assignment(
&mut self,
request: impl tonic::IntoRequest<super::QueryAssignmentRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAssignmentResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/QueryAssignment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"apache.rocketmq.v2.MessagingService",
"QueryAssignment",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn receive_message(
&mut self,
request: impl tonic::IntoRequest<super::ReceiveMessageRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ReceiveMessageResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/ReceiveMessage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"apache.rocketmq.v2.MessagingService",
"ReceiveMessage",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn ack_message(
&mut self,
request: impl tonic::IntoRequest<super::AckMessageRequest>,
) -> std::result::Result<
tonic::Response<super::AckMessageResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/AckMessage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("apache.rocketmq.v2.MessagingService", "AckMessage"),
);
self.inner.unary(req, path, codec).await
}
pub async fn forward_message_to_dead_letter_queue(
&mut self,
request: impl tonic::IntoRequest<
super::ForwardMessageToDeadLetterQueueRequest,
>,
) -> std::result::Result<
tonic::Response<super::ForwardMessageToDeadLetterQueueResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/ForwardMessageToDeadLetterQueue",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"apache.rocketmq.v2.MessagingService",
"ForwardMessageToDeadLetterQueue",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn pull_message(
&mut self,
request: impl tonic::IntoRequest<super::PullMessageRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::PullMessageResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/PullMessage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("apache.rocketmq.v2.MessagingService", "PullMessage"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn update_offset(
&mut self,
request: impl tonic::IntoRequest<super::UpdateOffsetRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateOffsetResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/UpdateOffset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"apache.rocketmq.v2.MessagingService",
"UpdateOffset",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_offset(
&mut self,
request: impl tonic::IntoRequest<super::GetOffsetRequest>,
) -> std::result::Result<
tonic::Response<super::GetOffsetResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/GetOffset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("apache.rocketmq.v2.MessagingService", "GetOffset"),
);
self.inner.unary(req, path, codec).await
}
pub async fn query_offset(
&mut self,
request: impl tonic::IntoRequest<super::QueryOffsetRequest>,
) -> std::result::Result<
tonic::Response<super::QueryOffsetResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/QueryOffset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("apache.rocketmq.v2.MessagingService", "QueryOffset"),
);
self.inner.unary(req, path, codec).await
}
pub async fn end_transaction(
&mut self,
request: impl tonic::IntoRequest<super::EndTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::EndTransactionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/EndTransaction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"apache.rocketmq.v2.MessagingService",
"EndTransaction",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn telemetry(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::TelemetryCommand>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::TelemetryCommand>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/Telemetry",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new("apache.rocketmq.v2.MessagingService", "Telemetry"),
);
self.inner.streaming(req, path, codec).await
}
pub async fn notify_client_termination(
&mut self,
request: impl tonic::IntoRequest<super::NotifyClientTerminationRequest>,
) -> std::result::Result<
tonic::Response<super::NotifyClientTerminationResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/NotifyClientTermination",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"apache.rocketmq.v2.MessagingService",
"NotifyClientTermination",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn change_invisible_duration(
&mut self,
request: impl tonic::IntoRequest<super::ChangeInvisibleDurationRequest>,
) -> std::result::Result<
tonic::Response<super::ChangeInvisibleDurationResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.MessagingService/ChangeInvisibleDuration",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"apache.rocketmq.v2.MessagingService",
"ChangeInvisibleDuration",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeLogLevelRequest {
#[prost(enumeration = "change_log_level_request::Level", tag = "1")]
pub level: i32,
}
pub mod change_log_level_request {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Level {
Trace = 0,
Debug = 1,
Info = 2,
Warn = 3,
Error = 4,
}
impl Level {
pub fn as_str_name(&self) -> &'static str {
match self {
Level::Trace => "TRACE",
Level::Debug => "DEBUG",
Level::Info => "INFO",
Level::Warn => "WARN",
Level::Error => "ERROR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRACE" => Some(Self::Trace),
"DEBUG" => Some(Self::Debug),
"INFO" => Some(Self::Info),
"WARN" => Some(Self::Warn),
"ERROR" => Some(Self::Error),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeLogLevelResponse {
#[prost(string, tag = "1")]
pub remark: ::prost::alloc::string::String,
}
pub mod admin_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct AdminClient<T> {
inner: tonic::client::Grpc<T>,
}
impl AdminClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> AdminClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> AdminClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
AdminClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn change_log_level(
&mut self,
request: impl tonic::IntoRequest<super::ChangeLogLevelRequest>,
) -> std::result::Result<
tonic::Response<super::ChangeLogLevelResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/apache.rocketmq.v2.Admin/ChangeLogLevel",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("apache.rocketmq.v2.Admin", "ChangeLogLevel"));
self.inner.unary(req, path, codec).await
}
}
}