use milkyway_std_derive::CosmwasmExt;
/// Service defines the fields of a service
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.Service")]
pub struct Service {
    /// ID is the unique identifier of the service
    #[prost(uint32, tag = "1")]
    #[serde(alias = "ID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub id: u32,
    /// Status is the status of the service
    #[prost(enumeration = "ServiceStatus", tag = "2")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub status: i32,
    /// Admin is the address of the user that has administrative power over the
    /// service
    #[prost(string, tag = "3")]
    pub admin: ::prost::alloc::string::String,
    /// Name is the name of the service
    #[prost(string, tag = "4")]
    pub name: ::prost::alloc::string::String,
    /// Description is the description of the service
    #[prost(string, tag = "5")]
    pub description: ::prost::alloc::string::String,
    /// Website is the website of the service
    #[prost(string, tag = "6")]
    pub website: ::prost::alloc::string::String,
    /// PictureURL is the URL of the picture of the service
    #[prost(string, tag = "7")]
    pub picture_url: ::prost::alloc::string::String,
    /// Address is the address of the account associated with the service.
    /// This will be used in order to store all the tokens that are delegated to
    /// this service by various users.
    #[prost(string, tag = "8")]
    pub address: ::prost::alloc::string::String,
    /// Tokens define the delegated tokens.
    #[prost(message, repeated, tag = "9")]
    pub tokens: ::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
    /// DelegatorShares define the total shares issued to a service's delegators.
    #[prost(message, repeated, tag = "10")]
    pub delegator_shares:
        ::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::DecCoin>,
}
/// ServiceStatus defines the status of a service
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
pub enum ServiceStatus {
    /// SERVICE_STATUS_UNSPECIFIED defines an unspecified status
    Unspecified = 0,
    /// SERVICE_STATUS_CREATED identifies a recently created service that is not
    /// yet active
    Created = 1,
    /// SERVICE_STATUS_ACTIVE identifies an active service
    Active = 2,
    /// SERVICE_STATUS_INACTIVE identifies an inactive service
    Inactive = 3,
}
impl ServiceStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            ServiceStatus::Unspecified => "SERVICE_STATUS_UNSPECIFIED",
            ServiceStatus::Created => "SERVICE_STATUS_CREATED",
            ServiceStatus::Active => "SERVICE_STATUS_ACTIVE",
            ServiceStatus::Inactive => "SERVICE_STATUS_INACTIVE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SERVICE_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "SERVICE_STATUS_CREATED" => Some(Self::Created),
            "SERVICE_STATUS_ACTIVE" => Some(Self::Active),
            "SERVICE_STATUS_INACTIVE" => Some(Self::Inactive),
            _ => None,
        }
    }
}
/// Params defines the parameters for the module.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.Params")]
pub struct Params {
    /// ServiceRegistrationFee defines the fee to register a new service.
    /// The fee is drawn from the MsgRegisterService sender's account,
    /// and transferred to the community pool.
    #[prost(message, repeated, tag = "1")]
    pub service_registration_fee:
        ::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
}
/// GenesisState defines the services module's genesis state.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.GenesisState")]
pub struct GenesisState {
    /// Params defines the parameters of the module.
    #[prost(message, optional, tag = "1")]
    pub params: ::core::option::Option<Params>,
    /// Services defines the list of services.
    #[prost(message, repeated, tag = "2")]
    pub services: ::prost::alloc::vec::Vec<Service>,
    /// NextServiceID defines the ID that will be assigned to the
    /// next service that gets created.
    #[prost(uint32, tag = "3")]
    #[serde(alias = "next_serviceID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub next_service_id: u32,
}
/// MsgCreateServiceResponse defines the message structure for the
/// CreateService gRPC service method. It allows an account to register a new
/// service that can be validated by operators. It requires a sender address
/// as well as the details of the service to be registered.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgCreateService")]
pub struct MsgCreateService {
    /// Sender is the address of the user registering the service
    #[prost(string, tag = "1")]
    pub sender: ::prost::alloc::string::String,
    /// Name is the name of the service
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    /// Description is the description of the service
    #[prost(string, tag = "3")]
    pub description: ::prost::alloc::string::String,
    /// Website is the website of the service
    #[prost(string, tag = "4")]
    pub website: ::prost::alloc::string::String,
    /// PictureURL is the URL of the service picture
    #[prost(string, tag = "5")]
    pub picture_url: ::prost::alloc::string::String,
}
/// MsgCreateServiceResponse is the return value of MsgCreateService.
/// It returns the newly created service ID.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgCreateServiceResponse")]
pub struct MsgCreateServiceResponse {
    /// NewServiceID is the ID of the newly registered service
    #[prost(uint32, tag = "1")]
    #[serde(alias = "new_serviceID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub new_service_id: u32,
}
/// MsgUpdateService defines the message structure for the UpdateService gRPC
/// service method. It allows the service admin to update the details of
/// an existing service.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgUpdateService")]
pub struct MsgUpdateService {
    /// Sender is the address of the user updating the service
    #[prost(string, tag = "1")]
    pub sender: ::prost::alloc::string::String,
    /// ID represents the ID of the service to be updated
    #[prost(uint32, tag = "2")]
    #[serde(alias = "serviceID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub service_id: u32,
    /// Name is the new name of the service.
    /// If it shouldn't be changed, use \[do-not-modify\] instead.
    #[prost(string, tag = "3")]
    pub name: ::prost::alloc::string::String,
    /// Description is the new description of the service.
    /// If it shouldn't be changed, use \[do-not-modify\] instead.
    #[prost(string, tag = "4")]
    pub description: ::prost::alloc::string::String,
    /// Website is the new website of the service.
    /// If it shouldn't be changed, use \[do-not-modify\] instead.
    #[prost(string, tag = "5")]
    pub website: ::prost::alloc::string::String,
    /// PictureURL is the new URL of the service picture.
    /// If it shouldn't be changed, use \[do-not-modify\] instead.
    #[prost(string, tag = "6")]
    pub picture_url: ::prost::alloc::string::String,
}
/// MsgUpdateServiceResponse is the return value of MsgUpdateService.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgUpdateServiceResponse")]
pub struct MsgUpdateServiceResponse {}
/// MsgActivateService defines the message structure for the ActivateService gRPC
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgActivateService")]
pub struct MsgActivateService {
    /// Sender is the address of the user that wants to activate the service
    #[prost(string, tag = "1")]
    pub sender: ::prost::alloc::string::String,
    /// ServiceID represents the ID of the service to be activated
    #[prost(uint32, tag = "2")]
    #[serde(alias = "serviceID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub service_id: u32,
}
/// MsgActivateServiceResponse is the return value of MsgActivateService.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgActivateServiceResponse")]
pub struct MsgActivateServiceResponse {}
/// MsgDeactivateService defines the message structure for the DeactivateService
/// gRPC service method. It allows the service admin to deactivate an existing
/// service.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgDeactivateService")]
pub struct MsgDeactivateService {
    /// Sender is the address of the user that wants to deactivate the service
    #[prost(string, tag = "1")]
    pub sender: ::prost::alloc::string::String,
    /// ServiceID represents the ID of the service to be deactivated
    #[prost(uint32, tag = "2")]
    #[serde(alias = "serviceID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub service_id: u32,
}
/// MsgDeactivateServiceResponse is the return value of MsgDeactivateService.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgDeactivateServiceResponse")]
pub struct MsgDeactivateServiceResponse {}
/// MsgDeleteService defines the message structure for the DeleteService
/// gRPC service method. It allows the service admin to delete a previously
/// deactivated service
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgDeleteService")]
pub struct MsgDeleteService {
    /// Sender is the address of the user that wants to delete the service
    #[prost(string, tag = "1")]
    pub sender: ::prost::alloc::string::String,
    /// ServiceID represents the ID of the service to be deleted
    #[prost(uint32, tag = "2")]
    #[serde(alias = "serviceID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub service_id: u32,
}
/// MsgDeleteServiceResponse is the return value of MsgDeleteService.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgDeleteServiceResponse")]
pub struct MsgDeleteServiceResponse {}
/// MsgTransferServiceOwnership defines the message structure for the
/// TransferServiceOwnership gRPC service method. It allows a service admin to
/// transfer the ownership of the service to another account.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgTransferServiceOwnership")]
pub struct MsgTransferServiceOwnership {
    /// Sender is the address of the user transferring the ownership
    #[prost(string, tag = "1")]
    pub sender: ::prost::alloc::string::String,
    /// ServiceID represents the ID of the service to transfer ownership
    #[prost(uint32, tag = "2")]
    #[serde(alias = "serviceID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub service_id: u32,
    /// NewAdmin is the address of the new admin of the service
    #[prost(string, tag = "3")]
    pub new_admin: ::prost::alloc::string::String,
}
/// MsgTransferServiceOwnershipResponse is the return value of
/// MsgTransferServiceOwnership.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgTransferServiceOwnershipResponse")]
pub struct MsgTransferServiceOwnershipResponse {}
/// MsgDeactivateService defines the message structure for the UpdateParams gRPC
/// service method. It allows the authority to update the module parameters.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgUpdateParams")]
pub struct MsgUpdateParams {
    /// Authority is the address that controls the module (defaults to x/gov unless
    /// overwritten).
    #[prost(string, tag = "1")]
    pub authority: ::prost::alloc::string::String,
    /// Params define the parameters to update.
    ///
    /// NOTE: All parameters must be supplied.
    #[prost(message, optional, tag = "2")]
    pub params: ::core::option::Option<Params>,
}
/// MsgDeactivateServiceResponse is the return value of MsgUpdateParams.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.MsgUpdateParamsResponse")]
pub struct MsgUpdateParamsResponse {}
/// QueryParamsRequest is the request type for the Query/Params RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.QueryParamsRequest")]
#[proto_query(
    path = "/milkyway.services.v1.Query/Params",
    response_type = QueryParamsResponse
)]
pub struct QueryParamsRequest {}
/// QueryParamsResponse is the response type for the Query/Params RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.QueryParamsResponse")]
pub struct QueryParamsResponse {
    #[prost(message, optional, tag = "1")]
    pub params: ::core::option::Option<Params>,
}
/// QueryServicesRequest is the request type for the Query/Services RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.QueryServicesRequest")]
#[proto_query(
    path = "/milkyway.services.v1.Query/Services",
    response_type = QueryServicesResponse
)]
pub struct QueryServicesRequest {
    #[prost(message, optional, tag = "1")]
    pub pagination:
        ::core::option::Option<super::super::super::cosmos::base::query::v1beta1::PageRequest>,
}
/// QueryServicesResponse is the response type for the Query/Services RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.QueryServicesResponse")]
pub struct QueryServicesResponse {
    /// Services services defines the list of actively validates services
    #[prost(message, repeated, tag = "1")]
    pub services: ::prost::alloc::vec::Vec<Service>,
    /// Pagination defines the pagination response
    #[prost(message, optional, tag = "2")]
    pub pagination:
        ::core::option::Option<super::super::super::cosmos::base::query::v1beta1::PageResponse>,
}
/// QueryServiceRequest is the request type for the Query/Service RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.QueryServiceRequest")]
#[proto_query(
    path = "/milkyway.services.v1.Query/Service",
    response_type = QueryServiceResponse
)]
pub struct QueryServiceRequest {
    /// ServiceID is the ID of the service to query
    #[prost(uint32, tag = "1")]
    #[serde(alias = "serviceID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub service_id: u32,
}
/// QueryServiceResponse is the response type for the Query/Service RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.services.v1.QueryServiceResponse")]
pub struct QueryServiceResponse {
    #[prost(message, optional, tag = "1")]
    pub service: ::core::option::Option<Service>,
}
pub struct ServicesQuerier<'a, Q: cosmwasm_std::CustomQuery> {
    querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
}
impl<'a, Q: cosmwasm_std::CustomQuery> ServicesQuerier<'a, Q> {
    pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
        Self { querier }
    }
    pub fn service(&self, service_id: u32) -> Result<QueryServiceResponse, cosmwasm_std::StdError> {
        QueryServiceRequest { service_id }.query(self.querier)
    }
    pub fn services(
        &self,
        pagination: ::core::option::Option<
            super::super::super::cosmos::base::query::v1beta1::PageRequest,
        >,
    ) -> Result<QueryServicesResponse, cosmwasm_std::StdError> {
        QueryServicesRequest { pagination }.query(self.querier)
    }
    pub fn params(&self) -> Result<QueryParamsResponse, cosmwasm_std::StdError> {
        QueryParamsRequest {}.query(self.querier)
    }
}
