|
User Generator 2.1.2
Synthetic user records for apps and test data, composed from the other dasmig generators for C++23
|
What a user call asks for. More...
#include <usergen.hpp>
Public Attributes | |
| std::optional< std::string > | country {} |
| ISO 3166-1 alpha-2 code (any case). Unset draws one of the countries every part has data for, weighted by population. | |
| std::optional< sex > | person_sex {} |
| Biological sex; unset draws it from the birth. | |
| age_range | ages {.min = 18, .max = 80} |
Inclusive age range in completed years. Users are adults by default; the lowest age must be at least sign_up_age. | |
| std::chrono::year_month_day | reference_date {birth_request::default_reference_date} |
| The date ages and account dates are computed at. The default is birth-generator's (2023-07-01); the library never reads the clock. | |
| bool | safe {false} |
| Make the contacts unable to reach anyone: reserved email domains and, where a country has one, a phone number from the range regulators set aside for fiction. | |
| password_policy | password {} |
| The password rules. | |
| std::uint8_t | sign_up_age {13} |
| The youngest age at which a person signs up, in completed years. An account is created after the person reaches it. | |
| std::optional< std::chrono::year_month_day > | service_start {} |
| The earliest date an account can be created, for example the launch of the service. Unset is ten years before the reference date. | |
| std::optional< std::string > | status {} |
Force an account status by its key (active, inactive, unverified, suspended in the shipped data). Unset draws one. | |
| bool | device {false} |
Add the device the user last signed in from (user::client), from device-generator: drawn with the account's country, platform and locale, at the last login (the sign-up time for an account that never logged in), with a documentation-range IP address when safe. Off by default. Turning it on changes nothing else in a user, except that a drawn country is one device-generator has too. | |
What a user call asks for.
Every generation call takes one; user_request{} asks for the defaults. Choices are never stored on the generator, so one call cannot change the next. Every field is optional: what is left out is drawn, and what is given conditions the draws that depend on it (the country sets the name, the address, the phone, the email and the account's locale; the birth sets the age).
Definition at line 88 of file usergen.hpp.
| age_range dasmig::user_request::ages {.min = 18, .max = 80} |
Inclusive age range in completed years. Users are adults by default; the lowest age must be at least sign_up_age.
Definition at line 99 of file usergen.hpp.
| std::optional<std::string> dasmig::user_request::country {} |
ISO 3166-1 alpha-2 code (any case). Unset draws one of the countries every part has data for, weighted by population.
Definition at line 92 of file usergen.hpp.
| bool dasmig::user_request::device {false} |
Add the device the user last signed in from (user::client), from device-generator: drawn with the account's country, platform and locale, at the last login (the sign-up time for an account that never logged in), with a documentation-range IP address when safe. Off by default. Turning it on changes nothing else in a user, except that a drawn country is one device-generator has too.
Definition at line 132 of file usergen.hpp.
| password_policy dasmig::user_request::password {} |
The password rules.
Definition at line 111 of file usergen.hpp.
| std::optional<sex> dasmig::user_request::person_sex {} |
Biological sex; unset draws it from the birth.
Definition at line 95 of file usergen.hpp.
| std::chrono::year_month_day dasmig::user_request::reference_date {birth_request::default_reference_date} |
The date ages and account dates are computed at. The default is birth-generator's (2023-07-01); the library never reads the clock.
Definition at line 103 of file usergen.hpp.
| bool dasmig::user_request::safe {false} |
Make the contacts unable to reach anyone: reserved email domains and, where a country has one, a phone number from the range regulators set aside for fiction.
Definition at line 108 of file usergen.hpp.
| std::optional<std::chrono::year_month_day> dasmig::user_request::service_start {} |
The earliest date an account can be created, for example the launch of the service. Unset is ten years before the reference date.
Definition at line 119 of file usergen.hpp.
| std::uint8_t dasmig::user_request::sign_up_age {13} |
The youngest age at which a person signs up, in completed years. An account is created after the person reaches it.
Definition at line 115 of file usergen.hpp.
| std::optional<std::string> dasmig::user_request::status {} |
Force an account status by its key (active, inactive, unverified, suspended in the shipped data). Unset draws one.
Definition at line 123 of file usergen.hpp.