[{"data":1,"prerenderedAt":2547},["ShallowReactive",2],{"navigation":3,"\u002Ftesting":43,"\u002Ftesting-surround":2542},[4,8,13,18,23,28,33,38],{"title":5,"path":6,"stem":7},"Getting started","\u002F","index",{"title":9,"path":10,"stem":11,"order":12},"Numbers","\u002Fnumbers","numbers",1,{"title":14,"path":15,"stem":16,"order":17},"Rent","\u002Frent","rent",2,{"title":19,"path":20,"stem":21,"order":22},"User","\u002Fuser","user",3,{"title":24,"path":25,"stem":26,"order":27},"Free numbers","\u002Ffree","free",4,{"title":29,"path":30,"stem":31,"order":32},"Webhooks","\u002Fwebhooks","webhooks",5,{"title":34,"path":35,"stem":36,"order":37},"Testing","\u002Ftesting","testing",6,{"title":39,"path":40,"stem":41,"order":42},"Changelog","\u002Fchangelog","changelog",7,{"id":44,"title":34,"body":45,"description":2536,"extension":2537,"meta":2538,"navigation":2539,"path":35,"seo":2540,"stem":36,"__hash__":2541},"docs\u002Ftesting.md",{"type":46,"value":47,"toc":2526},"minimark",[48,72,77,88,210,374,492,607,614,748,758,762,776,1269,1283,1311,1315,1353,1677,1739,1743,1774,2054,2058,2274,2301,2308,2333,2337,2522],[49,50,51,55,56,59,60,63,64,67,68,71],"p",{},[52,53,54],"code",{},"MockOnlineSim"," is an in-process fake of the OnlineSim API that ships with the crate. It is a ",[52,57,58],{},"Transport"," and a ",[52,61,62],{},"BlockingTransport"," that answer like the real backend — same shapes, same error codes, HTTP 456 for a wrong key — and keep a balance, operations and rents. Your code talks to a normal ",[52,65,66],{},"Client"," (or ",[52,69,70],{},"blocking::Client","), so nothing in it changes for tests. It is deterministic: no randomness, no clock; numbers and ids come from a counter.",[73,74,76],"h2",{"id":75},"setup","Setup",[49,78,79,80,83,84,87],{},"Enable the ",[52,81,82],{},"mock-transport"," feature for your tests. It adds no dependencies and works with the async client (default) and with ",[52,85,86],{},"blocking",":",[89,90,95],"pre",{"className":91,"code":92,"language":93,"meta":94,"style":94},"language-toml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[dev-dependencies]\nonlinesim-rs-api = { version = \"0.2.1\", features = [\"mock-transport\"] }\ntokio = { version = \"1\", features = [\"macros\", \"rt-multi-thread\"] }\n","toml","",[52,96,97,112,162],{"__ignoreMap":94},[98,99,101,105,109],"span",{"class":100,"line":12},"line",[98,102,104],{"class":103},"sMK4o","[",[98,106,108],{"class":107},"sBMFI","dev-dependencies",[98,110,111],{"class":103},"]\n",[98,113,114,118,121,124,127,129,132,136,139,142,145,147,150,152,154,156,159],{"class":100,"line":17},[98,115,117],{"class":116},"sTEyZ","onlinesim-rs-api ",[98,119,120],{"class":103},"=",[98,122,123],{"class":103}," {",[98,125,126],{"class":116}," version ",[98,128,120],{"class":103},[98,130,131],{"class":103}," \"",[98,133,135],{"class":134},"sfazB","0.2.1",[98,137,138],{"class":103},"\"",[98,140,141],{"class":103},",",[98,143,144],{"class":116}," features ",[98,146,120],{"class":103},[98,148,149],{"class":103}," [",[98,151,138],{"class":103},[98,153,82],{"class":134},[98,155,138],{"class":103},[98,157,158],{"class":103},"]",[98,160,161],{"class":103}," }\n",[98,163,164,167,169,171,173,175,177,180,182,184,186,188,190,192,195,197,199,201,204,206,208],{"class":100,"line":22},[98,165,166],{"class":116},"tokio ",[98,168,120],{"class":103},[98,170,123],{"class":103},[98,172,126],{"class":116},[98,174,120],{"class":103},[98,176,131],{"class":103},[98,178,179],{"class":134},"1",[98,181,138],{"class":103},[98,183,141],{"class":103},[98,185,144],{"class":116},[98,187,120],{"class":103},[98,189,149],{"class":103},[98,191,138],{"class":103},[98,193,194],{"class":134},"macros",[98,196,138],{"class":103},[98,198,141],{"class":103},[98,200,131],{"class":103},[98,202,203],{"class":134},"rt-multi-thread",[98,205,138],{"class":103},[98,207,158],{"class":103},[98,209,161],{"class":103},[89,211,215],{"className":212,"code":213,"language":214,"meta":94,"style":94},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use onlinesim_rs_api::mock::{MockOnlineSim, MockOptions};\n\nfn setup() -> onlinesim_rs_api::Result\u003C()> {\n    let mock = MockOnlineSim::new(MockOptions { balance: 10.0, ..MockOptions::default() });\n    let client = mock.client()?; \u002F\u002F a Client wired to the mock; `client_blocking()` for the blocking one\n    Ok(())\n}\n","rust",[52,216,217,245,251,279,337,361,369],{"__ignoreMap":94},[98,218,219,223,226,229,232,235,237,239,242],{"class":100,"line":12},[98,220,222],{"class":221},"sbssI","use",[98,224,225],{"class":107}," onlinesim_rs_api",[98,227,228],{"class":103},"::",[98,230,231],{"class":107},"mock",[98,233,234],{"class":103},"::{",[98,236,54],{"class":107},[98,238,141],{"class":103},[98,240,241],{"class":107}," MockOptions",[98,243,244],{"class":103},"};\n",[98,246,247],{"class":100,"line":17},[98,248,250],{"emptyLinePlaceholder":249},true,"\n",[98,252,253,256,260,263,266,268,270,273,276],{"class":100,"line":22},[98,254,255],{"class":221},"fn",[98,257,259],{"class":258},"s2Zo4"," setup",[98,261,262],{"class":103},"()",[98,264,265],{"class":103}," ->",[98,267,225],{"class":107},[98,269,228],{"class":103},[98,271,272],{"class":107},"Result",[98,274,275],{"class":103},"\u003C()>",[98,277,278],{"class":103}," {\n",[98,280,281,285,288,290,293,295,298,301,304,306,309,311,314,317,320,322,325,327,329,332,334],{"class":100,"line":27},[98,282,284],{"class":283},"spNyl","    let",[98,286,287],{"class":116}," mock ",[98,289,120],{"class":103},[98,291,292],{"class":107}," MockOnlineSim",[98,294,228],{"class":103},[98,296,297],{"class":258},"new",[98,299,300],{"class":103},"(",[98,302,303],{"class":107},"MockOptions",[98,305,123],{"class":103},[98,307,308],{"class":116}," balance",[98,310,87],{"class":103},[98,312,313],{"class":221}," 10",[98,315,316],{"class":103},".",[98,318,319],{"class":221},"0",[98,321,141],{"class":103},[98,323,324],{"class":103}," ..",[98,326,303],{"class":107},[98,328,228],{"class":103},[98,330,331],{"class":258},"default",[98,333,262],{"class":103},[98,335,336],{"class":103}," });\n",[98,338,339,341,344,346,349,351,354,357],{"class":100,"line":32},[98,340,284],{"class":283},[98,342,343],{"class":116}," client ",[98,345,120],{"class":103},[98,347,348],{"class":116}," mock",[98,350,316],{"class":103},[98,352,353],{"class":258},"client",[98,355,356],{"class":103},"()?;",[98,358,360],{"class":359},"sHwdD"," \u002F\u002F a Client wired to the mock; `client_blocking()` for the blocking one\n",[98,362,363,366],{"class":100,"line":37},[98,364,365],{"class":107},"    Ok",[98,367,368],{"class":103},"(())\n",[98,370,371],{"class":100,"line":42},[98,372,373],{"class":103},"}\n",[89,375,377],{"className":212,"code":376,"language":214,"meta":94,"style":94},"pub struct MockOptions {\n    pub api_key: String,          \u002F\u002F default \"mock-key\"\n    pub balance: f64,             \u002F\u002F USD, default 100\n    pub prices: MockPrices,       \u002F\u002F BTreeMap\u003Ci64, BTreeMap\u003CString, f64>>: country → service → USD\n    pub rent_tariffs: BTreeMap\u003Ci64, MockRentTariff>, \u002F\u002F country → { days: BTreeMap\u003Ci64, f64>, extend: bool }\n    pub guard_interval: u64,      \u002F\u002F seconds, default 0\n}\n",[52,378,379,391,409,425,442,471,488],{"__ignoreMap":94},[98,380,381,384,387,389],{"class":100,"line":12},[98,382,383],{"class":283},"pub",[98,385,386],{"class":283}," struct",[98,388,241],{"class":107},[98,390,278],{"class":103},[98,392,393,396,399,401,404,406],{"class":100,"line":17},[98,394,395],{"class":283},"    pub",[98,397,398],{"class":116}," api_key",[98,400,87],{"class":103},[98,402,403],{"class":107}," String",[98,405,141],{"class":103},[98,407,408],{"class":359},"          \u002F\u002F default \"mock-key\"\n",[98,410,411,413,415,417,420,422],{"class":100,"line":22},[98,412,395],{"class":283},[98,414,308],{"class":116},[98,416,87],{"class":103},[98,418,419],{"class":107}," f64",[98,421,141],{"class":103},[98,423,424],{"class":359},"             \u002F\u002F USD, default 100\n",[98,426,427,429,432,434,437,439],{"class":100,"line":27},[98,428,395],{"class":283},[98,430,431],{"class":116}," prices",[98,433,87],{"class":103},[98,435,436],{"class":107}," MockPrices",[98,438,141],{"class":103},[98,440,441],{"class":359},"       \u002F\u002F BTreeMap\u003Ci64, BTreeMap\u003CString, f64>>: country → service → USD\n",[98,443,444,446,449,451,454,457,460,462,465,468],{"class":100,"line":32},[98,445,395],{"class":283},[98,447,448],{"class":116}," rent_tariffs",[98,450,87],{"class":103},[98,452,453],{"class":107}," BTreeMap",[98,455,456],{"class":103},"\u003C",[98,458,459],{"class":107},"i64",[98,461,141],{"class":103},[98,463,464],{"class":107}," MockRentTariff",[98,466,467],{"class":103},">,",[98,469,470],{"class":359}," \u002F\u002F country → { days: BTreeMap\u003Ci64, f64>, extend: bool }\n",[98,472,473,475,478,480,483,485],{"class":100,"line":37},[98,474,395],{"class":283},[98,476,477],{"class":116}," guard_interval",[98,479,87],{"class":103},[98,481,482],{"class":107}," u64",[98,484,141],{"class":103},[98,486,487],{"class":359},"      \u002F\u002F seconds, default 0\n",[98,489,490],{"class":100,"line":42},[98,491,373],{"class":103},[493,494,495,511],"table",{},[496,497,498],"thead",{},[499,500,501,505,508],"tr",{},[502,503,504],"th",{},"Field",[502,506,507],{},"Default",[502,509,510],{},"Description",[512,513,514,534,549,567,586],"tbody",{},[499,515,516,522,527],{},[517,518,519],"td",{},[52,520,521],{},"api_key",[517,523,524],{},[52,525,526],{},"\"mock-key\"",[517,528,529,530,533],{},"Key the mock accepts. ",[52,531,532],{},"mock.client()"," uses it.",[499,535,536,541,546],{},[517,537,538],{},[52,539,540],{},"balance",[517,542,543],{},[52,544,545],{},"100.0",[517,547,548],{},"Starting balance, USD.",[499,550,551,556,561],{},[517,552,553],{},[52,554,555],{},"prices",[517,557,558],{},[52,559,560],{},"{7: {vkcom: 0.5, telegram: 1.2, google: 0.3}, 44: {google: 0.2, vkcom: 0.36}}",[517,562,563,564,316],{},"Number prices; replaces the defaults. Also feeds ",[52,565,566],{},"numbers().tariffs()",[499,568,569,574,579],{},[517,570,571],{},[52,572,573],{},"rent_tariffs",[517,575,576],{},[52,577,578],{},"{7: {days: {1: 1.0, 3: 2.5, 7: 5.0}, extend: true}}",[517,580,581,582,585],{},"Rent prices; ",[52,583,584],{},"extend: false"," makes rents of that country non-extendable.",[499,587,588,593,597],{},[517,589,590],{},[52,591,592],{},"guard_interval",[517,594,595],{},[52,596,319],{},[517,598,599,602,603,606],{},[52,600,601],{},"> 0",": an operation without SMS, or an unconfirmed rent without any SMS, cannot be closed (",[52,604,605],{},"NO_COMPLETE_TZID",").",[49,608,609,610,613],{},"To build the client yourself (other options, a wrong key), pass ",[52,611,612],{},"mock.transport()","; any base URL works:",[89,615,617],{"className":212,"code":616,"language":214,"meta":94,"style":94},"use onlinesim_rs_api::Client;\nuse onlinesim_rs_api::mock::MockOnlineSim;\n\nfn wrong_key() -> onlinesim_rs_api::Result\u003C()> {\n    let mock = MockOnlineSim::default();\n    let client = Client::builder().api_key(\"wrong\").build_with(mock.transport())?;\n    Ok(())\n}\n",[52,618,619,632,648,652,673,690,737,743],{"__ignoreMap":94},[98,620,621,623,625,627,629],{"class":100,"line":12},[98,622,222],{"class":221},[98,624,225],{"class":107},[98,626,228],{"class":103},[98,628,66],{"class":107},[98,630,631],{"class":103},";\n",[98,633,634,636,638,640,642,644,646],{"class":100,"line":17},[98,635,222],{"class":221},[98,637,225],{"class":107},[98,639,228],{"class":103},[98,641,231],{"class":107},[98,643,228],{"class":103},[98,645,54],{"class":107},[98,647,631],{"class":103},[98,649,650],{"class":100,"line":22},[98,651,250],{"emptyLinePlaceholder":249},[98,653,654,656,659,661,663,665,667,669,671],{"class":100,"line":27},[98,655,255],{"class":221},[98,657,658],{"class":258}," wrong_key",[98,660,262],{"class":103},[98,662,265],{"class":103},[98,664,225],{"class":107},[98,666,228],{"class":103},[98,668,272],{"class":107},[98,670,275],{"class":103},[98,672,278],{"class":103},[98,674,675,677,679,681,683,685,687],{"class":100,"line":32},[98,676,284],{"class":283},[98,678,287],{"class":116},[98,680,120],{"class":103},[98,682,292],{"class":107},[98,684,228],{"class":103},[98,686,331],{"class":258},[98,688,689],{"class":103},"();\n",[98,691,692,694,696,698,701,703,706,709,711,713,715,718,720,722,725,727,729,731,734],{"class":100,"line":37},[98,693,284],{"class":283},[98,695,343],{"class":116},[98,697,120],{"class":103},[98,699,700],{"class":107}," Client",[98,702,228],{"class":103},[98,704,705],{"class":258},"builder",[98,707,708],{"class":103},"().",[98,710,521],{"class":258},[98,712,300],{"class":103},[98,714,138],{"class":103},[98,716,717],{"class":134},"wrong",[98,719,138],{"class":103},[98,721,606],{"class":103},[98,723,724],{"class":258},"build_with",[98,726,300],{"class":103},[98,728,231],{"class":116},[98,730,316],{"class":103},[98,732,733],{"class":258},"transport",[98,735,736],{"class":103},"())?;\n",[98,738,739,741],{"class":100,"line":42},[98,740,365],{"class":107},[98,742,368],{"class":103},[98,744,746],{"class":100,"line":745},8,[98,747,373],{"class":103},[49,749,750,753,754,757],{},[52,751,752],{},"mock.builder()"," returns a ",[52,755,756],{},"ClientBuilder"," with the mock's key and base URL already set.",[73,759,761],{"id":760},"a-full-example","A full example",[49,763,764,765,768,769,772,773,775],{},"Order a number, let an SMS arrive while ",[52,766,767],{},"wait_code"," polls, check the code and the money. ",[52,770,771],{},"add_sms_after"," delivers the SMS after a number of polls instead of after some time, so ",[52,774,767],{}," runs with a zero interval and the test takes milliseconds.",[89,777,779],{"className":212,"code":778,"language":214,"meta":94,"style":94},"use std::time::Duration;\n\nuse onlinesim_rs_api::WaitCodeOptions;\nuse onlinesim_rs_api::mock::{MockOnlineSim, MockOptions};\nuse onlinesim_rs_api::types::OperationStatus;\n\n#[tokio::test]\nasync fn receives_the_code() {\n    let mock = MockOnlineSim::new(MockOptions { balance: 10.0, ..MockOptions::default() });\n    let client = mock.client().unwrap();\n\n    let order = client.numbers().get_with_number(\"google\", 44, &[]).await.unwrap();\n    assert_eq!(order.number, \"+44900000001\");\n\n    mock.add_sms_after(order.tzid, \"Your Google code: 123-456\", 2); \u002F\u002F the third poll sees it\n    let options = WaitCodeOptions { interval: Duration::ZERO, ..WaitCodeOptions::default() };\n    let code = client.numbers().wait_code(order.tzid, options).await.unwrap();\n\n    assert_eq!(code, \"123456\");\n    assert_eq!(mock.operations()[0].status, OperationStatus::TzOverOk); \u002F\u002F wait_code closed it\n    assert_eq!(mock.balance(), 9.8); \u002F\u002F the price is spent once an SMS arrived\n}\n",[52,780,781,800,804,817,837,855,859,874,889,934,956,961,1012,1040,1045,1084,1127,1170,1175,1195,1235,1264],{"__ignoreMap":94},[98,782,783,785,788,790,793,795,798],{"class":100,"line":12},[98,784,222],{"class":221},[98,786,787],{"class":107}," std",[98,789,228],{"class":103},[98,791,792],{"class":107},"time",[98,794,228],{"class":103},[98,796,797],{"class":107},"Duration",[98,799,631],{"class":103},[98,801,802],{"class":100,"line":17},[98,803,250],{"emptyLinePlaceholder":249},[98,805,806,808,810,812,815],{"class":100,"line":22},[98,807,222],{"class":221},[98,809,225],{"class":107},[98,811,228],{"class":103},[98,813,814],{"class":107},"WaitCodeOptions",[98,816,631],{"class":103},[98,818,819,821,823,825,827,829,831,833,835],{"class":100,"line":27},[98,820,222],{"class":221},[98,822,225],{"class":107},[98,824,228],{"class":103},[98,826,231],{"class":107},[98,828,234],{"class":103},[98,830,54],{"class":107},[98,832,141],{"class":103},[98,834,241],{"class":107},[98,836,244],{"class":103},[98,838,839,841,843,845,848,850,853],{"class":100,"line":32},[98,840,222],{"class":221},[98,842,225],{"class":107},[98,844,228],{"class":103},[98,846,847],{"class":107},"types",[98,849,228],{"class":103},[98,851,852],{"class":107},"OperationStatus",[98,854,631],{"class":103},[98,856,857],{"class":100,"line":37},[98,858,250],{"emptyLinePlaceholder":249},[98,860,861,864,867,869,872],{"class":100,"line":42},[98,862,863],{"class":103},"#[",[98,865,866],{"class":116},"tokio",[98,868,228],{"class":103},[98,870,871],{"class":116},"test",[98,873,111],{"class":103},[98,875,876,879,882,885,887],{"class":100,"line":745},[98,877,878],{"class":221},"async",[98,880,881],{"class":221}," fn",[98,883,884],{"class":258}," receives_the_code",[98,886,262],{"class":103},[98,888,278],{"class":103},[98,890,892,894,896,898,900,902,904,906,908,910,912,914,916,918,920,922,924,926,928,930,932],{"class":100,"line":891},9,[98,893,284],{"class":283},[98,895,287],{"class":116},[98,897,120],{"class":103},[98,899,292],{"class":107},[98,901,228],{"class":103},[98,903,297],{"class":258},[98,905,300],{"class":103},[98,907,303],{"class":107},[98,909,123],{"class":103},[98,911,308],{"class":116},[98,913,87],{"class":103},[98,915,313],{"class":221},[98,917,316],{"class":103},[98,919,319],{"class":221},[98,921,141],{"class":103},[98,923,324],{"class":103},[98,925,303],{"class":107},[98,927,228],{"class":103},[98,929,331],{"class":258},[98,931,262],{"class":103},[98,933,336],{"class":103},[98,935,937,939,941,943,945,947,949,951,954],{"class":100,"line":936},10,[98,938,284],{"class":283},[98,940,343],{"class":116},[98,942,120],{"class":103},[98,944,348],{"class":116},[98,946,316],{"class":103},[98,948,353],{"class":258},[98,950,708],{"class":103},[98,952,953],{"class":258},"unwrap",[98,955,689],{"class":103},[98,957,959],{"class":100,"line":958},11,[98,960,250],{"emptyLinePlaceholder":249},[98,962,964,966,969,971,974,976,978,980,983,985,987,990,992,994,997,999,1002,1006,1008,1010],{"class":100,"line":963},12,[98,965,284],{"class":283},[98,967,968],{"class":116}," order ",[98,970,120],{"class":103},[98,972,973],{"class":116}," client",[98,975,316],{"class":103},[98,977,11],{"class":258},[98,979,708],{"class":103},[98,981,982],{"class":258},"get_with_number",[98,984,300],{"class":103},[98,986,138],{"class":103},[98,988,989],{"class":134},"google",[98,991,138],{"class":103},[98,993,141],{"class":103},[98,995,996],{"class":221}," 44",[98,998,141],{"class":103},[98,1000,1001],{"class":103}," &[]).",[98,1003,1005],{"class":1004},"s7zQu","await",[98,1007,316],{"class":103},[98,1009,953],{"class":258},[98,1011,689],{"class":103},[98,1013,1015,1018,1020,1023,1025,1028,1030,1032,1035,1037],{"class":100,"line":1014},13,[98,1016,1017],{"class":258},"    assert_eq!",[98,1019,300],{"class":103},[98,1021,1022],{"class":116},"order",[98,1024,316],{"class":103},[98,1026,1027],{"class":116},"number",[98,1029,141],{"class":103},[98,1031,131],{"class":103},[98,1033,1034],{"class":134},"+44900000001",[98,1036,138],{"class":103},[98,1038,1039],{"class":103},");\n",[98,1041,1043],{"class":100,"line":1042},14,[98,1044,250],{"emptyLinePlaceholder":249},[98,1046,1048,1051,1053,1055,1057,1059,1061,1064,1066,1068,1071,1073,1075,1078,1081],{"class":100,"line":1047},15,[98,1049,1050],{"class":116},"    mock",[98,1052,316],{"class":103},[98,1054,771],{"class":258},[98,1056,300],{"class":103},[98,1058,1022],{"class":116},[98,1060,316],{"class":103},[98,1062,1063],{"class":116},"tzid",[98,1065,141],{"class":103},[98,1067,131],{"class":103},[98,1069,1070],{"class":134},"Your Google code: 123-456",[98,1072,138],{"class":103},[98,1074,141],{"class":103},[98,1076,1077],{"class":221}," 2",[98,1079,1080],{"class":103},");",[98,1082,1083],{"class":359}," \u002F\u002F the third poll sees it\n",[98,1085,1087,1089,1092,1094,1097,1099,1102,1104,1107,1109,1112,1114,1116,1118,1120,1122,1124],{"class":100,"line":1086},16,[98,1088,284],{"class":283},[98,1090,1091],{"class":116}," options ",[98,1093,120],{"class":103},[98,1095,1096],{"class":107}," WaitCodeOptions",[98,1098,123],{"class":103},[98,1100,1101],{"class":116}," interval",[98,1103,87],{"class":103},[98,1105,1106],{"class":107}," Duration",[98,1108,228],{"class":103},[98,1110,1111],{"class":116},"ZERO",[98,1113,141],{"class":103},[98,1115,324],{"class":103},[98,1117,814],{"class":107},[98,1119,228],{"class":103},[98,1121,331],{"class":258},[98,1123,262],{"class":103},[98,1125,1126],{"class":103}," };\n",[98,1128,1130,1132,1135,1137,1139,1141,1143,1145,1147,1149,1151,1153,1155,1157,1160,1162,1164,1166,1168],{"class":100,"line":1129},17,[98,1131,284],{"class":283},[98,1133,1134],{"class":116}," code ",[98,1136,120],{"class":103},[98,1138,973],{"class":116},[98,1140,316],{"class":103},[98,1142,11],{"class":258},[98,1144,708],{"class":103},[98,1146,767],{"class":258},[98,1148,300],{"class":103},[98,1150,1022],{"class":116},[98,1152,316],{"class":103},[98,1154,1063],{"class":116},[98,1156,141],{"class":103},[98,1158,1159],{"class":116}," options",[98,1161,606],{"class":103},[98,1163,1005],{"class":1004},[98,1165,316],{"class":103},[98,1167,953],{"class":258},[98,1169,689],{"class":103},[98,1171,1173],{"class":100,"line":1172},18,[98,1174,250],{"emptyLinePlaceholder":249},[98,1176,1178,1180,1182,1184,1186,1188,1191,1193],{"class":100,"line":1177},19,[98,1179,1017],{"class":258},[98,1181,300],{"class":103},[98,1183,52],{"class":116},[98,1185,141],{"class":103},[98,1187,131],{"class":103},[98,1189,1190],{"class":134},"123456",[98,1192,138],{"class":103},[98,1194,1039],{"class":103},[98,1196,1198,1200,1202,1204,1206,1209,1212,1214,1217,1220,1222,1225,1227,1230,1232],{"class":100,"line":1197},20,[98,1199,1017],{"class":258},[98,1201,300],{"class":103},[98,1203,231],{"class":116},[98,1205,316],{"class":103},[98,1207,1208],{"class":258},"operations",[98,1210,1211],{"class":103},"()[",[98,1213,319],{"class":221},[98,1215,1216],{"class":103},"].",[98,1218,1219],{"class":116},"status",[98,1221,141],{"class":103},[98,1223,1224],{"class":107}," OperationStatus",[98,1226,228],{"class":103},[98,1228,1229],{"class":107},"TzOverOk",[98,1231,1080],{"class":103},[98,1233,1234],{"class":359}," \u002F\u002F wait_code closed it\n",[98,1236,1238,1240,1242,1244,1246,1248,1251,1254,1256,1259,1261],{"class":100,"line":1237},21,[98,1239,1017],{"class":258},[98,1241,300],{"class":103},[98,1243,231],{"class":116},[98,1245,316],{"class":103},[98,1247,540],{"class":258},[98,1249,1250],{"class":103},"(),",[98,1252,1253],{"class":221}," 9",[98,1255,316],{"class":103},[98,1257,1258],{"class":221},"8",[98,1260,1080],{"class":103},[98,1262,1263],{"class":359}," \u002F\u002F the price is spent once an SMS arrived\n",[98,1265,1267],{"class":100,"line":1266},22,[98,1268,373],{"class":103},[49,1270,1271,1272,1275,1276,1279,1280,316],{},"The blocking client works the same way without any runtime: ",[52,1273,1274],{},"mock.client_blocking()",", then ",[52,1277,1278],{},"client.numbers().wait_code(tzid, options)"," with ",[52,1281,1282],{},"interval: Duration::ZERO",[49,1284,1285,1286,1289,1290,1293,1294,1296,1297,1300,1301,67,1304,1307,1308,1310],{},"The ",[52,1287,1288],{},"msg"," of an operation is the code by default: the first run of 4–8 digits, with spaces and dashes between digits removed (",[52,1291,1292],{},"123-456"," → ",[52,1295,1190],{},"; the rule is public as ",[52,1298,1299],{},"mock::extract_code","); a text without such a run comes back whole. ",[52,1302,1303],{},"message_to_code: false",[52,1305,1306],{},"full_message"," in ",[52,1309,767],{},") gives the full text.",[73,1312,1314],{"id":1313},"errors","Errors",[49,1316,1317,1320,1321,1324,1325,1328,1329,1332,1333,1336,1337,1340,1341,1344,1345,1348,1349,1352],{},[52,1318,1319],{},"fail_next(code)"," makes the next request answer ",[52,1322,1323],{},"{\"response\": code}"," — the client turns it into ",[52,1326,1327],{},"Error::Api"," (",[52,1330,1331],{},"is_no_number()"," for ",[52,1334,1335],{},"NO_NUMBER",") exactly as for the real server. ",[52,1338,1339],{},"fail_next_on(endpoint, code)"," fails only that endpoint. ",[52,1342,1343],{},"fail_next_transport(status)"," makes the next request fail with a non-JSON body and that HTTP status (",[52,1346,1347],{},"Error::Transport","); ",[52,1350,1351],{},"fail_next_transport_on(endpoint, status)"," for one endpoint.",[89,1354,1356],{"className":212,"code":1355,"language":214,"meta":94,"style":94},"use onlinesim_rs_api::Error;\nuse onlinesim_rs_api::mock::MockOnlineSim;\n\n#[tokio::test]\nasync fn handles_a_missing_number_and_a_network_hiccup() {\n    let mock = MockOnlineSim::default();\n    let client = mock.client().unwrap();\n\n    mock.fail_next_on(\"getNum.php\", \"NO_NUMBER\");\n    assert!(client.numbers().get(\"google\", 44, &[]).await.unwrap_err().is_no_number());\n\n    mock.fail_next_transport(503);\n    let error = client.user().balance().await.unwrap_err();\n    assert!(matches!(error, Error::Transport { status: Some(503), .. }));\n\n    assert_eq!(client.user().balance().await.unwrap().balance, 100.0); \u002F\u002F one-shot\n}\n",[52,1357,1358,1371,1387,1391,1403,1416,1432,1452,1456,1484,1533,1537,1553,1582,1627,1631,1673],{"__ignoreMap":94},[98,1359,1360,1362,1364,1366,1369],{"class":100,"line":12},[98,1361,222],{"class":221},[98,1363,225],{"class":107},[98,1365,228],{"class":103},[98,1367,1368],{"class":107},"Error",[98,1370,631],{"class":103},[98,1372,1373,1375,1377,1379,1381,1383,1385],{"class":100,"line":17},[98,1374,222],{"class":221},[98,1376,225],{"class":107},[98,1378,228],{"class":103},[98,1380,231],{"class":107},[98,1382,228],{"class":103},[98,1384,54],{"class":107},[98,1386,631],{"class":103},[98,1388,1389],{"class":100,"line":22},[98,1390,250],{"emptyLinePlaceholder":249},[98,1392,1393,1395,1397,1399,1401],{"class":100,"line":27},[98,1394,863],{"class":103},[98,1396,866],{"class":116},[98,1398,228],{"class":103},[98,1400,871],{"class":116},[98,1402,111],{"class":103},[98,1404,1405,1407,1409,1412,1414],{"class":100,"line":32},[98,1406,878],{"class":221},[98,1408,881],{"class":221},[98,1410,1411],{"class":258}," handles_a_missing_number_and_a_network_hiccup",[98,1413,262],{"class":103},[98,1415,278],{"class":103},[98,1417,1418,1420,1422,1424,1426,1428,1430],{"class":100,"line":37},[98,1419,284],{"class":283},[98,1421,287],{"class":116},[98,1423,120],{"class":103},[98,1425,292],{"class":107},[98,1427,228],{"class":103},[98,1429,331],{"class":258},[98,1431,689],{"class":103},[98,1433,1434,1436,1438,1440,1442,1444,1446,1448,1450],{"class":100,"line":42},[98,1435,284],{"class":283},[98,1437,343],{"class":116},[98,1439,120],{"class":103},[98,1441,348],{"class":116},[98,1443,316],{"class":103},[98,1445,353],{"class":258},[98,1447,708],{"class":103},[98,1449,953],{"class":258},[98,1451,689],{"class":103},[98,1453,1454],{"class":100,"line":745},[98,1455,250],{"emptyLinePlaceholder":249},[98,1457,1458,1460,1462,1465,1467,1469,1472,1474,1476,1478,1480,1482],{"class":100,"line":891},[98,1459,1050],{"class":116},[98,1461,316],{"class":103},[98,1463,1464],{"class":258},"fail_next_on",[98,1466,300],{"class":103},[98,1468,138],{"class":103},[98,1470,1471],{"class":134},"getNum.php",[98,1473,138],{"class":103},[98,1475,141],{"class":103},[98,1477,131],{"class":103},[98,1479,1335],{"class":134},[98,1481,138],{"class":103},[98,1483,1039],{"class":103},[98,1485,1486,1489,1491,1493,1495,1497,1499,1502,1504,1506,1508,1510,1512,1514,1516,1518,1520,1522,1525,1527,1530],{"class":100,"line":936},[98,1487,1488],{"class":258},"    assert!",[98,1490,300],{"class":103},[98,1492,353],{"class":116},[98,1494,316],{"class":103},[98,1496,11],{"class":258},[98,1498,708],{"class":103},[98,1500,1501],{"class":258},"get",[98,1503,300],{"class":103},[98,1505,138],{"class":103},[98,1507,989],{"class":134},[98,1509,138],{"class":103},[98,1511,141],{"class":103},[98,1513,996],{"class":221},[98,1515,141],{"class":103},[98,1517,1001],{"class":103},[98,1519,1005],{"class":1004},[98,1521,316],{"class":103},[98,1523,1524],{"class":258},"unwrap_err",[98,1526,708],{"class":103},[98,1528,1529],{"class":258},"is_no_number",[98,1531,1532],{"class":103},"());\n",[98,1534,1535],{"class":100,"line":958},[98,1536,250],{"emptyLinePlaceholder":249},[98,1538,1539,1541,1543,1546,1548,1551],{"class":100,"line":963},[98,1540,1050],{"class":116},[98,1542,316],{"class":103},[98,1544,1545],{"class":258},"fail_next_transport",[98,1547,300],{"class":103},[98,1549,1550],{"class":221},"503",[98,1552,1039],{"class":103},[98,1554,1555,1557,1560,1562,1564,1566,1568,1570,1572,1574,1576,1578,1580],{"class":100,"line":1014},[98,1556,284],{"class":283},[98,1558,1559],{"class":116}," error ",[98,1561,120],{"class":103},[98,1563,973],{"class":116},[98,1565,316],{"class":103},[98,1567,21],{"class":258},[98,1569,708],{"class":103},[98,1571,540],{"class":258},[98,1573,708],{"class":103},[98,1575,1005],{"class":1004},[98,1577,316],{"class":103},[98,1579,1524],{"class":258},[98,1581,689],{"class":103},[98,1583,1584,1586,1588,1591,1593,1596,1598,1601,1603,1605,1607,1610,1612,1615,1617,1619,1622,1624],{"class":100,"line":1042},[98,1585,1488],{"class":258},[98,1587,300],{"class":103},[98,1589,1590],{"class":258},"matches!",[98,1592,300],{"class":103},[98,1594,1595],{"class":116},"error",[98,1597,141],{"class":103},[98,1599,1600],{"class":107}," Error",[98,1602,228],{"class":103},[98,1604,58],{"class":107},[98,1606,123],{"class":103},[98,1608,1609],{"class":116}," status",[98,1611,87],{"class":103},[98,1613,1614],{"class":107}," Some",[98,1616,300],{"class":103},[98,1618,1550],{"class":221},[98,1620,1621],{"class":103},"),",[98,1623,324],{"class":103},[98,1625,1626],{"class":103}," }));\n",[98,1628,1629],{"class":100,"line":1047},[98,1630,250],{"emptyLinePlaceholder":249},[98,1632,1633,1635,1637,1639,1641,1643,1645,1647,1649,1651,1653,1655,1657,1659,1661,1664,1666,1668,1670],{"class":100,"line":1086},[98,1634,1017],{"class":258},[98,1636,300],{"class":103},[98,1638,353],{"class":116},[98,1640,316],{"class":103},[98,1642,21],{"class":258},[98,1644,708],{"class":103},[98,1646,540],{"class":258},[98,1648,708],{"class":103},[98,1650,1005],{"class":1004},[98,1652,316],{"class":103},[98,1654,953],{"class":258},[98,1656,708],{"class":103},[98,1658,540],{"class":116},[98,1660,141],{"class":103},[98,1662,1663],{"class":221}," 100",[98,1665,316],{"class":103},[98,1667,319],{"class":221},[98,1669,1080],{"class":103},[98,1671,1672],{"class":359}," \u002F\u002F one-shot\n",[98,1674,1675],{"class":100,"line":1129},[98,1676,373],{"class":103},[49,1678,1679,1680,1683,1684,1686,1687,1690,1691,1694,1695,1698,1699,1702,1703,1706,1707,1710,1711,1713,1714,1694,1716,1719,1720,1723,1724,1727,1728,1731,1732,1727,1735,1738],{},"The state itself produces the real error codes too: ",[52,1681,1682],{},"WARNING_LOW_BALANCE"," when the balance is short, ",[52,1685,1335],{}," when ",[52,1688,1689],{},"reject"," matches the next number, ",[52,1692,1693],{},"UNDEFINED_COUNTRY"," \u002F ",[52,1696,1697],{},"ERROR_NO_SERVICE"," for unknown prices, ",[52,1700,1701],{},"ERROR_WRONG_TZID"," for an unknown or closed operation (",[52,1704,1705],{},"next"," too; ",[52,1708,1709],{},"ERROR_NO_TZID"," for tzid ",[52,1712,319],{},"), ",[52,1715,1693],{},[52,1717,1718],{},"UNDEFINED_DAYS"," for an unknown rent country or period, ",[52,1721,1722],{},"TRY_AGAIN_LATER"," for every refused ",[52,1725,1726],{},"rent().extend",", ",[52,1729,1730],{},"ERROR_NO_OPERATIONS"," for an unknown rent in ",[52,1733,1734],{},"rent().close",[52,1736,1737],{},"ERROR_WRONG_KEY"," for a wrong key (HTTP 456) or no key (HTTP 200).",[73,1740,1742],{"id":1741},"inspecting-requests","Inspecting requests",[49,1744,1745,1748,1749,1727,1752,1755,1756,1727,1759,1762,1763,1766,1767,1713,1770,1773],{},[52,1746,1747],{},"mock.requests()"," lists every request received: ",[52,1750,1751],{},"MockRequest { method, path, query, body }",[52,1753,1754],{},"path"," relative to ",[52,1757,1758],{},"\u002Fapi\u002F",[52,1760,1761],{},"query"," a ",[52,1764,1765],{},"BTreeMap"," (with ",[52,1768,1769],{},"lang",[52,1771,1772],{},"body"," the parsed JSON of a POST.",[89,1775,1777],{"className":212,"code":1776,"language":214,"meta":94,"style":94},"use onlinesim_rs_api::Method;\nuse onlinesim_rs_api::mock::MockOnlineSim;\n\n#[tokio::test]\nasync fn sends_reject_as_a_comma_list() {\n    let mock = MockOnlineSim::default();\n    mock.client().unwrap().numbers().get(\"google\", 44, &[\"4470\", \"4471\"]).await.unwrap();\n\n    let request = &mock.requests()[0];\n    assert_eq!((request.method, request.path.as_str()), (Method::Get, \"getNum.php\"));\n    assert_eq!(request.query[\"reject\"], \"4470,4471\");\n    assert_eq!(request.body, None);\n}\n",[52,1778,1779,1792,1808,1812,1824,1837,1853,1917,1921,1947,1999,2031,2050],{"__ignoreMap":94},[98,1780,1781,1783,1785,1787,1790],{"class":100,"line":12},[98,1782,222],{"class":221},[98,1784,225],{"class":107},[98,1786,228],{"class":103},[98,1788,1789],{"class":107},"Method",[98,1791,631],{"class":103},[98,1793,1794,1796,1798,1800,1802,1804,1806],{"class":100,"line":17},[98,1795,222],{"class":221},[98,1797,225],{"class":107},[98,1799,228],{"class":103},[98,1801,231],{"class":107},[98,1803,228],{"class":103},[98,1805,54],{"class":107},[98,1807,631],{"class":103},[98,1809,1810],{"class":100,"line":22},[98,1811,250],{"emptyLinePlaceholder":249},[98,1813,1814,1816,1818,1820,1822],{"class":100,"line":27},[98,1815,863],{"class":103},[98,1817,866],{"class":116},[98,1819,228],{"class":103},[98,1821,871],{"class":116},[98,1823,111],{"class":103},[98,1825,1826,1828,1830,1833,1835],{"class":100,"line":32},[98,1827,878],{"class":221},[98,1829,881],{"class":221},[98,1831,1832],{"class":258}," sends_reject_as_a_comma_list",[98,1834,262],{"class":103},[98,1836,278],{"class":103},[98,1838,1839,1841,1843,1845,1847,1849,1851],{"class":100,"line":37},[98,1840,284],{"class":283},[98,1842,287],{"class":116},[98,1844,120],{"class":103},[98,1846,292],{"class":107},[98,1848,228],{"class":103},[98,1850,331],{"class":258},[98,1852,689],{"class":103},[98,1854,1855,1857,1859,1861,1863,1865,1867,1869,1871,1873,1875,1877,1879,1881,1883,1885,1887,1890,1892,1895,1897,1899,1901,1904,1906,1909,1911,1913,1915],{"class":100,"line":42},[98,1856,1050],{"class":116},[98,1858,316],{"class":103},[98,1860,353],{"class":258},[98,1862,708],{"class":103},[98,1864,953],{"class":258},[98,1866,708],{"class":103},[98,1868,11],{"class":258},[98,1870,708],{"class":103},[98,1872,1501],{"class":258},[98,1874,300],{"class":103},[98,1876,138],{"class":103},[98,1878,989],{"class":134},[98,1880,138],{"class":103},[98,1882,141],{"class":103},[98,1884,996],{"class":221},[98,1886,141],{"class":103},[98,1888,1889],{"class":103}," &[",[98,1891,138],{"class":103},[98,1893,1894],{"class":134},"4470",[98,1896,138],{"class":103},[98,1898,141],{"class":103},[98,1900,131],{"class":103},[98,1902,1903],{"class":134},"4471",[98,1905,138],{"class":103},[98,1907,1908],{"class":103},"]).",[98,1910,1005],{"class":1004},[98,1912,316],{"class":103},[98,1914,953],{"class":258},[98,1916,689],{"class":103},[98,1918,1919],{"class":100,"line":745},[98,1920,250],{"emptyLinePlaceholder":249},[98,1922,1923,1925,1928,1930,1933,1935,1937,1940,1942,1944],{"class":100,"line":891},[98,1924,284],{"class":283},[98,1926,1927],{"class":116}," request ",[98,1929,120],{"class":103},[98,1931,1932],{"class":103}," &",[98,1934,231],{"class":116},[98,1936,316],{"class":103},[98,1938,1939],{"class":258},"requests",[98,1941,1211],{"class":103},[98,1943,319],{"class":221},[98,1945,1946],{"class":103},"];\n",[98,1948,1949,1951,1954,1957,1959,1962,1964,1967,1969,1971,1973,1976,1979,1981,1983,1985,1988,1990,1992,1994,1996],{"class":100,"line":936},[98,1950,1017],{"class":258},[98,1952,1953],{"class":103},"((",[98,1955,1956],{"class":116},"request",[98,1958,316],{"class":103},[98,1960,1961],{"class":116},"method",[98,1963,141],{"class":103},[98,1965,1966],{"class":116}," request",[98,1968,316],{"class":103},[98,1970,1754],{"class":116},[98,1972,316],{"class":103},[98,1974,1975],{"class":258},"as_str",[98,1977,1978],{"class":103},"()),",[98,1980,1328],{"class":103},[98,1982,1789],{"class":107},[98,1984,228],{"class":103},[98,1986,1987],{"class":107},"Get",[98,1989,141],{"class":103},[98,1991,131],{"class":103},[98,1993,1471],{"class":134},[98,1995,138],{"class":103},[98,1997,1998],{"class":103},"));\n",[98,2000,2001,2003,2005,2007,2009,2011,2013,2015,2017,2019,2022,2024,2027,2029],{"class":100,"line":958},[98,2002,1017],{"class":258},[98,2004,300],{"class":103},[98,2006,1956],{"class":116},[98,2008,316],{"class":103},[98,2010,1761],{"class":116},[98,2012,104],{"class":103},[98,2014,138],{"class":103},[98,2016,1689],{"class":134},[98,2018,138],{"class":103},[98,2020,2021],{"class":103},"],",[98,2023,131],{"class":103},[98,2025,2026],{"class":134},"4470,4471",[98,2028,138],{"class":103},[98,2030,1039],{"class":103},[98,2032,2033,2035,2037,2039,2041,2043,2045,2048],{"class":100,"line":963},[98,2034,1017],{"class":258},[98,2036,300],{"class":103},[98,2038,1956],{"class":116},[98,2040,316],{"class":103},[98,2042,1772],{"class":116},[98,2044,141],{"class":103},[98,2046,2047],{"class":107}," None",[98,2049,1039],{"class":103},[98,2051,2052],{"class":100,"line":1014},[98,2053,373],{"class":103},[73,2055,2057],{"id":2056},"control-api","Control API",[493,2059,2060,2069],{},[496,2061,2062],{},[499,2063,2064,2067],{},[502,2065,2066],{},"Member",[502,2068,510],{},[512,2070,2071,2084,2102,2120,2136,2152,2182,2203,2214,2231,2244,2254,2264],{},[499,2072,2073,2081],{},[517,2074,2075,1694,2078],{},[52,2076,2077],{},"MockOnlineSim::new(options)",[52,2079,2080],{},"default()",[517,2082,2083],{},"An in-process mock.",[499,2085,2086,2094],{},[517,2087,2088,1694,2091],{},[52,2089,2090],{},"client()",[52,2092,2093],{},"client_blocking()",[517,2095,2096,2097,1694,2099,2101],{},"A normal ",[52,2098,66],{},[52,2100,70],{}," wired to the mock.",[499,2103,2104,2109],{},[517,2105,2106],{},[52,2107,2108],{},"transport()",[517,2110,1285,2111,1328,2114,2116,2117,2119],{},[52,2112,2113],{},"MockTransport",[52,2115,58],{}," + ",[52,2118,62],{},", cheap to clone).",[499,2121,2122,2130],{},[517,2123,2124,1694,2127],{},[52,2125,2126],{},"builder()",[52,2128,2129],{},"base_url()",[517,2131,2132,2133,2135],{},"A ",[52,2134,756],{}," with the mock's key and base URL \u002F that base URL.",[499,2137,2138,2146],{},[517,2139,2140,1694,2143],{},[52,2141,2142],{},"add_sms(tzid, text)",[52,2144,2145],{},"add_sms_from(tzid, text, service)",[517,2147,2148,2149,2151],{},"An SMS arrives now at a number operation or a rent (detected by ",[52,2150,1063],{},"). Panics for an unknown or closed one.",[499,2153,2154,2162],{},[517,2155,2156,1694,2159],{},[52,2157,2158],{},"add_sms_after(tzid, text, polls)",[52,2160,2161],{},"add_sms_after_from(…, service)",[517,2163,2164,2165,2168,2169,1328,2171,6,2174,1727,2177,6,2180,606],{},"The SMS arrives after ",[52,2166,2167],{},"polls"," state requests for ",[52,2170,1063],{},[52,2172,2173],{},"numbers().state",[52,2175,2176],{},"state_one",[52,2178,2179],{},"rent().state",[52,2181,2176],{},[499,2183,2184,2190],{},[517,2185,2186,1694,2188],{},[52,2187,1319],{},[52,2189,1339],{},[517,2191,2192,2193,2196,2197,2200,2201,316],{},"The next request (to ",[52,2194,2195],{},"endpoint"," only, e.g. ",[52,2198,2199],{},"\"getNum.php\"",") answers ",[52,2202,1323],{},[499,2204,2205,2211],{},[517,2206,2207,1694,2209],{},[52,2208,1343],{},[52,2210,1351],{},[517,2212,2213],{},"The next request fails with a non-JSON body and that HTTP status.",[499,2215,2216,2224],{},[517,2217,2218,1694,2221],{},[52,2219,2220],{},"set_balance(balance, zbalance)",[52,2222,2223],{},"balance()",[517,2225,2226,2227,2230],{},"Set the total balance and an extra frozen part \u002F read the total balance, USD (it includes the part frozen by open operations and unconfirmed rents, as ",[52,2228,2229],{},"user().balance()"," reports it).",[499,2232,2233,2241],{},[517,2234,2235,1694,2238],{},[52,2236,2237],{},"operations()",[52,2239,2240],{},"rents()",[517,2242,2243],{},"Copies of the current number operations \u002F open rents, for assertions.",[499,2245,2246,2251],{},[517,2247,2248],{},[52,2249,2250],{},"requests()",[517,2252,2253],{},"Copies of the requests received.",[499,2255,2256,2261],{},[517,2257,2258],{},[52,2259,2260],{},"webhook_url()",[517,2262,2263],{},"The webhook URL last set through the profile.",[499,2265,2266,2271],{},[517,2267,2268],{},[52,2269,2270],{},"reset()",[517,2272,2273],{},"Back to the constructor's state.",[49,2275,2276,2279,2280,2283,2284,2287,2288,2291,2292,2295,2296,2291,2298,2300],{},[52,2277,2278],{},"set_balance"," takes two values because its 0.2.0 signature did; the other SDKs' ",[52,2281,2282],{},"setBalance(n)"," is ",[52,2285,2286],{},"set_balance(n, 0.0)",". ",[52,2289,2290],{},"script_sms"," and ",[52,2293,2294],{},"fail_no_number"," from 0.2.0 still work; ",[52,2297,771],{},[52,2299,1464],{}," replace them.",[73,2302,2304,2305,2307],{"id":2303},"over-http-feature-mock","Over HTTP (feature ",[52,2306,231],{},")",[49,2309,2310,2311,2313,2314,67,2317,2320,2321,2323,2324,2327,2328,1694,2330,2332],{},"With the ",[52,2312,231],{}," feature, ",[52,2315,2316],{},"MockOnlineSim::start().await",[52,2318,2319],{},"start_with(options)",") also serves the same state on a local port (wiremock, needs a tokio runtime), for code that builds its own HTTP client from a base URL. ",[52,2322,2129],{}," is then ",[52,2325,2326],{},"http:\u002F\u002F127.0.0.1:\u003Cport>\u002Fapi\u002F",", and ",[52,2329,2090],{},[52,2331,2093],{}," go through real HTTP. All helpers above work the same.",[73,2334,2336],{"id":2335},"what-the-mock-does","What the mock does",[2338,2339,2340,2381,2446,2496,2505],"ul",{},[2341,2342,2343,2346,2347,2349,2350,2353,2354,2356,2357,2360,2361,2364,2365,2367,2368,2370,2371,2374,2375,2377,2378,2380],"li",{},[2344,2345,9],"strong",{},": ",[52,2348,1501],{}," freezes the price; ",[52,2351,2352],{},"close"," after an SMS spends it, ",[52,2355,2352],{}," without one refunds it; ",[52,2358,2359],{},"ban"," after an SMS answers ",[52,2362,2363],{},"\"0\""," (an ",[52,2366,1327],{}," with code ",[52,2369,319],{},"), like the server. Numbers are ",[52,2372,2373],{},"+\u003Ccountry>9000000NN",", ids count from 1. ",[52,2376,1705],{}," switches to the following SMS. The operation's ",[52,2379,792],{}," stays at 1200 s — there is no clock.",[2341,2382,2383,2346,2385,2387,2388,2390,2391,1727,2393,2390,2396,2399,2400,2403,2404,2407,2408,2390,2410,2412,2413,2416,2417,2390,2419,2421,2422,2425,2426,2428,2429,2432,2433,6,2435,2437,2438,2441,2442,2445],{},[2344,2384,14],{},[52,2386,1501],{}," reserves the price (",[52,2389,1219],{}," ",[52,2392,319],{},[52,2394,2395],{},"checked",[52,2397,2398],{},"false",") and keeps the ",[52,2401,2402],{},"extension"," flag; the first SMS that is not ",[52,2405,2406],{},"notify"," confirms the rent (",[52,2409,1219],{},[52,2411,179],{},") and charges it — ",[52,2414,2415],{},"add_sms_from(tzid, text, Some(\"notify\"))"," adds a notice with ",[52,2418,52],{},[52,2420,319],{}," that confirms nothing. ",[52,2423,2424],{},"extend"," works on a confirmed rent and charges at once. ",[52,2427,2352],{}," releases the reservation of an unconfirmed rent and gives no refund for a confirmed one. ",[52,2430,2431],{},"sum"," is a number in ",[52,2434,1501],{},[52,2436,2424],{}," and a decimal string on the wire of ",[52,2439,2440],{},"state",", like the server. SMS appear in ",[52,2443,2444],{},"messages",", newest first. Rent numbers have no country code.",[2341,2447,2448,2346,2450,2452,2453,2456,2457,2460,2461,2464,2465,2468,2469,2473,2474,2477,2478,2480,2481,2483,2484,2487,2488,2491,2492,2495],{},[2344,2449,19],{},[52,2451,540],{}," (frozen part included), a fixed profile, ",[52,2454,2455],{},"set_webhook_url"," accepts any ",[52,2458,2459],{},"scheme:\u002F\u002F…"," URL (",[52,2462,2463],{},"VALIDATION_ERROR"," otherwise), ",[52,2466,2467],{},"webhook_logs"," lists the deliveries the mock ",[2470,2471,2472],"em",{},"recorded"," when an SMS arrived while a webhook URL was set — it makes no HTTP call; their ",[52,2475,2476],{},"params"," follow the real payload (",[52,2479,52],{}," empty without a code, rent ",[52,2482,1027],{}," in digits without ",[52,2485,2486],{},"+",", rent ",[52,2489,2490],{},"time_left"," in minutes). ",[52,2493,2494],{},"payment_history"," has no orders.",[2341,2497,2498,2346,2501,2504],{},[2344,2499,2500],{},"Free",[52,2502,2503],{},"free().list"," returns two fixed countries (44 first) with one number and a few SMS each.",[2341,2506,2507,2508,1328,2511,2514,2515,2517,2518,2521],{},"Not imitated: anything that needs real time — the 5 s lock after ",[52,2509,2510],{},"setOperationOk",[52,2512,2513],{},"INTERVAL_CONCURRENT_REQUESTS_ERROR","), the 10 s lock of ",[52,2516,1726],{},", the 120 s before an unconfirmed rent may be closed and its 20-minute wait for the first SMS. ",[52,2519,2520],{},"guard_interval > 0"," stands in for \"too early to close\".",[2523,2524,2525],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}",{"title":94,"searchDepth":17,"depth":17,"links":2527},[2528,2529,2530,2531,2532,2533,2535],{"id":75,"depth":17,"text":76},{"id":760,"depth":17,"text":761},{"id":1313,"depth":17,"text":1314},{"id":1741,"depth":17,"text":1742},{"id":2056,"depth":17,"text":2057},{"id":2303,"depth":17,"text":2534},"Over HTTP (feature mock)",{"id":2335,"depth":17,"text":2336},"Test your integration offline with MockOnlineSim — no network, key or money.","md",{},{"order":37},{"title":34,"description":2536},"YkmRhjeqUJuJzxUFeZwVKCJEPSEY9XQ5B3lEeC6buPk",[2543,2545],{"title":14,"path":15,"stem":16,"description":2544,"order":17},"Rent a number for days and receive every SMS sent to it — client.rent().",{"title":19,"path":20,"stem":21,"description":2546,"order":22},"Balance, profile, payments and the webhook URL — client.user().",1795164593582]