diff --git a/src/models/domain.rs b/src/models/domain.rs new file mode 100644 index 0000000..79c4e7d --- /dev/null +++ b/src/models/domain.rs @@ -0,0 +1,17 @@ +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Site { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub url: ::prost::alloc::string::String, + #[prost(bool, tag = "3")] + pub show: bool, + #[prost(bool, tag = "4")] + pub can_use: bool, + #[prost(uint64, tag = "5")] + pub created_at: u64, + #[prost(uint64, tag = "6")] + pub updated_at: u64, + #[prost(uint64, optional, tag = "7")] + pub deleted_at: ::core::option::Option, +} diff --git a/src/models/member.rs b/src/models/member.rs index 9ba7221..e71617e 100644 --- a/src/models/member.rs +++ b/src/models/member.rs @@ -1,3 +1,5 @@ +use crate::models::domain; + #[derive(Clone, PartialEq, ::prost::Message)] pub struct MemberClass { #[prost(string, tag = "1")] @@ -29,53 +31,38 @@ pub struct MemberLevel { pub deleted_at: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MemberSite { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub url: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - pub created_at: u64, - #[prost(uint64, tag = "4")] - pub updated_at: u64, - #[prost(uint64, optional, tag = "5")] - pub deleted_at: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] pub struct Member { #[prost(string, tag = "1")] pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub domain_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub site: ::core::option::Option, #[prost(message, optional, tag = "3")] pub member_class: ::core::option::Option, #[prost(message, optional, tag = "4")] pub member_level: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub member_site: ::core::option::Option, - #[prost(message, optional, boxed, tag = "6")] + #[prost(message, optional, boxed, tag = "5")] pub referrer: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(uint64, tag = "7")] + #[prost(uint64, tag = "6")] pub referred_count: u64, - #[prost(string, tag = "8")] + #[prost(string, tag = "7")] pub username: ::prost::alloc::string::String, - #[prost(string, tag = "9")] + #[prost(string, tag = "8")] pub nickname: ::prost::alloc::string::String, - #[prost(string, optional, tag = "10")] + #[prost(string, optional, tag = "9")] pub mobile_phone_number: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration = "MemberState", tag = "11")] + #[prost(enumeration = "MemberState", tag = "10")] pub state: i32, - #[prost(uint64, optional, tag = "12")] + #[prost(uint64, optional, tag = "11")] pub state_changed_at: ::core::option::Option, - #[prost(string, optional, tag = "13")] + #[prost(string, optional, tag = "12")] pub last_signined_ip: ::core::option::Option<::prost::alloc::string::String>, - #[prost(uint64, optional, tag = "14")] + #[prost(uint64, optional, tag = "13")] pub last_signined_at: ::core::option::Option, - #[prost(uint64, tag = "15")] + #[prost(uint64, tag = "14")] pub created_at: u64, - #[prost(uint64, tag = "16")] + #[prost(uint64, tag = "15")] pub updated_at: u64, - #[prost(uint64, optional, tag = "17")] + #[prost(uint64, optional, tag = "16")] pub deleted_at: ::core::option::Option, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -89,7 +76,6 @@ pub enum MemberState { Blacklist = 5, Suspended = 6, } - #[derive(Clone, PartialEq, ::prost::Message)] pub struct MemberSession { #[prost(string, tag = "1")] diff --git a/src/models/mod.rs b/src/models/mod.rs index f9eb5a6..e13be12 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -1,2 +1,4 @@ pub mod core; +pub mod domain; pub mod member; +pub mod rbac; diff --git a/src/models/rbac.rs b/src/models/rbac.rs new file mode 100644 index 0000000..4b74ae6 --- /dev/null +++ b/src/models/rbac.rs @@ -0,0 +1,57 @@ +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Resource { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(message, optional, boxed, tag = "2")] + pub parent: ::core::option::Option<::prost::alloc::boxed::Box>, + #[prost(string, tag = "3")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub description: ::prost::alloc::string::String, + #[prost(bool, tag = "6")] + pub can_use: bool, + #[prost(uint64, tag = "7")] + pub created_at: u64, + #[prost(uint64, tag = "8")] + pub updated_at: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResourceAction { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub resource: ::core::option::Option, + #[prost(string, tag = "3")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub description: ::prost::alloc::string::String, + #[prost(bool, tag = "6")] + pub can_use: bool, + #[prost(uint64, tag = "7")] + pub created_at: u64, + #[prost(uint64, tag = "8")] + pub updated_at: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Role { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(message, optional, boxed, tag = "2")] + pub parent: ::core::option::Option<::prost::alloc::boxed::Box>, + #[prost(string, tag = "3")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub description: ::prost::alloc::string::String, + #[prost(bool, tag = "6")] + pub can_use: bool, + #[prost(uint64, tag = "7")] + pub created_at: u64, + #[prost(uint64, tag = "8")] + pub updated_at: u64, +}