#[non_exhaustive]pub struct CreateTestEntitlement {
pub sku_id: SkuId,
pub owner_id: GenericId,
pub owner_type: EntitlementOwnerType,
}Expand description
The body of Create Test Entitlement.
Built with guild or user, which set the owner and its
type (D-130).
discord.js counterpart: the argument of EntitlementManager#createTest.
§Examples
use djs_model::{
id::{GuildId, SkuId},
rest::CreateTestEntitlement,
};
let body = CreateTestEntitlement::guild(SkuId::new(10), GuildId::new(20));
assert_eq!(
serde_json::to_string(&body)?,
r#"{"sku_id":"10","owner_id":"20","owner_type":1}"#
);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sku_id: SkuIdThe SKU to grant access to.
owner_id: GenericIdThe guild or user that gets access.
owner_type: EntitlementOwnerTypeWhether owner_id is a guild or a user.
Implementations§
Trait Implementations§
Source§impl Clone for CreateTestEntitlement
impl Clone for CreateTestEntitlement
impl Copy for CreateTestEntitlement
Source§impl Debug for CreateTestEntitlement
impl Debug for CreateTestEntitlement
impl Eq for CreateTestEntitlement
Source§impl Hash for CreateTestEntitlement
impl Hash for CreateTestEntitlement
Source§impl PartialEq for CreateTestEntitlement
impl PartialEq for CreateTestEntitlement
Source§impl Serialize for CreateTestEntitlement
impl Serialize for CreateTestEntitlement
impl StructuralPartialEq for CreateTestEntitlement
Auto Trait Implementations§
impl Freeze for CreateTestEntitlement
impl RefUnwindSafe for CreateTestEntitlement
impl Send for CreateTestEntitlement
impl Sync for CreateTestEntitlement
impl Unpin for CreateTestEntitlement
impl UnsafeUnpin for CreateTestEntitlement
impl UnwindSafe for CreateTestEntitlement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more