[{"data":1,"prerenderedAt":943},["ShallowReactive",2],{"navigation":3,"\u002Fuser":43,"\u002Fuser-surround":938},[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":19,"body":45,"description":932,"extension":933,"meta":934,"navigation":935,"path":20,"seo":936,"stem":21,"__hash__":937},"docs\u002Fuser.md",{"type":46,"value":47,"toc":924},"minimark",[48,52,56,112,129,212,232,235,238,270,302,378,381,384,426,467,559,562,568,608,642,654,657,660,686,709,712,715,760,810,920],[49,50,51],"h2",{"id":51},"balance",[53,54,55],"p",{},"Balance in USD.",[57,58,63],"pre",{"className":59,"code":60,"language":61,"meta":62,"style":62},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","async fn balance(&self) -> Result\u003CBalance> \u002F\u002F { balance: f64, zbalance: f64, income: Option\u003Cf64> }\n","rust","",[64,65,66],"code",{"__ignoreMap":62},[67,68,70,74,77,81,85,89,92,95,99,102,105,108],"span",{"class":69,"line":12},"line",[67,71,73],{"class":72},"sbssI","async",[67,75,76],{"class":72}," fn",[67,78,80],{"class":79},"s2Zo4"," balance",[67,82,84],{"class":83},"sMK4o","(&",[67,86,88],{"class":87},"sTEyZ","self",[67,90,91],{"class":83},")",[67,93,94],{"class":83}," ->",[67,96,98],{"class":97},"sBMFI"," Result",[67,100,101],{"class":83},"\u003C",[67,103,104],{"class":97},"Balance",[67,106,107],{"class":83},">",[67,109,111],{"class":110},"sHwdD"," \u002F\u002F { balance: f64, zbalance: f64, income: Option\u003Cf64> }\n",[53,113,114,116,117,120,121,124,125,128],{},[64,115,51],{}," includes the sum frozen by numbers and unconfirmed rents in progress (",[64,118,119],{},"zbalance",", which may be negative): available = ",[64,122,123],{},"balance − max(zbalance, 0)",". ",[64,126,127],{},"income"," is the partner income. The server caches the answer for 60 s.",[57,130,132],{"className":59,"code":131,"language":61,"meta":62,"style":62},"let b = client.user().balance().await?;\nlet available = b.balance - b.zbalance.max(0.0);\n",[64,133,134,168],{"__ignoreMap":62},[67,135,136,140,143,146,149,152,154,157,159,161,165],{"class":69,"line":12},[67,137,139],{"class":138},"spNyl","let",[67,141,142],{"class":87}," b ",[67,144,145],{"class":83},"=",[67,147,148],{"class":87}," client",[67,150,151],{"class":83},".",[67,153,21],{"class":79},[67,155,156],{"class":83},"().",[67,158,51],{"class":79},[67,160,156],{"class":83},[67,162,164],{"class":163},"s7zQu","await",[67,166,167],{"class":83},"?;\n",[67,169,170,172,175,177,180,182,185,188,190,192,194,196,199,202,205,207,209],{"class":69,"line":17},[67,171,139],{"class":138},[67,173,174],{"class":87}," available ",[67,176,145],{"class":83},[67,178,179],{"class":87}," b",[67,181,151],{"class":83},[67,183,184],{"class":87},"balance ",[67,186,187],{"class":83},"-",[67,189,179],{"class":87},[67,191,151],{"class":83},[67,193,119],{"class":87},[67,195,151],{"class":83},[67,197,198],{"class":79},"max",[67,200,201],{"class":83},"(",[67,203,204],{"class":72},"0",[67,206,151],{"class":83},[67,208,204],{"class":72},[67,210,211],{"class":83},");\n",[53,213,214,215,218,219,222,223,222,226,222,229,151],{},"Errors: ",[64,216,217],{},"ApiError"," ",[64,220,221],{},"ERROR_WRONG_KEY",", ",[64,224,225],{},"ACCOUNT_BLOCKED",[64,227,228],{},"API_ACCESS_DISABLED",[64,230,231],{},"API_ACCESS_IP",[49,233,234],{"id":234},"profile",[53,236,237],{},"The account profile.",[57,239,241],{"className":59,"code":240,"language":61,"meta":62,"style":62},"async fn profile(&self) -> Result\u003CProfile>\n",[64,242,243],{"__ignoreMap":62},[67,244,245,247,249,252,254,256,258,260,262,264,267],{"class":69,"line":12},[67,246,73],{"class":72},[67,248,76],{"class":72},[67,250,251],{"class":79}," profile",[67,253,84],{"class":83},[67,255,88],{"class":87},[67,257,91],{"class":83},[67,259,94],{"class":83},[67,261,98],{"class":97},[67,263,101],{"class":83},[67,265,266],{"class":97},"Profile",[67,268,269],{"class":83},">\n",[53,271,272,274,275,278,279,282,283,124,286,289,290,293,294,297,298,301],{},[64,273,266],{},": ",[64,276,277],{},"{ id, name, username, email, locale, currency, number_country, number_reject, webhook_url, api_access, number, country, … }","; all but ",[64,280,281],{},"id"," are ",[64,284,285],{},"Option",[64,287,288],{},"number"," is the phone number as digits (",[64,291,292],{},"Option\u003Ci64>","), ",[64,295,296],{},"country"," its country (",[64,299,300],{},"Option\u003CString>",").",[57,303,305],{"className":59,"code":304,"language":61,"meta":62,"style":62},"let profile = client.user().profile().await?;\nprintln!(\"{:?} {:?}\", profile.email, profile.webhook_url);\n",[64,306,307,332],{"__ignoreMap":62},[67,308,309,311,314,316,318,320,322,324,326,328,330],{"class":69,"line":12},[67,310,139],{"class":138},[67,312,313],{"class":87}," profile ",[67,315,145],{"class":83},[67,317,148],{"class":87},[67,319,151],{"class":83},[67,321,21],{"class":79},[67,323,156],{"class":83},[67,325,234],{"class":79},[67,327,156],{"class":83},[67,329,164],{"class":163},[67,331,167],{"class":83},[67,333,334,337,339,342,346,349,352,354,357,360,362,364,367,369,371,373,376],{"class":69,"line":17},[67,335,336],{"class":79},"println!",[67,338,201],{"class":83},[67,340,341],{"class":83},"\"{",[67,343,345],{"class":344},"sfazB",":?",[67,347,348],{"class":83},"}",[67,350,351],{"class":83}," {",[67,353,345],{"class":344},[67,355,356],{"class":83},"}\"",[67,358,359],{"class":83},",",[67,361,251],{"class":87},[67,363,151],{"class":83},[67,365,366],{"class":87},"email",[67,368,359],{"class":83},[67,370,251],{"class":87},[67,372,151],{"class":83},[67,374,375],{"class":87},"webhook_url",[67,377,211],{"class":83},[49,379,380],{"id":380},"payment_history",[53,382,383],{},"Top-up orders (paginated, newest first) and the available payment methods. Pages start at 1.",[57,385,387],{"className":59,"code":386,"language":61,"meta":62,"style":62},"async fn payment_history(&self, page: u32) -> Result\u003CPaymentHistory>\n",[64,388,389],{"__ignoreMap":62},[67,390,391,393,395,398,400,402,404,407,410,413,415,417,419,421,424],{"class":69,"line":12},[67,392,73],{"class":72},[67,394,76],{"class":72},[67,396,397],{"class":79}," payment_history",[67,399,84],{"class":83},[67,401,88],{"class":87},[67,403,359],{"class":83},[67,405,406],{"class":87}," page",[67,408,409],{"class":83},":",[67,411,412],{"class":97}," u32",[67,414,91],{"class":83},[67,416,94],{"class":83},[67,418,98],{"class":97},[67,420,101],{"class":83},[67,422,423],{"class":97},"PaymentHistory",[67,425,269],{"class":83},[53,427,428,274,430,124,433,436,437,440,441,444,445,448,449,452,453,124,456,459,460,222,463,466],{},[64,429,423],{},[64,431,432],{},"{ orders: Paginator\u003CPaymentOrder>, paylist, domains, forms, currency, buttons }",[64,434,435],{},"PaymentOrder.sum"," stays a decimal string (",[64,438,439],{},"\"89.00\"","); ",[64,442,443],{},"currency"," and ",[64,446,447],{},"form_text"," may be ",[64,450,451],{},"None","; fields without a typed slot are in ",[64,454,455],{},"PaymentOrder.extra",[64,457,458],{},"paylist"," maps a group id to its payment methods; when the ids are 0, 1, 2… the server sends a JSON array, which is kept keyed ",[64,461,462],{},"\"0\"",[64,464,465],{},"\"1\"",", ….",[57,468,470],{"className":59,"code":469,"language":61,"meta":62,"style":62},"let orders = client.user().payment_history(1).await?.orders;\nprintln!(\"{} orders, page {}\u002F{}\", orders.total, orders.current_page, orders.last_page);\n",[64,471,472,509],{"__ignoreMap":62},[67,473,474,476,479,481,483,485,487,489,491,493,496,498,500,503,506],{"class":69,"line":12},[67,475,139],{"class":138},[67,477,478],{"class":87}," orders ",[67,480,145],{"class":83},[67,482,148],{"class":87},[67,484,151],{"class":83},[67,486,21],{"class":79},[67,488,156],{"class":83},[67,490,380],{"class":79},[67,492,201],{"class":83},[67,494,495],{"class":72},"1",[67,497,301],{"class":83},[67,499,164],{"class":163},[67,501,502],{"class":83},"?.",[67,504,505],{"class":87},"orders",[67,507,508],{"class":83},";\n",[67,510,511,513,515,518,521,524,526,529,531,534,536,539,541,543,545,548,550,552,554,557],{"class":69,"line":17},[67,512,336],{"class":79},[67,514,201],{"class":83},[67,516,517],{"class":83},"\"{}",[67,519,520],{"class":344}," orders, page ",[67,522,523],{"class":83},"{}",[67,525,6],{"class":344},[67,527,528],{"class":83},"{}\"",[67,530,359],{"class":83},[67,532,533],{"class":87}," orders",[67,535,151],{"class":83},[67,537,538],{"class":87},"total",[67,540,359],{"class":83},[67,542,533],{"class":87},[67,544,151],{"class":83},[67,546,547],{"class":87},"current_page",[67,549,359],{"class":83},[67,551,533],{"class":87},[67,553,151],{"class":83},[67,555,556],{"class":87},"last_page",[67,558,211],{"class":83},[49,560,561],{"id":561},"set_webhook_url",[53,563,564,565,301],{},"Set the URL that receives SMS webhooks (see ",[566,567,29],"a",{"href":30},[57,569,571],{"className":59,"code":570,"language":61,"meta":62,"style":62},"async fn set_webhook_url(&self, url: &str) -> Result\u003C()>\n",[64,572,573],{"__ignoreMap":62},[67,574,575,577,579,582,584,586,588,591,593,596,599,601,603,605],{"class":69,"line":12},[67,576,73],{"class":72},[67,578,76],{"class":72},[67,580,581],{"class":79}," set_webhook_url",[67,583,84],{"class":83},[67,585,88],{"class":87},[67,587,359],{"class":83},[67,589,590],{"class":87}," url",[67,592,409],{"class":83},[67,594,595],{"class":83}," &",[67,597,598],{"class":97},"str",[67,600,91],{"class":83},[67,602,94],{"class":83},[67,604,98],{"class":97},[67,606,607],{"class":83},"\u003C()>\n",[57,609,611],{"className":59,"code":610,"language":61,"meta":62,"style":62},"client.user().set_webhook_url(\"https:\u002F\u002Fexample.com\u002Fonlinesim-hook\").await?;\n",[64,612,613],{"__ignoreMap":62},[67,614,615,618,620,622,624,626,628,631,634,636,638,640],{"class":69,"line":12},[67,616,617],{"class":87},"client",[67,619,151],{"class":83},[67,621,21],{"class":79},[67,623,156],{"class":83},[67,625,561],{"class":79},[67,627,201],{"class":83},[67,629,630],{"class":83},"\"",[67,632,633],{"class":344},"https:\u002F\u002Fexample.com\u002Fonlinesim-hook",[67,635,630],{"class":83},[67,637,301],{"class":83},[67,639,164],{"class":163},[67,641,167],{"class":83},[53,643,214,644,218,646,649,650,653],{},[64,645,217],{},[64,647,648],{},"VALIDATION_ERROR"," for an invalid URL; ",[64,651,652],{},"message"," holds the server's field messages.",[49,655,656],{"id":656},"clear_webhook_url",[53,658,659],{},"Remove the webhook URL, also from operations in progress.",[57,661,663],{"className":59,"code":662,"language":61,"meta":62,"style":62},"async fn clear_webhook_url(&self) -> Result\u003C()>\n",[64,664,665],{"__ignoreMap":62},[67,666,667,669,671,674,676,678,680,682,684],{"class":69,"line":12},[67,668,73],{"class":72},[67,670,76],{"class":72},[67,672,673],{"class":79}," clear_webhook_url",[67,675,84],{"class":83},[67,677,88],{"class":87},[67,679,91],{"class":83},[67,681,94],{"class":83},[67,683,98],{"class":97},[67,685,607],{"class":83},[57,687,689],{"className":59,"code":688,"language":61,"meta":62,"style":62},"client.user().clear_webhook_url().await?;\n",[64,690,691],{"__ignoreMap":62},[67,692,693,695,697,699,701,703,705,707],{"class":69,"line":12},[67,694,617],{"class":87},[67,696,151],{"class":83},[67,698,21],{"class":79},[67,700,156],{"class":83},[67,702,656],{"class":79},[67,704,156],{"class":83},[67,706,164],{"class":163},[67,708,167],{"class":83},[49,710,711],{"id":711},"webhook_logs",[53,713,714],{},"Webhook delivery log, newest first, 10 per page. Pages start at 1.",[57,716,718],{"className":59,"code":717,"language":61,"meta":62,"style":62},"async fn webhook_logs(&self, page: u32) -> Result\u003CPaginator\u003CWebhookLog>>\n",[64,719,720],{"__ignoreMap":62},[67,721,722,724,726,729,731,733,735,737,739,741,743,745,747,749,752,754,757],{"class":69,"line":12},[67,723,73],{"class":72},[67,725,76],{"class":72},[67,727,728],{"class":79}," webhook_logs",[67,730,84],{"class":83},[67,732,88],{"class":87},[67,734,359],{"class":83},[67,736,406],{"class":87},[67,738,409],{"class":83},[67,740,412],{"class":97},[67,742,91],{"class":83},[67,744,94],{"class":83},[67,746,98],{"class":97},[67,748,101],{"class":83},[67,750,751],{"class":97},"Paginator",[67,753,101],{"class":83},[67,755,756],{"class":97},"WebhookLog",[67,758,759],{"class":83},">>\n",[53,761,762,274,764,767,768,771,772,775,776,779,780,222,783,786,787,222,790,779,793,222,796,799,800,803,804,809],{},[64,763,756],{},[64,765,766],{},"{ id, user_id, webhook_url, kind, params, status, error, created_at, updated_at }"," — ",[64,769,770],{},"kind"," (the server's ",[64,773,774],{},"type",") is ",[64,777,778],{},"receiving_sms"," or ",[64,781,782],{},"rent_sms",[64,784,785],{},"status"," is ",[64,788,789],{},"success",[64,791,792],{},"fail",[64,794,795],{},"pending",[64,797,798],{},"params"," the payload that was sent (",[64,801,802],{},"serde_json::Value","; ",[566,805,806],{"href":30},[64,807,808],{},"parse_webhook_value"," normalises it).",[57,811,813],{"className":59,"code":812,"language":61,"meta":62,"style":62},"let logs = client.user().webhook_logs(1).await?;\nfor log in &logs.data {\n    println!(\"{} {} {:?}\", log.created_at, log.status, log.error);\n}\n",[64,814,815,844,868,915],{"__ignoreMap":62},[67,816,817,819,822,824,826,828,830,832,834,836,838,840,842],{"class":69,"line":12},[67,818,139],{"class":138},[67,820,821],{"class":87}," logs ",[67,823,145],{"class":83},[67,825,148],{"class":87},[67,827,151],{"class":83},[67,829,21],{"class":79},[67,831,156],{"class":83},[67,833,711],{"class":79},[67,835,201],{"class":83},[67,837,495],{"class":72},[67,839,301],{"class":83},[67,841,164],{"class":163},[67,843,167],{"class":83},[67,845,846,849,852,855,857,860,862,865],{"class":69,"line":17},[67,847,848],{"class":163},"for",[67,850,851],{"class":87}," log ",[67,853,854],{"class":72},"in",[67,856,595],{"class":83},[67,858,859],{"class":87},"logs",[67,861,151],{"class":83},[67,863,864],{"class":87},"data ",[67,866,867],{"class":83},"{\n",[67,869,870,873,875,877,880,882,884,886,888,891,893,896,898,900,902,904,906,908,910,913],{"class":69,"line":22},[67,871,872],{"class":79},"    println!",[67,874,201],{"class":83},[67,876,517],{"class":83},[67,878,879],{"class":83}," {}",[67,881,351],{"class":83},[67,883,345],{"class":344},[67,885,356],{"class":83},[67,887,359],{"class":83},[67,889,890],{"class":87}," log",[67,892,151],{"class":83},[67,894,895],{"class":87},"created_at",[67,897,359],{"class":83},[67,899,890],{"class":87},[67,901,151],{"class":83},[67,903,785],{"class":87},[67,905,359],{"class":83},[67,907,890],{"class":87},[67,909,151],{"class":83},[67,911,912],{"class":87},"error",[67,914,211],{"class":83},[67,916,917],{"class":69,"line":27},[67,918,919],{"class":83},"}\n",[921,922,923],"style",{},"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}",{"title":62,"searchDepth":17,"depth":17,"links":925},[926,927,928,929,930,931],{"id":51,"depth":17,"text":51},{"id":234,"depth":17,"text":234},{"id":380,"depth":17,"text":380},{"id":561,"depth":17,"text":561},{"id":656,"depth":17,"text":656},{"id":711,"depth":17,"text":711},"Balance, profile, payments and the webhook URL — client.user().","md",{},{"order":22},{"title":19,"description":932},"xe_BKt4QoHd37tUBBTl4wNWFbCVZQhbOsqePaDUMTQQ",[939,941],{"title":34,"path":35,"stem":36,"description":940,"order":37},"Test your integration offline with MockOnlineSim — no network, key or money.",{"title":29,"path":30,"stem":31,"description":942,"order":32},"Receive SMS as HTTP callbacks and parse them with parse_webhook.",1795164593581]