Harmonize calls to Entity::check_valid().
This commit is contained in:
parent
a2aa33cf27
commit
5e6bf432a8
|
@ -24,27 +24,25 @@ using Account = Easy::Account;
|
||||||
|
|
||||||
bool Account::valid() const
|
bool Account::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"id",
|
"id",
|
||||||
"username",
|
"username",
|
||||||
"acct",
|
"acct",
|
||||||
"display_name",
|
"display_name",
|
||||||
"locked",
|
"locked",
|
||||||
"created_at",
|
"created_at",
|
||||||
"followers_count",
|
"followers_count",
|
||||||
"following_count",
|
"following_count",
|
||||||
"statuses_count",
|
"statuses_count",
|
||||||
"note",
|
"note",
|
||||||
"url",
|
"url",
|
||||||
"avatar",
|
"avatar",
|
||||||
"avatar_static",
|
"avatar_static",
|
||||||
"header",
|
"header",
|
||||||
"header_static",
|
"header_static",
|
||||||
"emojis"
|
"emojis"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Account::acct() const
|
const string Account::acct() const
|
||||||
|
|
|
@ -23,15 +23,13 @@ using Attachment = Easy::Attachment;
|
||||||
|
|
||||||
bool Attachment::valid() const
|
bool Attachment::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"id",
|
"id",
|
||||||
"type",
|
"type",
|
||||||
"url",
|
"url",
|
||||||
"preview_url"
|
"preview_url"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double Attachment::aspect() const
|
double Attachment::aspect() const
|
||||||
|
|
|
@ -22,15 +22,13 @@ using Card = Easy::Card;
|
||||||
|
|
||||||
bool Card::valid() const
|
bool Card::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"url",
|
"url",
|
||||||
"title",
|
"title",
|
||||||
"description",
|
"description",
|
||||||
"type"
|
"type"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Card::author_name() const
|
const string Card::author_name() const
|
||||||
|
|
|
@ -23,13 +23,11 @@ using Context = Easy::Context;
|
||||||
|
|
||||||
bool Context::valid() const
|
bool Context::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"ancestors",
|
"ancestors",
|
||||||
"descendants"
|
"descendants"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<Easy::Status> Context::ancestors() const
|
const std::vector<Easy::Status> Context::ancestors() const
|
||||||
|
|
|
@ -22,15 +22,13 @@ using Emoji = Easy::Emoji;
|
||||||
|
|
||||||
bool Emoji::valid() const
|
bool Emoji::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"shortcode",
|
"shortcode",
|
||||||
"static_url",
|
"static_url",
|
||||||
"url",
|
"url",
|
||||||
"visible_in_picker"
|
"visible_in_picker"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Emoji::shortcode() const
|
const string Emoji::shortcode() const
|
||||||
|
|
|
@ -24,11 +24,14 @@ using Filter = Easy::Filter;
|
||||||
|
|
||||||
bool Filter::valid() const
|
bool Filter::valid() const
|
||||||
{
|
{
|
||||||
return Entity::check_valid({ "id",
|
return Entity::check_valid(
|
||||||
"phrase",
|
{
|
||||||
"context",
|
"id",
|
||||||
"irreversible",
|
"phrase",
|
||||||
"whole_word" });
|
"context",
|
||||||
|
"irreversible",
|
||||||
|
"whole_word"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Filter::id() const
|
const string Filter::id() const
|
||||||
|
|
|
@ -24,18 +24,16 @@ using Instance = Easy::Instance;
|
||||||
|
|
||||||
bool Instance::valid() const
|
bool Instance::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"uri",
|
"uri",
|
||||||
"title",
|
"title",
|
||||||
"description",
|
"description",
|
||||||
"email",
|
"email",
|
||||||
"version",
|
"version",
|
||||||
"urls",
|
"urls",
|
||||||
"languages"
|
"languages"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Easy::Account Instance::contact_account() const
|
const Easy::Account Instance::contact_account() const
|
||||||
|
|
|
@ -23,13 +23,11 @@ using std::uint64_t;
|
||||||
|
|
||||||
bool List::valid() const
|
bool List::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{
|
{
|
||||||
"id",
|
"id",
|
||||||
"title"
|
"title"
|
||||||
};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string List::id() const
|
const string List::id() const
|
||||||
|
|
|
@ -21,15 +21,13 @@ using Mention = Easy::Mention;
|
||||||
|
|
||||||
bool Mention::valid() const
|
bool Mention::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"url",
|
"url",
|
||||||
"username",
|
"username",
|
||||||
"acct",
|
"acct",
|
||||||
"id"
|
"id"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Mention::acct() const
|
const string Mention::acct() const
|
||||||
|
|
|
@ -22,15 +22,13 @@ using Notification = Easy::Notification;
|
||||||
|
|
||||||
bool Notification::valid() const
|
bool Notification::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"id",
|
"id",
|
||||||
"type",
|
"type",
|
||||||
"created_at",
|
"created_at",
|
||||||
"account"
|
"account"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Easy::Account Notification::account() const
|
const Easy::Account Notification::account() const
|
||||||
|
|
|
@ -26,14 +26,12 @@ const string PushSubscription::id() const
|
||||||
|
|
||||||
bool PushSubscription::valid() const
|
bool PushSubscription::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"id",
|
"id",
|
||||||
"endpoint",
|
"endpoint",
|
||||||
"server_key"
|
"server_key"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string PushSubscription::endpoint() const
|
const string PushSubscription::endpoint() const
|
||||||
|
|
|
@ -21,19 +21,17 @@ using Relationship = Easy::Relationship;
|
||||||
|
|
||||||
bool Relationship::valid() const
|
bool Relationship::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"id",
|
"id",
|
||||||
"following",
|
"following",
|
||||||
"followed_by",
|
"followed_by",
|
||||||
"blocking",
|
"blocking",
|
||||||
"muting",
|
"muting",
|
||||||
"muting_notifications",
|
"muting_notifications",
|
||||||
"requested",
|
"requested",
|
||||||
"domain_blocking"
|
"domain_blocking"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Relationship::blocking() const
|
bool Relationship::blocking() const
|
||||||
|
|
|
@ -21,13 +21,11 @@ using Report = Easy::Report;
|
||||||
|
|
||||||
bool Report::valid() const
|
bool Report::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"id",
|
"id",
|
||||||
"action_taken"
|
"action_taken"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Report::action_taken() const
|
bool Report::action_taken() const
|
||||||
|
|
|
@ -23,14 +23,12 @@ using Results = Easy::Results;
|
||||||
|
|
||||||
bool Results::valid() const
|
bool Results::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"accounts",
|
"accounts",
|
||||||
"statuses",
|
"statuses",
|
||||||
"hashtags"
|
"hashtags"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<Easy::Account> Results::accounts() const
|
const std::vector<Easy::Account> Results::accounts() const
|
||||||
|
|
|
@ -24,27 +24,25 @@ using Status = Easy::Status;
|
||||||
|
|
||||||
bool Status::valid() const
|
bool Status::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"id",
|
"id",
|
||||||
"uri",
|
"uri",
|
||||||
"account",
|
"account",
|
||||||
"content",
|
"content",
|
||||||
"created_at",
|
"created_at",
|
||||||
"emojis",
|
"emojis",
|
||||||
"replies_count",
|
"replies_count",
|
||||||
"reblogs_count",
|
"reblogs_count",
|
||||||
"favourites_count",
|
"favourites_count",
|
||||||
"sensitive",
|
"sensitive",
|
||||||
"spoiler_text",
|
"spoiler_text",
|
||||||
"visibility",
|
"visibility",
|
||||||
"media_attachments",
|
"media_attachments",
|
||||||
"mentions",
|
"mentions",
|
||||||
"tags",
|
"tags",
|
||||||
"application"
|
"application"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Easy::Account Status::account() const
|
const Easy::Account Status::account() const
|
||||||
|
|
|
@ -25,13 +25,11 @@ using Tag = Easy::Tag;
|
||||||
|
|
||||||
bool Tag::valid() const
|
bool Tag::valid() const
|
||||||
{
|
{
|
||||||
const std::vector<string> attributes =
|
return Entity::check_valid(
|
||||||
{{
|
{
|
||||||
"name",
|
"name",
|
||||||
"url"
|
"url"
|
||||||
}};
|
});
|
||||||
|
|
||||||
return Entity::check_valid(attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Tag::name() const
|
const string Tag::name() const
|
||||||
|
|
|
@ -21,10 +21,13 @@ using Token = Easy::Token;
|
||||||
|
|
||||||
bool Token::valid() const
|
bool Token::valid() const
|
||||||
{
|
{
|
||||||
return Entity::check_valid({"access_token",
|
return Entity::check_valid(
|
||||||
"token_type",
|
{
|
||||||
"scope",
|
"access_token",
|
||||||
"created_at"});
|
"token_type",
|
||||||
|
"scope",
|
||||||
|
"created_at"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Token::access_token() const
|
const string Token::access_token() const
|
||||||
|
|
Reference in New Issue