How to use removeResource method in devicefarmer-stf

Best JavaScript code snippet using devicefarmer-stf

Voice-v1.gs

Source:Voice-v1.gs Github

copy

Full Screen

1/**2* Google Apps Script Library for the voice-v1 API3* 4* Documentation can be found: 5* http://developers.google.com6* 7* OAuth2 Scopes8* https://www.googleapis.com/auth/googlevoice9*/10var BASEURL_="https://www.googleapis.com/voice/v1/";11var tokenService_;12/*13* Stores the function passed that is invoked to get a OAuth2 token;14* @param {function} service The function used to get the OAuth2 token;15*16*/17function setTokenService(service){18 tokenService_ = service;19}20/*21* Returns an OAuth2 token from your TokenService as a test22* @return {string} An OAuth2 token23*24*/25function testTokenService(){26 return tokenService_();27}28/**29 * Performs a Fetch30 * @param {string} url The endpoint for the URL with parameters31 * @param {Object.<string, string>} options Options to override default fetch options32 * @returns {Object.<string,string>} the fetch results33 * @private34 */35function CALL_(path,options){36 var fetchOptions = {method:"",muteHttpExceptions:true, contentType:"application/json", headers:{Authorization:"Bearer "+tokenService_()}}37 var url = BASEURL_ + path;38 39 for(option in options){40 fetchOptions[option] = options[option];41 }42 43 var response = UrlFetchApp.fetch(url, fetchOptions)44 if(response.getResponseCode() != 200){45 throw new Error(response.getContentText())46 }else{47 return JSON.parse(response.getContentText());48 }49}50/**51 * Performs a Fetch and accumulation using pageToken parameter of the returned results52 * @param {string} url The endpoint for the URL with parameters53 * @param {Object.<string, string>} options Options to override default fetch options54 * @param {string} returnParamPath The path of the parameter to be accumulated55 * @returns {Array.Object.<string,string>} An array of objects56 * @private57 */58function CALLPAGE_(path,options, returnParamPath){59 var fetchOptions = {method:"",muteHttpExceptions:true, contentType:"application/json", headers:{Authorization:"Bearer "+tokenService_()}}60 for(option in options){61 fetchOptions[option] = options[option];62 }63 var url = BASEURL_ + path; 64 var returnArray = [];65 var nextPageToken;66 do{67 if(nextPageToken){68 url = buildUrl_(url, {pageToken:nextPageToken});69 }70 var results = UrlFetchApp.fetch(url, fetchOptions);71 if(results.getResponseCode() != 200){72 throw new Error(results.getContentText());73 }else{74 var resp = JSON.parse(results.getContentText())75 nextPageToken = resp.nextPageToken;76 returnArray = returnArray.concat(resp[returnParamPath])77 }78 url = BASEURL_ + path;79 }while(nextPageToken);80 return returnArray;81}82/**83 * Builds a complete URL from a base URL and a map of URL parameters. Written by Eric Koleda in the OAuth2 library84 * @param {string} url The base URL.85 * @param {Object.<string, string>} params The URL parameters and values.86 * @returns {string} The complete URL.87 * @private88 */89function buildUrl_(url, params) {90 var params = params || {}; //allow for NULL options91 var paramString = Object.keys(params).map(function(key) {92 return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);93 }).join('&');94 return url + (url.indexOf('?') >= 0 ? '&' : '?') + paramString; 95}96/**97* Enables the user's account for calling.98*99* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.100* @param {object} options Keypair of all optional parameters for this call101* @return {object} The returned AccountResource object102*/103function accountsEnableCalling(userId,options){104 var path = buildUrl_("users/enableCalling/"+userId,options);105 var callOptions = {method:"POST"};106 var AccountResource = CALL_(path,callOptions);107 return AccountResource;108}109/**110* Get information about a user's account.111*112* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.113* @param {object} options Keypair of all optional parameters for this call114* @return {object} The returned AccountResource object115*/116function accountsGet(userId,options){117 var path = buildUrl_("users/"+userId+"/account",options);118 var callOptions = {method:"GET"};119 var AccountResource = CALL_(path,callOptions);120 return AccountResource;121}122/**123* Get information about a user's account.124*125* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.126* @param {object} AccountResource An object containing the AccountResource for this method127* @param {object} options Keypair of all optional parameters for this call128* @return {object} The returned AccountResource object129*/130function accountsGet_as_post(userId,AccountResource,options){131 var path = buildUrl_("users/"+userId+"/account",options);132 var callOptions = {method:"POST",payload:JSON.stringify(AccountResource)};133 var AccountResource = CALL_(path,callOptions);134 return AccountResource;135}136/**137* Cancel a click-to-call call.138*139* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.140* @param {string} clickToCallId ID of the call to cancel. The special value "@me_current" refers to the user's most recently started click-to-call.141* @param {object} options Keypair of all optional parameters for this call142*/143function clickToCallsDelete(userId,clickToCallId,options){144 var path = buildUrl_("users/"+userId+"/clickToCalls/"+clickToCallId,options);145 var callOptions = {method:"DELETE"};146 var removeResource = CALL_(path,callOptions);147 return removeResource;148}149/**150* Initiate a phone call with the click-to-call flow.151*152* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.153* @param {object} ClickToCallResource An object containing the ClickToCallResource for this method154* @param {object} options Keypair of all optional parameters for this call155* @return {object} The returned ClickToCallResource object156*/157function clickToCallsInsert(userId,ClickToCallResource,options){158 var path = buildUrl_("users/"+userId+"/clickToCalls",options);159 var callOptions = {method:"POST",payload:JSON.stringify(ClickToCallResource)};160 var ClickToCallResource = CALL_(path,callOptions);161 return ClickToCallResource;162}163/**164* List the user's conversations, ordered in reverse chronological order.165*166* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.167* @param {object} options Keypair of all optional parameters for this call168* @return {object} The returned ConversationListResource object169*/170function conversationsList(userId,options){171 var path = buildUrl_("users/"+userId+"/conversations",options);172 var callOptions = {method:"GET"};173 var ConversationListItems = CALLPAGE_(path,callOptions,"items");174 return ConversationListItems;175}176/**177* Begin to verify the user's possession of a forwarding phone.178*179* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.180* @param {string} phoneId String identifying the phone.181* @param {object} PhoneVerificationResource An object containing the PhoneVerificationResource for this method182* @param {object} options Keypair of all optional parameters for this call183* @return {object} The returned PhoneVerificationResource object184*/185function phoneVerificationsInsert(userId,phoneId,PhoneVerificationResource,options){186 var path = buildUrl_("users/"+userId+"/phones/"+phoneId+"/verifications",options);187 var callOptions = {method:"POST",payload:JSON.stringify(PhoneVerificationResource)};188 var PhoneVerificationResource = CALL_(path,callOptions);189 return PhoneVerificationResource;190}191/**192* Verify possession of a forwarding phone by reporting the verification code back to Google193*194* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.195* @param {string} phoneId String identifying the phone.196* @param {string} verificationId ID of the verification being completed.197* @param {object} PhoneVerificationResource An object containing the PhoneVerificationResource for this method198* @param {object} options Keypair of all optional parameters for this call199* @return {object} The returned PhoneVerificationResource object200*/201function phoneVerificationsUpdate(userId,phoneId,verificationId,PhoneVerificationResource,options){202 var path = buildUrl_("users/"+userId+"/phones/"+phoneId+"/verifications/"+verificationId,options);203 var callOptions = {method:"PUT",payload:JSON.stringify(PhoneVerificationResource)};204 var PhoneVerificationResource = CALL_(path,callOptions);205 return PhoneVerificationResource;206}207/**208* Get information about one of a user's forwarding phones.209*210* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.211* @param {string} phoneId String identifying the phone.212* @param {object} options Keypair of all optional parameters for this call213* @return {object} The returned PhoneResource object214*/215function phonesGet(userId,phoneId,options){216 var path = buildUrl_("users/"+userId+"/phones/"+phoneId,options);217 var callOptions = {method:"GET"};218 var PhoneResource = CALL_(path,callOptions);219 return PhoneResource;220}221/**222* Add a new forwarding phone to a user's account.223*224* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.225* @param {object} PhoneResource An object containing the PhoneResource for this method226* @param {object} options Keypair of all optional parameters for this call227* @return {object} The returned PhoneResource object228*/229function phonesInsert(userId,PhoneResource,options){230 var path = buildUrl_("users/"+userId+"/phones",options);231 var callOptions = {method:"POST",payload:JSON.stringify(PhoneResource)};232 var PhoneResource = CALL_(path,callOptions);233 return PhoneResource;234}235/**236* List the user's forwarding phones.237*238* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.239* @param {object} options Keypair of all optional parameters for this call240* @return {object} The returned PhoneListResource object241*/242function phonesList(userId,options){243 var path = buildUrl_("users/"+userId+"/phones",options);244 var callOptions = {method:"GET"};245 var PhoneListResource = CALL_(path,callOptions);246 return PhoneListResource;247}248/**249* Update a forwarding phone. Not all fields can be updated, that's specified by the field documentation. This method supports patch semantics.250*251* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.252* @param {string} phoneId String identifying the phone.253* @param {object} PhoneResource An object containing the PhoneResource for this method254* @param {object} options Keypair of all optional parameters for this call255* @return {object} The returned PhoneResource object256*/257function phonesPatch(userId,phoneId,PhoneResource,options){258 var path = buildUrl_("users/"+userId+"/phones/"+phoneId,options);259 var callOptions = {method:"PATCH",payload:JSON.stringify(PhoneResource)};260 var PhoneResource = CALL_(path,callOptions);261 return PhoneResource;262}263/**264* Update a forwarding phone. Not all fields can be updated, that's specified by the field documentation.265*266* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.267* @param {string} phoneId String identifying the phone.268* @param {object} PhoneResource An object containing the PhoneResource for this method269* @param {object} options Keypair of all optional parameters for this call270* @return {object} The returned PhoneResource object271*/272function phonesUpdate(userId,phoneId,PhoneResource,options){273 var path = buildUrl_("users/"+userId+"/phones/"+phoneId,options);274 var callOptions = {method:"PUT",payload:JSON.stringify(PhoneResource)};275 var PhoneResource = CALL_(path,callOptions);276 return PhoneResource;277}278/**279* Get a proxy number to place a call from one of the user's forwarding phones or applicable verified phone number. The retrieved number specifies the proxy number to call for a specific destination in order to be placed using the caller's preferred Google Voice number or verified phone number as caller ID. The retrieved number should not be used past the expiration time returned in the response.280*281* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.282* @param {string} forwardingPhoneNumber String identifying the number of the user's forwarding phone that will place the call to the proxy number.283* @param {string} phoneNumber String identifying the phone number of the remote party. The first character is a + symbol, and the rest of the string are numeric digits representing a phone number in E.164 format, starting with a country code. For example, the U.S. phone number (650)253-0000 is represented by the string "+16502530000"284* @param {object} options Keypair of all optional parameters for this call285*/286function proxyNumbersGet(userId,forwardingPhoneNumber,phoneNumber,options){287 var path = buildUrl_("users/"+userId+"/phones/"+forwardingPhoneNumber+"/proxyNumbers/"+phoneNumber,options);288 var callOptions = {method:"GET"};289 var removeResource = CALL_(path,callOptions);290 return removeResource;291}292/**293* Lists the proxy numbers intended for a user's forwarding phone. The retrieved numbers should not be used past the expiration time returned in the response.294*295* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.296* @param {string} forwardingPhoneNumber String identifying the number of the user's forwarding phone that will place the call to the proxy number.297* @param {object} options Keypair of all optional parameters for this call298*/299function proxyNumbersList(userId,forwardingPhoneNumber,options){300 var path = buildUrl_("users/"+userId+"/phones/"+forwardingPhoneNumber+"/proxyNumbers",options);301 var callOptions = {method:"GET"};302 var removeResource = CALL_(path,callOptions);303 return removeResource;304}305/**306* Get information about a rate.307*308* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.309* @param {string} phoneNumber String representing the destination phone number in E.164 format starting with a '+'.310* @param {object} options Keypair of all optional parameters for this call311* @return {object} The returned RateResource object312*/313function ratesGet(userId,phoneNumber,options){314 var path = buildUrl_("users/"+userId+"/destinations/"+phoneNumber+"/rate",options);315 var callOptions = {method:"GET"};316 var RateResource = CALL_(path,callOptions);317 return RateResource;318}319/**320* Retrieve a recording message.321*322* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.323* @param {string} recordingId String identifying the recording.324* @param {object} options Keypair of all optional parameters for this call325* @return {object} The returned RecordingResource object326*/327function recordingsGet(userId,recordingId,options){328 var path = buildUrl_("users/"+userId+"/recordings/"+recordingId,options);329 var callOptions = {method:"GET"};330 var RecordingResource = CALL_(path,callOptions);331 return RecordingResource;332}333/**334* Send a text message.335*336* @param {string} userId String identifying the Google Voice user. The special string '@me' identifies the authenticated user.337* @param {object} TextMessageResource An object containing the TextMessageResource for this method338* @param {object} options Keypair of all optional parameters for this call339* @return {object} The returned TextMessageResource object340*/341function textsInsert(userId,TextMessageResource,options){342 var path = buildUrl_("users/"+userId+"/texts",options);343 var callOptions = {method:"POST",payload:JSON.stringify(TextMessageResource)};344 var TextMessageResource = CALL_(path,callOptions);345 return TextMessageResource;346}347/**348* Add account phone to user's account.349*350* @param {object} options Keypair of all optional parameters for this call351*/352function voice_clientAddAccountPhone(options){353 var path = buildUrl_("voiceclient/account/accountphone/add",options);354 var callOptions = {method:"POST"};355 var removeResource = CALL_(path,callOptions);356 return removeResource;357}358/**359* Allocates a new handoff number for a client. If a handoff number already exists for the specified handoff_key, a new number will be allocated.360*361* @param {object} options Keypair of all optional parameters for this call362*/363function voice_clientAddHandoffNumber(options){364 var path = buildUrl_("handoffnumbers/add",options);365 var callOptions = {method:"POST"};366 var removeResource = CALL_(path,callOptions);367 return removeResource;368}369/**370* Gets a thread.371*372* @param {object} options Keypair of all optional parameters for this call373*/374function voice_clientApi2GetThread(options){375 var path = buildUrl_("voiceclient/api2thread/get",options);376 var callOptions = {method:"POST"};377 var removeResource = CALL_(path,callOptions);378 return removeResource;379}380/**381* Lists threads.382*383* @param {object} options Keypair of all optional parameters for this call384*/385function voice_clientApi2ListThreads(options){386 var path = buildUrl_("voiceclient/api2thread/list",options);387 var callOptions = {method:"POST"};388 var removeResource = CALL_(path,callOptions);389 return removeResource;390}391/**392* Device registeration for notifications.393*394* @param {object} options Keypair of all optional parameters for this call395*/396function voice_clientApi2RegisterDestination(options){397 var path = buildUrl_("voiceclient/api2notifications/registerdestination",options);398 var callOptions = {method:"POST"};399 var removeResource = CALL_(path,callOptions);400 return removeResource;401}402/**403* Thread based search.404*405* @param {object} options Keypair of all optional parameters for this call406*/407function voice_clientApi2SearchThreads(options){408 var path = buildUrl_("voiceclient/api2thread/search",options);409 var callOptions = {method:"POST"};410 var removeResource = CALL_(path,callOptions);411 return removeResource;412}413/**414* Thread based search.415*416* @param {object} options Keypair of all optional parameters for this call417*/418function voice_clientApi2SendSms(options){419 var path = buildUrl_("voiceclient/api2thread/sendsms",options);420 var callOptions = {method:"POST"};421 var removeResource = CALL_(path,callOptions);422 return removeResource;423}424/**425* Device unregisteration for notifications.426*427* @param {object} options Keypair of all optional parameters for this call428*/429function voice_clientApi2UnregisterDestination(options){430 var path = buildUrl_("voiceclient/api2notifications/unregisterdestination",options);431 var callOptions = {method:"POST"};432 var removeResource = CALL_(path,callOptions);433 return removeResource;434}435/**436* Permanently deletes specified thread.437*438* @param {object} options Keypair of all optional parameters for this call439*/440function voice_clientBatchDeleteThread(options){441 var path = buildUrl_("voiceclient/thread/batchdelete",options);442 var callOptions = {method:"POST"};443 var removeResource = CALL_(path,callOptions);444 return removeResource;445}446/**447* Permanently deletes specified thread items.448*449* @param {object} options Keypair of all optional parameters for this call450*/451function voice_clientBatchDeleteThreadItem(options){452 var path = buildUrl_("voiceclient/threaditem/batchdelete",options);453 var callOptions = {method:"POST"};454 var removeResource = CALL_(path,callOptions);455 return removeResource;456}457/**458* Updates conversation attributes.459*460* @param {object} options Keypair of all optional parameters for this call461*/462function voice_clientBatchUpdateConversationAttributes(options){463 var path = buildUrl_("voiceclient/conversationattributes/batchupdate",options);464 var callOptions = {method:"POST"};465 var removeResource = CALL_(path,callOptions);466 return removeResource;467}468/**469* Updates conversation attributes.470*471* @param {object} options Keypair of all optional parameters for this call472*/473function voice_clientBatchUpdateThreadAttributes(options){474 var path = buildUrl_("voiceclient/thread/batchupdateattributes",options);475 var callOptions = {method:"POST"};476 var removeResource = CALL_(path,callOptions);477 return removeResource;478}479/**480* Create new user account.481*482* @param {object} options Keypair of all optional parameters for this call483*/484function voice_clientCreateAccount(options){485 var path = buildUrl_("voiceclient/account/create",options);486 var callOptions = {method:"POST"};487 var removeResource = CALL_(path,callOptions);488 return removeResource;489}490/**491* Deletes a blocked number.492*493* @param {object} options Keypair of all optional parameters for this call494*/495function voice_clientDeleteBlockedNumber(options){496 var path = buildUrl_("voiceclient/blockednumbers/delete",options);497 var callOptions = {method:"POST"};498 var removeResource = CALL_(path,callOptions);499 return removeResource;500}501/**502* Permanently deletes conversation(s) specified.503*504* @param {object} options Keypair of all optional parameters for this call505*/506function voice_clientDeleteConversation(options){507 var path = buildUrl_("voiceclient/conversation/delete",options);508 var callOptions = {method:"POST"};509 var removeResource = CALL_(path,callOptions);510 return removeResource;511}512/**513* Deallocates a handoff number514*515* @param {object} options Keypair of all optional parameters for this call516*/517function voice_clientDeleteHandoffNumber(options){518 var path = buildUrl_("handoffnumbers/delete",options);519 var callOptions = {method:"POST"};520 var removeResource = CALL_(path,callOptions);521 return removeResource;522}523/**524* Permanently deletes specified thread.525*526* @param {object} options Keypair of all optional parameters for this call527*/528function voice_clientDeleteThread(options){529 var path = buildUrl_("voiceclient/thread/delete",options);530 var callOptions = {method:"POST"};531 var removeResource = CALL_(path,callOptions);532 return removeResource;533}534/**535* Permanently deletes specified thread item.536*537* @param {object} options Keypair of all optional parameters for this call538*/539function voice_clientDeleteThreadItem(options){540 var path = buildUrl_("voiceclient/threaditem/delete",options);541 var callOptions = {method:"POST"};542 var removeResource = CALL_(path,callOptions);543 return removeResource;544}545/**546* Gets the encrypted parameter string for a product purchase.547*548* @param {object} options Keypair of all optional parameters for this call549*/550function voice_clientEncryptBuyFlowParameters(options){551 var path = buildUrl_("voiceclient/billing/encryptbuyflowparameters",options);552 var callOptions = {method:"POST"};553 var removeResource = CALL_(path,callOptions);554 return removeResource;555}556/**557* Get information about a user's account.558*559* @param {object} options Keypair of all optional parameters for this call560*/561function voice_clientGetAccount(options){562 var path = buildUrl_("voiceclient/account/get",options);563 var callOptions = {method:"POST"};564 var removeResource = CALL_(path,callOptions);565 return removeResource;566}567/**568* Gets the rate to call a given phone number.569*570* @param {object} options Keypair of all optional parameters for this call571*/572function voice_clientGetBillingRate(options){573 var path = buildUrl_("voiceclient/billing/billingrate/get",options);574 var callOptions = {method:"POST"};575 var removeResource = CALL_(path,callOptions);576 return removeResource;577}578/**579* Gets client access permission.580*581* @param {object} options Keypair of all optional parameters for this call582*/583function voice_clientGetClientAccessPermission(options){584 var path = buildUrl_("voiceclient/clientaccesspermission/get",options);585 var callOptions = {method:"POST"};586 var removeResource = CALL_(path,callOptions);587 return removeResource;588}589/**590* Gets high-level information about user's messages.591*592* @param {object} options Keypair of all optional parameters for this call593*/594function voice_clientGetMessagingInfo(options){595 var path = buildUrl_("voiceclient/messaginginfo/get",options);596 var callOptions = {method:"POST"};597 var removeResource = CALL_(path,callOptions);598 return removeResource;599}600/**601* Get MMS attachments.602*603* @param {object} options Keypair of all optional parameters for this call604*/605function voice_clientGetMmsAttachment(options){606 var path = buildUrl_("voiceclient/attachments/get",options);607 var callOptions = {method:"POST"};608 var removeResource = CALL_(path,callOptions);609 return removeResource;610}611/**612* Returns a list of calling rates for different destinations.613*614* @param {object} options Keypair of all optional parameters for this call615*/616function voice_clientGetRateTable(options){617 var path = buildUrl_("voiceclient/billing/ratetable/get",options);618 var callOptions = {method:"POST"};619 var removeResource = CALL_(path,callOptions);620 return removeResource;621}622/**623* Gets a recording from the server.624*625* @param {object} options Keypair of all optional parameters for this call626*/627function voice_clientGetRecording(options){628 var path = buildUrl_("voiceclient/recordings/get",options);629 var callOptions = {method:"POST"};630 var removeResource = CALL_(path,callOptions);631 return removeResource;632}633/**634* Gets system message.635*636* @param {object} options Keypair of all optional parameters for this call637*/638function voice_clientGetSystemMessage(options){639 var path = buildUrl_("voiceclient/systemmessage/get",options);640 var callOptions = {method:"POST"};641 var removeResource = CALL_(path,callOptions);642 return removeResource;643}644/**645* Gets high-level information about user's threads.646*647* @param {object} options Keypair of all optional parameters for this call648*/649function voice_clientGetThreadingInfo(options){650 var path = buildUrl_("voiceclient/threadinginfo/get",options);651 var callOptions = {method:"POST"};652 var removeResource = CALL_(path,callOptions);653 return removeResource;654}655/**656* Inserts a blocked number.657*658* @param {object} options Keypair of all optional parameters for this call659*/660function voice_clientInsertBlockedNumber(options){661 var path = buildUrl_("voiceclient/blockednumbers/insert",options);662 var callOptions = {method:"POST"};663 var removeResource = CALL_(path,callOptions);664 return removeResource;665}666/**667* Lists the transactions.668*669* @param {object} options Keypair of all optional parameters for this call670*/671function voice_clientListBillingTransactions(options){672 var path = buildUrl_("voiceclient/billing/transaction/list",options);673 var callOptions = {method:"POST"};674 var removeResource = CALL_(path,callOptions);675 return removeResource;676}677/**678* Lists blocked numbers.679*680* @param {object} options Keypair of all optional parameters for this call681*/682function voice_clientListBlockedNumbers(options){683 var path = buildUrl_("voiceclient/blockednumbers/list",options);684 var callOptions = {method:"POST"};685 var removeResource = CALL_(path,callOptions);686 return removeResource;687}688/**689* Returns a list of countries with special billing rules.690*691* @param {object} options Keypair of all optional parameters for this call692*/693function voice_clientListSpecialRulesBillingCountries(options){694 var path = buildUrl_("voiceclient/billing/specialrulesbillingcountries/list",options);695 var callOptions = {method:"POST"};696 var removeResource = CALL_(path,callOptions);697 return removeResource;698}699/**700* Marks all user's threads as read.701*702* @param {object} options Keypair of all optional parameters for this call703*/704function voice_clientMarkAllThreadsRead(options){705 var path = buildUrl_("voiceclient/thread/markallread",options);706 var callOptions = {method:"POST"};707 var removeResource = CALL_(path,callOptions);708 return removeResource;709}710/**711* Determine the next step required to configure a user's account.712*713* @param {object} options Keypair of all optional parameters for this call714*/715function voice_clientOnboardUser(options){716 var path = buildUrl_("voiceclient/onboarding/onboarduser",options);717 var callOptions = {method:"POST"};718 var removeResource = CALL_(path,callOptions);719 return removeResource;720}721/**722* Refunds a call.723*724* @param {object} options Keypair of all optional parameters for this call725*/726function voice_clientRefundCall(options){727 var path = buildUrl_("voiceclient/billing/refundcall",options);728 var callOptions = {method:"POST"};729 var removeResource = CALL_(path,callOptions);730 return removeResource;731}732/**733* Re-reserves the proxy numbers intended for a user's forwarding phone. The retrieved numbers should not be used past the expiration time returned in the response.734*735* @param {object} options Keypair of all optional parameters for this call736*/737function voice_clientRereserveAllProxyNumbers(options){738 var path = buildUrl_("voiceclient/proxynumbers/rereserveall",options);739 var callOptions = {method:"POST"};740 var removeResource = CALL_(path,callOptions);741 return removeResource;742}743/**744* Reserve a proxy number to place a call from one of the user's forwarding phones or applicable verified phone number. The retrieved number specifies the proxy number to call for a specific destination in order to be placed using the caller's preferred Google Voice number or verified phone number as caller ID. The retrieved number should not be used past the expiration time returned in the response.745*746* @param {object} options Keypair of all optional parameters for this call747*/748function voice_clientReserveProxyNumber(options){749 var path = buildUrl_("proxynumbers/reserve",options);750 var callOptions = {method:"POST"};751 var removeResource = CALL_(path,callOptions);752 return removeResource;753}754/**755* Search for available account phone.756*757* @param {object} options Keypair of all optional parameters for this call758*/759function voice_clientSearchAccountPhoneCandidates(options){760 var path = buildUrl_("voiceclient/accountphonecandidate/search",options);761 var callOptions = {method:"POST"};762 var removeResource = CALL_(path,callOptions);763 return removeResource;764}765/**766* Searches available Google Voice phone numbers (by providing search criteria) to assign to an account.767*768* @param {object} options Keypair of all optional parameters for this call769*/770function voice_clientSearchAvailableGvNumbers(options){771 var path = buildUrl_("setup/availablegvnumbers/search",options);772 var callOptions = {method:"POST"};773 var removeResource = CALL_(path,callOptions);774 return removeResource;775}776/**777* Starts click-to-call flow.778*779* @param {object} options Keypair of all optional parameters for this call780*/781function voice_clientStartClickToCall(options){782 var path = buildUrl_("voiceclient/communication/startclicktocall",options);783 var callOptions = {method:"POST"};784 var removeResource = CALL_(path,callOptions);785 return removeResource;786}787/**788* Starts a verification challenge. Client will receive a code that should be sent to the server in a subsequent VerifyPhone request.789*790* @param {object} options Keypair of all optional parameters for this call791*/792function voice_clientStartVerificationChallenge(options){793 var path = buildUrl_("voiceclient/phoneverification/startchallenge",options);794 var callOptions = {method:"POST"};795 var removeResource = CALL_(path,callOptions);796 return removeResource;797}798/**799* Update information about a user's account.800*801* @param {object} options Keypair of all optional parameters for this call802*/803function voice_clientUpdateAccount(options){804 var path = buildUrl_("voiceclient/account/update",options);805 var callOptions = {method:"POST"};806 var removeResource = CALL_(path,callOptions);807 return removeResource;808}809/**810* Updates conversation attributes.811*812* @param {object} options Keypair of all optional parameters for this call813*/814function voice_clientUpdateConversationAttributes(options){815 var path = buildUrl_("voiceclient/conversationattributes/update",options);816 var callOptions = {method:"POST"};817 var removeResource = CALL_(path,callOptions);818 return removeResource;819}820/**821* Modifies properties of an existing handoff number mapping, e.g. phone number, contact address and client data822*823* @param {object} options Keypair of all optional parameters for this call824*/825function voice_clientUpdateHandoffNumber(options){826 var path = buildUrl_("handoffnumbers/update",options);827 var callOptions = {method:"POST"};828 var removeResource = CALL_(path,callOptions);829 return removeResource;830}831/**832* Updates conversation attributes.833*834* @param {object} options Keypair of all optional parameters for this call835*/836function voice_clientUpdateThreadAttributes(options){837 var path = buildUrl_("voiceclient/thread/updateattributes",options);838 var callOptions = {method:"POST"};839 var removeResource = CALL_(path,callOptions);840 return removeResource;841}842/**843* Determines if an emergency address is a valid address.844*845* @param {object} options Keypair of all optional parameters for this call846*/847function voice_clientVerifyEmergencyAddress(options){848 var path = buildUrl_("voiceclient/emergencyaddress/verifyemergencyaddress",options);849 var callOptions = {method:"POST"};850 var removeResource = CALL_(path,callOptions);851 return removeResource;852}853/**854* Verifies the phone for the user. If the phone is not already associated with the user's account, adds it to the user's account.855*856* @param {object} options Keypair of all optional parameters for this call857*/858function voice_clientVerifyPhone(options){859 var path = buildUrl_("voiceclient/phoneverification/verify",options);860 var callOptions = {method:"POST"};861 var removeResource = CALL_(path,callOptions);862 return removeResource;...

Full Screen

Full Screen

EditResourcesPage.js

Source:EditResourcesPage.js Github

copy

Full Screen

...32 removeResource (resource) {33 const { event } = this.props34 if (event) {35 // we only have one tier right now36 this.props.dispatch(removeResource(event.slug, resource.resourceId, event.tiers[0].tierId))37 }38 }39 onSubmit (formData) {40 const { form, event } = this.props41 if (form && event && event.slug) {42 const mappedData = eventFormMapper.resourcesToApi(formData, form, event.slug)43 this.props.dispatch(updateEvent(mappedData, event.slug))44 }45 }46 onCancel () {47 this.props.dispatch(push(`/events/${this.props.event.slug}`))48 }49 render () {50 const { event, resourceTypes } = this.props...

Full Screen

Full Screen

remove.test.ts

Source:remove.test.ts Github

copy

Full Screen

1import { $TSContext } from 'amplify-cli-core';2import { run } from '../../commands/storage/remove';3import * as providerController from '../../provider-utils/awscloudformation/index';4jest.mock('../../provider-utils/awscloudformation/index');5jest.mock('amplify-cli-core');6const providerController_mock = providerController as jest.Mocked<typeof providerController>;7providerController_mock.updateResource.mockImplementation = jest.fn().mockImplementation(async () => {8 return 'mockResourceName';9});10describe('remove ddb command tests', () => {11 let mockContext: $TSContext;12 beforeEach(() => {13 jest.clearAllMocks();14 mockContext = {15 amplify: {},16 parameters: {},17 } as unknown as $TSContext;18 });19 it('update resource workflow is invoked for DDB with no params', async () => {20 mockContext.amplify.removeResource = jest.fn().mockImplementation(async () => {21 return;22 });23 await run(mockContext);24 expect(mockContext.amplify.removeResource).toHaveBeenCalledWith(mockContext, 'storage', undefined);25 });26 it('update resource workflow is invoked for DDB with params as resourceName', async () => {27 const mockResourceName = 'mockResourceName';28 mockContext.parameters.first = mockResourceName;29 mockContext.amplify.removeResource = jest.fn().mockImplementation(async () => {30 return;31 });32 await run(mockContext);33 expect(mockContext.amplify.removeResource).toHaveBeenCalledWith(mockContext, 'storage', mockResourceName);34 });35});36describe('remove s3 command tests', () => {37 let mockContext: $TSContext;38 beforeEach(() => {39 jest.clearAllMocks();40 mockContext = {41 amplify: {},42 parameters: {},43 } as unknown as $TSContext;44 });45 it('update resource workflow is invoked for s3 with no params', async () => {46 mockContext.amplify.removeResource = jest.fn().mockImplementation(async () => {47 return;48 });49 await run(mockContext);50 expect(mockContext.amplify.removeResource).toHaveBeenCalledWith(mockContext, 'storage', undefined);51 });52 it('update resource workflow is invoked for s3 with params as resourceName', async () => {53 const mockResourceName = 'mockResourceName';54 mockContext.parameters.first = mockResourceName;55 mockContext.amplify.removeResource = jest.fn().mockImplementation(async () => {56 return;57 });58 await run(mockContext);59 expect(mockContext.amplify.removeResource).toHaveBeenCalledWith(mockContext, 'storage', mockResourceName);60 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var stf = require('devicefarmer-stf');2stfObj.removeResource('resourceId').then(function(data){3 console.log(data);4});5var stf = require('devicefarmer-stf');6stfObj.removeResource('resourceId').then(function(data){7 console.log(data);8});9var stf = require('devicefarmer-stf');10stfObj.removeResource('resourceId').then(function(data){11 console.log(data);12});13var stf = require('devicefarmer-stf');14stfObj.removeResource('resourceId').then(function(data){15 console.log(data);16});17var stf = require('devicefarmer-stf');18stfObj.removeResource('resourceId').then(function(data){19 console.log(data);20});21var stf = require('devicefarmer-stf');22stfObj.removeResource('resourceId').then(function(data){23 console.log(data);24});

Full Screen

Using AI Code Generation

copy

Full Screen

1var stf = require('devicefarmer-stf');2stf.removeResource('123456789',function(err,data){3 if(err){4 console.log(err);5 }else{6 console.log(data);7 }8});9var stf = require('devicefarmer-stf');10stf.<method_name>(<parameters>,function(err,data){});11var stf = require('devicefarmer-stf');12stf.<method_name>(<parameters>,function(err,data){});

Full Screen

Using AI Code Generation

copy

Full Screen

1var stf = require('devicefarmer-stf-client');2var stf = require('devicefarmer-stf-client');3var stf = require('devicefarmer-stf-client');4var stf = require('devicefarmer-stf-client');5var stf = require('devicefarmer-stf-client');6var stf = require('devicefarmer-stf-client');7var stf = require('devicefarmer-stf-client');8var stf = require('devicefarmer-stf-client');

Full Screen

Using AI Code Generation

copy

Full Screen

1var stf = require('devicefarmer-stf-client');2 if(err) {3 console.log('Error: ' + err);4 }5 else {6 console.log('Result: ' + result);7 }8});9var stf = require('devicefarmer-stf-client');10 if(err) {11 console.log('Error: ' + err);12 }13 else {14 console.log('Result: ' + result);15 }16});17var stf = require('devicefarmer-stf-client');18 if(err) {19 console.log('Error: ' + err);20 }21 else {22 console.log('Result: ' + result);23 }24});25var stf = require('devicefarmer-stf-client');26 if(err) {27 console.log('Error: ' + err);28 }29 else {30 console.log('Result: ' + result);31 }32});33var stf = require('devicefarmer-stf-client');34 if(err) {35 console.log('Error:

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run devicefarmer-stf automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful