From 7f89cb181ca3a8ffa401cb99163eba3b92f7abfd Mon Sep 17 00:00:00 2001 From: JoshuaLai <9044372+JoshuaLai@users.noreply.github.com> Date: Fri, 22 Jan 2021 15:33:40 -0500 Subject: [PATCH] [Communication] - Authentication - PhoneNumberAdministrationClient auth using token credential (#13271) * [phoneNumberAdminstrationClient] adding new constructor for phone number to use Token Credential * [Conflict] taking incoming recordings * [Recording] Update the query to be true * [README] update the examples and changelog * [phoneNumberAdministrationClientWithToken.spec] renmae the test to be more relevant * [recordedClient] using new common function to create endpoint * [recordedClient] removing unused COMMUNICATION_ENDPOINT * [tests.yml] adding the new env vars --- .../communication-administration/CHANGELOG.md | 1 + .../communication-administration/README.md | 21 +- .../karma.conf.js | 4 +- ...ng_successfully_gets_phoneplangroupid.json | 35 + .../recording_successfully_creates_a_user.js | 50 +- .../recording_successfully_deletes_a_user.js | 40 +- ...sues_a_token_for_a_user_multiple_scopes.js | 54 +- ..._issues_a_token_for_a_user_single_scope.js | 54 +- ...sfully_revokes_tokens_issued_for_a_user.js | 40 +- ...sues_a_token_for_a_user_multiple_scopes.js | 176 ++-- ..._issues_a_token_for_a_user_single_scope.js | 176 ++-- .../recording_can_get_area_codes.js | 45 +- .../recording_can_get_location_options.js | 770 +----------------- ...groupid_and_phoneplanid_for_other_tests.js | 124 +-- ...ding_successfully_gets_phoneplangroupid.js | 58 ++ .../communication-administration.api.md | 1 + .../phoneNumberAdministrationClient.ts | 22 +- ...umberAdministrationClientWithToken.spec.ts | 46 ++ .../test/utils/recordedClient.ts | 46 +- .../communication-administration/tests.yml | 4 + 20 files changed, 576 insertions(+), 1191 deletions(-) create mode 100644 sdk/communication/communication-administration/recordings/browsers/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.json create mode 100644 sdk/communication/communication-administration/recordings/node/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.js create mode 100644 sdk/communication/communication-administration/test/phoneNumberAdministrationClientWithToken.spec.ts diff --git a/sdk/communication/communication-administration/CHANGELOG.md b/sdk/communication/communication-administration/CHANGELOG.md index dbce7c41d098..e1d6fc30a0b9 100644 --- a/sdk/communication/communication-administration/CHANGELOG.md +++ b/sdk/communication/communication-administration/CHANGELOG.md @@ -14,6 +14,7 @@ ### Added - `CommunicationIdentityClient` added a constructor that supports `TokenCredential`. +- `PhoneNumberAdministrationClient` added a constructor that supports `TokenCredential`. ## 1.0.0-beta.3 (2020-11-16) diff --git a/sdk/communication/communication-administration/README.md b/sdk/communication/communication-administration/README.md index 8b2728f3aafc..3e73ee9bd18f 100644 --- a/sdk/communication/communication-administration/README.md +++ b/sdk/communication/communication-administration/README.md @@ -56,18 +56,19 @@ const client = new CommunicationIdentityClient(HOST, credential); ### Using a connection string ```typescript -import { PhoneNumberAdministrationClient } from "@azure/communication-administration"; +import { CommunicationIdentityClient } from "@azure/communication-administration"; const connectionString = `endpoint=HOST;accessKey=KEY`; const client = new CommunicationIdentityClient(connectionString); ``` -### Using a `TokenCredential` +### Using Azure Active Directory Authentication ```typescript import { CommunicationIdentityClient } from "@azure/communication-administration"; +import { DefaultAzureCredential } from "@azure/identity"; -let credential = new DefaultAzureCredential(); +const credential = new DefaultAzureCredential(); const client = new CommunicationIdentityClient(HOST, credential); ``` @@ -134,9 +135,19 @@ await client.deleteUser(user); #### Creating an instance of PhoneNumberAdministrationClient ```typescript -import { CommunicationIdentityClient } from "@azure/communication-administration"; +import { PhoneNumberAdministrationClient } from "@azure/communication-administration"; -const client = new CommunicationIdentityClient(CONNECTION_STRING); +const client = new PhoneNumberAdministrationClient(CONNECTION_STRING); +``` + +#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication + +```typescript +import { PhoneNumberAdministrationClient } from "@azure/communication-administration"; +import { DefaultAzureCredential } from "@azure/identity"; + +const credential = new DefaultAzureCredential(); +const client = new PhoneNumberAdministrationClient(HOST, credential); ``` #### Getting countries diff --git a/sdk/communication/communication-administration/karma.conf.js b/sdk/communication/communication-administration/karma.conf.js index acf7be7b0162..ef2e157f2bc9 100644 --- a/sdk/communication/communication-administration/karma.conf.js +++ b/sdk/communication/communication-administration/karma.conf.js @@ -60,10 +60,10 @@ module.exports = function(config) { "TEST_MODE", "COMMUNICATION_CONNECTION_STRING", "INCLUDE_PHONENUMBER_TESTS", - "COMMUNICATION_ENDPOINT", "AZURE_CLIENT_ID", "AZURE_CLIENT_SECRET", - "AZURE_TENANT_ID" + "AZURE_TENANT_ID", + "AZURE_PHONE_NUMBER" ], // test results reporter to use diff --git a/sdk/communication/communication-administration/recordings/browsers/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.json b/sdk/communication/communication-administration/recordings/browsers/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.json new file mode 100644 index 000000000000..a34792490fa7 --- /dev/null +++ b/sdk/communication/communication-administration/recordings/browsers/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.json @@ -0,0 +1,35 @@ +{ + "recordings": [ + { + "method": "POST", + "url": "https://endpoint/SomeTenantId/oauth2/v2.0/token", + "query": {}, + "requestBody": "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default", + "status": 200, + "response": "", + "responseHeaders": { + "content-type": "application/json" + } + }, + { + "method": "GET", + "url": "https://endpoint/administration/phonenumbers/countries/US/phoneplangroups", + "query": { + "locale": "en-US", + "take": "100", + "api-version": "2020-07-20-preview1" + }, + "requestBody": null, + "status": 200, + "response": "{\"phonePlanGroups\":[{\"phonePlanGroupId\":\"sanitized\",\"phoneNumberType\":\"Geographic\",\"localizedName\":\"Azure- User - Geographic\",\"localizedDescription\":\"These are numbers used by Azure resources.\"},{\"phonePlanGroupId\":\"sanitized\",\"phoneNumberType\":\"Geographic\",\"localizedName\":\"Azure - Geographic\",\"localizedDescription\":\"These are numbers used by Azure resources.\"},{\"phonePlanGroupId\":\"sanitized\",\"phoneNumberType\":\"TollFree\",\"localizedName\":\"Azure - Toll Free\",\"localizedDescription\":\"These are toll free numbers used by Azure resources.\"}],\"nextLink\":null}", + "responseHeaders": { + "content-type": "application/json; charset=utf-8" + } + } + ], + "uniqueTestInfo": { + "uniqueName": {}, + "newDate": {} + }, + "hash": "1cb763e7c4b9a3c4811c4560af6827c2" +} diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js index 20da33b1f417..ef83f7168adb 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js +++ b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js @@ -1,29 +1,29 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "141d38a7c6c025995e00a993b7bd7123"; +module.exports.hash = "71dd63e8f90b2c2eb44bc15618466368"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .post("/identities") +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/identities') .query(true) - .reply(200, { id: "sanitized" }, [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "Zt+qNElMeUKoYC+f1DVN8w.0", - "Strict-Transport-Security", - "max-age=2592000", - "x-ms-client-request-id", - "sanitized", - "api-supported-versions", - "2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2", - "X-Processing-Time", - "20ms", - "X-Azure-Ref", - "0sIy4XwAAAAALsSkzglsHRbxDsIly3yizWVZSMzBFREdFMDQxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Sat, 21 Nov 2020 03:42:39 GMT" - ]); + .reply(200, {"id":"sanitized"}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'MS-CV', + 'E+IzX1is4EqUAcOqMeE55g.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'sanitized', + 'api-supported-versions', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', + 'X-Processing-Time', + '207ms', + 'X-Azure-Ref', + '0WOUFYAAAAAAE5FyAC49xSJmRvP7Ah1HLRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Mon, 18 Jan 2021 19:45:28 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js index 90718e191dde..a3669e86732c 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js +++ b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js @@ -1,25 +1,25 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "a5a7976959cc0ccb2a28a4d3560f4591"; +module.exports.hash = "c32f7ebc5af64d902e3e080cc228e00f"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .delete("/identities/sanitized") +nock('https://endpoint', {"encodedQueryParams":false}) + .delete('/identities/sanitized') .query(true) .reply(204, "", [ - "MS-CV", - "XQH4ADN+aUWXm9k8SuQmTw.0", - "Strict-Transport-Security", - "max-age=2592000", - "x-ms-client-request-id", - "sanitized", - "api-supported-versions", - "2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2", - "X-Processing-Time", - "723ms", - "X-Azure-Ref", - "0soy4XwAAAACvPq4nWF6pR73m05T+mn6vWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Sat, 21 Nov 2020 03:42:42 GMT" - ]); + 'MS-CV', + 'RJ69d+okxUmVuM8XH9j/kg.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'sanitized', + 'api-supported-versions', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', + 'X-Processing-Time', + '602ms', + 'X-Azure-Ref', + '0WuUFYAAAAAD8nD9qfs74Q4ajt0Yafib2RVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Mon, 18 Jan 2021 19:45:31 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js index 833e1fdb5185..5bd63856018e 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js +++ b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js @@ -1,33 +1,29 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "9f184b58b9aadf99fab223c92de66de8"; +module.exports.hash = "f30fde667c7b7a14ab32826e4d83a221"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .post("/identities/sanitized/token", { scopes: ["chat", "pstn"] }) +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/identities/sanitized/token', {"scopes":["chat","pstn"]}) .query(true) - .reply( - 200, - { id: "sanitized", token: "sanitized", expiresOn: "2020-11-22T03:42:40.2654927+00:00" }, - [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "FrpJvazFq0Gg0Fa5MxdhaQ.0", - "Strict-Transport-Security", - "max-age=2592000", - "x-ms-client-request-id", - "sanitized", - "api-supported-versions", - "2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2", - "X-Processing-Time", - "26ms", - "X-Azure-Ref", - "0sYy4XwAAAACgaE9HHDmaRZDa/S+EL6NhWVZSMzBFREdFMDMxNAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Sat, 21 Nov 2020 03:42:40 GMT" - ] - ); + .reply(200, {"id":"sanitized","token":"sanitized","expiresOn":"2021-01-19T19:45:28.6827919+00:00"}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'MS-CV', + 'Bsgix1tj/0mOdTRhDCdtvA.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'sanitized', + 'api-supported-versions', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', + 'X-Processing-Time', + '274ms', + 'X-Azure-Ref', + '0WeUFYAAAAAB1X99Q6T2UT6sZb4Ndxi7SRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Mon, 18 Jan 2021 19:45:29 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js index 12eda25e4a88..1bc5a5842d33 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js +++ b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js @@ -1,33 +1,29 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "78fab66978e4b347f8a42dfe6862533f"; +module.exports.hash = "1c880cc35f2f3b240445a35a012e7bab"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .post("/identities/sanitized/token", { scopes: ["chat"] }) +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/identities/sanitized/token', {"scopes":["chat"]}) .query(true) - .reply( - 200, - { id: "sanitized", token: "sanitized", expiresOn: "2020-11-22T03:42:39.8417903+00:00" }, - [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "hRFNDyxHBUOpr6Ykeda0mA.0", - "Strict-Transport-Security", - "max-age=2592000", - "x-ms-client-request-id", - "sanitized", - "api-supported-versions", - "2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2", - "X-Processing-Time", - "25ms", - "X-Azure-Ref", - "0sIy4XwAAAAA+D9dnkmkBS6A4EH+M7XqeWVZSMzBFREdFMDMyMQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Sat, 21 Nov 2020 03:42:40 GMT" - ] - ); + .reply(200, {"id":"sanitized","token":"sanitized","expiresOn":"2021-01-19T19:45:28.2080553+00:00"}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'MS-CV', + 'ViakJlslP0Gr/hJJUwdkcA.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'sanitized', + 'api-supported-versions', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', + 'X-Processing-Time', + '273ms', + 'X-Azure-Ref', + '0WOUFYAAAAABElPvEATEdToswEcq9JnRpRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Mon, 18 Jan 2021 19:45:29 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js index e02047e5254d..9b21698aa815 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js +++ b/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js @@ -1,25 +1,25 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "791f5b78ba1812d9905dd61f264e98f5"; +module.exports.hash = "e10098ac22e2857510889e9c31a45559"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .patch("/identities/sanitized", { tokensValidFrom: "2020-10-10T00:00:00.000Z" }) +nock('https://endpoint', {"encodedQueryParams":false}) + .patch('/identities/sanitized', {"tokensValidFrom":"2020-10-10T00:00:00.000Z"}) .query(true) .reply(204, "", [ - "MS-CV", - "ApT8zxbjtUGt+F+Jr9ax7Q.0", - "Strict-Transport-Security", - "max-age=2592000", - "x-ms-client-request-id", - "sanitized", - "api-supported-versions", - "2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2", - "X-Processing-Time", - "565ms", - "X-Azure-Ref", - "0sYy4XwAAAADl81Mb4GSoTYri/ZOYJSGTWVZSMzBFREdFMDMwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Sat, 21 Nov 2020 03:42:41 GMT" - ]); + 'MS-CV', + 'VBWxGovE50GB8VmCr9iQcQ.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'sanitized', + 'api-supported-versions', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', + 'X-Processing-Time', + '565ms', + 'X-Azure-Ref', + '0WuUFYAAAAACL7hFckMA4RKbvvQNRLqiTRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Mon, 18 Jan 2021 19:45:30 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js b/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js index a7ff7bffc95d..05b00006d617 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js +++ b/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js @@ -1,104 +1,86 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "0441531d19c5ab9860067f15f510ddc1"; +module.exports.hash = "3a781f5c72e6153f2bf8095c6929d1b1"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .post( - "/SomeTenantId/oauth2/v2.0/token", - "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default" - ) - .query(true) - .reply( - 200, - { - token_type: "Bearer", - expires_in: 3599, - ext_expires_in: 3599, - access_token: - "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjVPZjlQNUY5Z0NDd0NtRjJCT0hIeEREUS1EayIsImtpZCI6IjVPZjlQNUY5Z0NDd0NtRjJCT0hIeEREUS1EayJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2IzYmYwOTZlLWNlMTItNGRhZC05MjAzLWVkNzBhOGIwOTljMS8iLCJpYXQiOjE2MDg1ODIxOTQsIm5iZiI6MTYwODU4MjE5NCwiZXhwIjoxNjA4NTg2MDk0LCJhaW8iOiJFMkpnWVBnYndsVmlISHczZU52aEp1NkhGMVQwQUE9PSIsImFwcGlkIjoiZjM3MzQyMGUtMTFiZC00NzRiLTk4MjItOWYzMTU1MzNhZjQzIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvYjNiZjA5NmUtY2UxMi00ZGFkLTkyMDMtZWQ3MGE4YjA5OWMxLyIsIm9pZCI6IjdkNmFjZWIyLTYyNDgtNGFiNC1hYTMzLWRhMjU1ODEwZGVhYyIsInJoIjoiMC5BQUFBYmdtX3N4TE9yVTJTQS0xd3FMQ1p3UTVDY19POUVVdEhtQ0tmTVZVenIwTjJBQUEuIiwic3ViIjoiN2Q2YWNlYjItNjI0OC00YWI0LWFhMzMtZGEyNTU4MTBkZWFjIiwidGlkIjoiYjNiZjA5NmUtY2UxMi00ZGFkLTkyMDMtZWQ3MGE4YjA5OWMxIiwidXRpIjoiS3EtamlkOGxOVUdkMk1nNDJiUVlBQSIsInZlciI6IjEuMCJ9.t_LoTlE2eoayhdRCE8MxAAybmIzGlCuAzuVI9raLyfv5Sq8nk8_5JvP20wR4QcxZKGx1xaiRmS63vKuh8iJy4CPDxbQ2DQYeQ7G6po-XsF8_pUKNLwUTs9QrwpCMb1847jkCf5vKci_iAg8IuK1-79Dz_LR1OWglNgTWexzqTbVTsx-HBzq_Lpf7UvxadBEh9k7AXtgESEUkO3fakxEvJO5BWXvVEGGNGug-Q5YCP5dHzQFjtDhtDcbwVMllAZU2FwfbQ7n0YVg4oIwo8Lj3BUhiIN897KZiLxFG_UaoYp5-FEJy7BKCJoiONkKCipZR--6CRYERuZ3cxuum69rJvQ" - }, - [ - "Cache-Control", - "no-store, no-cache", - "Pragma", - "no-cache", - "Content-Type", - "application/json; charset=utf-8", - "Expires", - "-1", - "Strict-Transport-Security", - "max-age=31536000; includeSubDomains", - "X-Content-Type-Options", - "nosniff", - "P3P", - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - "x-ms-request-id", - "sanitized", - "x-ms-ests-server", - "2.1.11328.13 - EST ProdSlices", - "Set-Cookie", - "fpc=ArfpERbVoHRBizrQ1sfKyGX3ZxdeAQAAAF38ctcOAAAA; expires=Wed, 20-Jan-2021 20:28:14 GMT; path=/; secure; HttpOnly; SameSite=None", - "Set-Cookie", - "x-ms-gateway-slice=prod; path=/; secure; samesite=none; httponly", - "Set-Cookie", - "stsservicecookie=ests; path=/; secure; samesite=none; httponly", - "Date", - "Mon, 21 Dec 2020 20:28:13 GMT", - "Content-Length", - "1325" - ] - ); +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0Ny8iLCJpYXQiOjE2MTExODcxNjksIm5iZiI6MTYxMTE4NzE2OSwiZXhwIjoxNjExMjczODY5LCJhaW8iOiJFMkpnWURCejZTNmFZZUIxdEUxVFIwWk8wbXN4QUE9PSIsImFwcGlkIjoiNmM4MTgxYzctOTFhNi00ZTJlLTg0ODAtZDU0MDIxYWM0YzRiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsIm9pZCI6IjNlMGM3MTRmLTk3YWMtNGQ2My1hZWFmLTE0YmFhNWUwNjRjYiIsInJoIjoiMC5BUm9BdjRqNWN2R0dyMEdScXkxODBCSGJSOGVCZ1d5bWtTNU9oSURWUUNHc1RFc2FBQUEuIiwic3ViIjoiM2UwYzcxNGYtOTdhYy00ZDYzLWFlYWYtMTRiYWE1ZTA2NGNiIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoiZUJTRDVWcGxia0NXYmxuTlVLTktBQSIsInZlciI6IjEuMCJ9.PZsjSuL0VoiCmwibQVhuCAxp2lCIzfcNlbl5cF1SkPHgAacfQ744v-Sb0xeRLHriE5pVcOngbfdun9ntoclY3qzdMafqQunOMgOT9qtSSM5S5wzBWaRBz3EcYW3D9kFsV2m5O1sZaPXPcbdvcEXs9hiAdm9jfDE0JwX2-OOPLSzDtKAWb5ES8cG7TFizVyaLI6kubY8F_x2wkFFGfQKDQVuclBYQGkbK6xGl5nMmYhQmtoUtSajPezO8ZH9CQJB1K1t89msOZ0R_Ybup0-XOegltd6a10bRMV7f-5_FZa0GshbqrGzSLNVu0lhLTcyv08vswwXOMqUgDx8nwNAoHnA"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '1327', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'sanitized', + 'x-ms-ests-server', + '2.1.11419.13 - WUS2 ProdSlices', + 'Set-Cookie', + 'fpc=AtQYQhtVXGxAl2HRYGEM9KBWyo4SAgAAAAu8mtcOAAAA; expires=Sat, 20-Feb-2021 00:04:29 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 21 Jan 2021 00:04:28 GMT' +]); -nock("https://endpoint", { encodedQueryParams: true }) - .post("/identities") +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/identities') .query(true) - .reply(200, { id: "sanitized" }, [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "F//8oN+qAU6OCUZfpUCJag.0", - "Strict-Transport-Security", - "max-age=2592000", - "x-ms-client-request-id", - "sanitized", - "api-supported-versions", - "2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2", - "X-Processing-Time", - "357ms", - "X-Azure-Ref", - "0XgXhXwAAAABec5/iW5l5SblJgIQheeTrRVdSMzBFREdFMDYxMQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Mon, 21 Dec 2020 20:28:14 GMT" - ]); + .reply(200, {"id":"sanitized"}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'MS-CV', + '+228zHuTcE+i2INmpf/DeQ.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'sanitized', + 'api-supported-versions', + '2020-07-20-preview2, 2021-03-07', + 'X-Processing-Time', + '206ms', + 'X-Azure-Ref', + '0DcUIYAAAAAAC6+h+zVScTJpFpLyDcI5HRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Thu, 21 Jan 2021 00:04:28 GMT' +]); -nock("https://endpoint", { encodedQueryParams: true }) - .post("/identities/sanitized/token", { scopes: ["chat", "pstn"] }) +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/identities/sanitized/token', {"scopes":["chat","pstn"]}) .query(true) - .reply( - 200, - { id: "sanitized", token: "sanitized", expiresOn: "2020-12-22T20:28:14.0876313+00:00" }, - [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "75/9zD7vCke7F+DMNRP/aA.0", - "Strict-Transport-Security", - "max-age=2592000", - "x-ms-client-request-id", - "sanitized", - "api-supported-versions", - "2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2", - "X-Processing-Time", - "275ms", - "X-Azure-Ref", - "0XgXhXwAAAAAWDj7kN70PRrsn2GtE6GQMRVdSMzBFREdFMDYxMQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Mon, 21 Dec 2020 20:28:14 GMT" - ] - ); + .reply(200, {"id":"sanitized","token":"sanitized","expiresOn":"2021-01-22T00:04:28.9279178+00:00"}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'MS-CV', + '5x9WnSeooUCFUUjqzAkkTA.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'sanitized', + 'api-supported-versions', + '2020-07-20-preview2, 2021-03-07', + 'X-Processing-Time', + '274ms', + 'X-Azure-Ref', + '0DcUIYAAAAABr35Qn+npVQoTb9NPLRQaWRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Thu, 21 Jan 2021 00:04:29 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js b/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js index 046780fc13e8..db87d318c182 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js +++ b/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js @@ -1,104 +1,86 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "af7c6cb9bdc93d68a7d9359ea157526a"; +module.exports.hash = "94601dd7a4aa157e7f368397131f263e"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .post( - "/SomeTenantId/oauth2/v2.0/token", - "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default" - ) - .query(true) - .reply( - 200, - { - token_type: "Bearer", - expires_in: 3599, - ext_expires_in: 3599, - access_token: - "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjVPZjlQNUY5Z0NDd0NtRjJCT0hIeEREUS1EayIsImtpZCI6IjVPZjlQNUY5Z0NDd0NtRjJCT0hIeEREUS1EayJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2IzYmYwOTZlLWNlMTItNGRhZC05MjAzLWVkNzBhOGIwOTljMS8iLCJpYXQiOjE2MDg1ODIxOTIsIm5iZiI6MTYwODU4MjE5MiwiZXhwIjoxNjA4NTg2MDkyLCJhaW8iOiJFMkpnWURqMCsxa1J3NlNhZ2dtT1FzWXNiNjIrQVFBPSIsImFwcGlkIjoiZjM3MzQyMGUtMTFiZC00NzRiLTk4MjItOWYzMTU1MzNhZjQzIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvYjNiZjA5NmUtY2UxMi00ZGFkLTkyMDMtZWQ3MGE4YjA5OWMxLyIsIm9pZCI6IjdkNmFjZWIyLTYyNDgtNGFiNC1hYTMzLWRhMjU1ODEwZGVhYyIsInJoIjoiMC5BQUFBYmdtX3N4TE9yVTJTQS0xd3FMQ1p3UTVDY19POUVVdEhtQ0tmTVZVenIwTjJBQUEuIiwic3ViIjoiN2Q2YWNlYjItNjI0OC00YWI0LWFhMzMtZGEyNTU4MTBkZWFjIiwidGlkIjoiYjNiZjA5NmUtY2UxMi00ZGFkLTkyMDMtZWQ3MGE4YjA5OWMxIiwidXRpIjoiU21Xc0FLazU0a2kzVm96Tnc2OGNBQSIsInZlciI6IjEuMCJ9.F46MEvo2_VDwBQ0z_u96AM9x4BISmXz-hHasAHGHL0JS2jTX4qT24CkCy0VMNRLFwTMjaXyrUUB8S1cg190Epm5xaCSrLphxhbHu5eUy3H8ZWtkRaTWsdeqzJ16qc7H9S_dWhALFwR7Y47ofKFZrrwUr0RMNAwgSzHzmQYqNfB8aiP184ikQgZ_59RGeaDt7gC2tIrtdhlcMrjs6VnuawvuyZ54-CUR5mT-Ke8Ju72zwQtdzQSxm9v8XmgfdxX5lEwN88zBhyuqXLXTD55ijNrtU-A1YnDA-Vq9RqAfR22fo5F8BRuQ1mN3iyMdQMyrt5WFLwFRJ-s0Y7iL0R0UjlA" - }, - [ - "Cache-Control", - "no-store, no-cache", - "Pragma", - "no-cache", - "Content-Type", - "application/json; charset=utf-8", - "Expires", - "-1", - "Strict-Transport-Security", - "max-age=31536000; includeSubDomains", - "X-Content-Type-Options", - "nosniff", - "P3P", - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - "x-ms-request-id", - "sanitized", - "x-ms-ests-server", - "2.1.11328.13 - EST ProdSlices", - "Set-Cookie", - "fpc=AtRAjxDA_PNGk8IgAAZklDb3ZxdeAQAAAFz8ctcOAAAA; expires=Wed, 20-Jan-2021 20:28:12 GMT; path=/; secure; HttpOnly; SameSite=None", - "Set-Cookie", - "x-ms-gateway-slice=prod; path=/; secure; samesite=none; httponly", - "Set-Cookie", - "stsservicecookie=ests; path=/; secure; samesite=none; httponly", - "Date", - "Mon, 21 Dec 2020 20:28:12 GMT", - "Content-Length", - "1325" - ] - ); +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0Ny8iLCJpYXQiOjE2MTExODcxNjgsIm5iZiI6MTYxMTE4NzE2OCwiZXhwIjoxNjExMjczODY4LCJhaW8iOiJFMkpnWUhCTnRwUVA0a3hZL0VtNDU4K0h1dVEzQUE9PSIsImFwcGlkIjoiNmM4MTgxYzctOTFhNi00ZTJlLTg0ODAtZDU0MDIxYWM0YzRiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsIm9pZCI6IjNlMGM3MTRmLTk3YWMtNGQ2My1hZWFmLTE0YmFhNWUwNjRjYiIsInJoIjoiMC5BUm9BdjRqNWN2R0dyMEdScXkxODBCSGJSOGVCZ1d5bWtTNU9oSURWUUNHc1RFc2FBQUEuIiwic3ViIjoiM2UwYzcxNGYtOTdhYy00ZDYzLWFlYWYtMTRiYWE1ZTA2NGNiIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoidmxJQ01fOUh1RWVKa0w1R2Nab1VBQSIsInZlciI6IjEuMCJ9.cJFY3gXeXdTAEshZNorTXZQWUIDcplQ-BCbETE0DmGuWdmgYkDyvL9_CvSpqKRZkDowmrLvJeT47WQ49Ic3ikkmwCcjzA1sg0OSnNMvUEdsv3i9JC4537kiyFpDo5MmDZipSqlfZTvwRWAO5JGOZxkq81iRRZWNlMr48iMmaDMarWalnfgI1PfOTJCsxHKWnIM7GW5tFD20j02UTiG2B9kTHit_xfwi1WWA3KG2cTePr1H2Wc6JlhWOLGRbUam06lKIC93A0X8R1kQv1BR5XW9WUBsi1V10dI2IOQnVLp2863GeXU2Jm_7kaBWcAsRHFPka4XaxeJdEWdCxKr_uqUw"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'sanitized', + 'x-ms-ests-server', + '2.1.11419.13 - SCUS ProdSlices', + 'Set-Cookie', + 'fpc=AtQYQhtVXGxAl2HRYGEM9KBWyo4SAQAAAAu8mtcOAAAA; expires=Sat, 20-Feb-2021 00:04:28 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 21 Jan 2021 00:04:27 GMT', + 'Content-Length', + '1327' +]); -nock("https://endpoint", { encodedQueryParams: true }) - .post("/identities") +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/identities') .query(true) - .reply(200, { id: "sanitized" }, [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "NQBZ+MnP30Kr1piaI9wTGA.0", - "Strict-Transport-Security", - "max-age=2592000", - "x-ms-client-request-id", - "sanitized", - "api-supported-versions", - "2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2", - "X-Processing-Time", - "352ms", - "X-Azure-Ref", - "0XQXhXwAAAACsqcU5c4vsQ4NpR+a8OpIFRVdSMzBFREdFMDYxNAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Mon, 21 Dec 2020 20:28:12 GMT" - ]); + .reply(200, {"id":"sanitized"}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'MS-CV', + 'izeehkTKfkOdNpQgMxmNBw.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'sanitized', + 'api-supported-versions', + '2020-07-20-preview2, 2021-03-07', + 'X-Processing-Time', + '221ms', + 'X-Azure-Ref', + '0DMUIYAAAAADyvXexfWmZSKGD0aGyWv3IRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Thu, 21 Jan 2021 00:04:27 GMT' +]); -nock("https://endpoint", { encodedQueryParams: true }) - .post("/identities/sanitized/token", { scopes: ["chat"] }) +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/identities/sanitized/token', {"scopes":["chat"]}) .query(true) - .reply( - 200, - { id: "sanitized", token: "sanitized", expiresOn: "2020-12-22T20:28:12.8449526+00:00" }, - [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "K8luOL9gOESaa1Uy4HCO8w.0", - "Strict-Transport-Security", - "max-age=2592000", - "x-ms-client-request-id", - "sanitized", - "api-supported-versions", - "2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2", - "X-Processing-Time", - "287ms", - "X-Azure-Ref", - "0XQXhXwAAAADVB+/PcTZUSY3XfyI3zwKjRVdSMzBFREdFMDYxNAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Mon, 21 Dec 2020 20:28:13 GMT" - ] - ); + .reply(200, {"id":"sanitized","token":"sanitized","expiresOn":"2021-01-22T00:04:27.9969707+00:00"}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'MS-CV', + 'snlpHxIoWUagc97WfZbRJA.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'sanitized', + 'api-supported-versions', + '2020-07-20-preview2, 2021-03-07', + 'X-Processing-Time', + '273ms', + 'X-Azure-Ref', + '0DMUIYAAAAABSD2srDVM5RomzMlg1D/NJRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Thu, 21 Jan 2021 00:04:28 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_area_codes.js b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_area_codes.js index 8b2b6958f888..702bd53ae5d6 100644 --- a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_area_codes.js +++ b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_area_codes.js @@ -1,28 +1,25 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "e84b74df0f7534f262dbf049e526cf38"; +module.exports.hash = "928546984836e09bc337975d29dfcdda"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .post("/administration/phonenumbers/countries/US/areacodes", { - locationOptions: [ - { labelId: "state", optionsValue: "CA" }, - { labelId: "city", optionsValue: "NOAM-US-CA-LA" } - ] - }) +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/administration/phonenumbers/countries/US/areacodes', {"locationOptions":[{"labelId":"state","optionsValue":"CA"},{"labelId":"city","optionsValue":"NOAM-US-CA-LA"}]}) .query(true) - .reply(200, { primaryAreaCodes: ["213"], secondaryAreaCodes: [], nextLink: null }, [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "974aMwfm90e4T3mprBvOlw.0", - "X-Processing-Time", - "189ms", - "X-Azure-Ref", - "0/Yy4XwAAAAC6OPAI7YHXR6VxyPj+eC3JWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Sat, 21 Nov 2020 03:43:56 GMT" - ]); + .reply(200, {"primaryAreaCodes":["213","818"],"secondaryAreaCodes":[],"nextLink":null}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Request-Context', + 'appId=', + 'MS-CV', + 'X3/1RBP6FU6xbMoggoWeBg.0', + 'X-Processing-Time', + '367ms', + 'X-Azure-Ref', + '0hOUFYAAAAACiEOFcrM6zQKCC1Jokqtl9RVdSMzBFREdFMDYxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Mon, 18 Jan 2021 19:46:12 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_location_options.js b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_location_options.js index cc3187a3dbc2..b78033d3236d 100644 --- a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_location_options.js +++ b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_location_options.js @@ -1,753 +1,25 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "ff19049fa217a518b49ef9273a0095a3"; +module.exports.hash = "f43c4bb7c05826fd644a4f3f038c8768"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .get( - "/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans/sanitized/locationoptions" - ) +nock('https://endpoint', {"encodedQueryParams":false}) + .get('/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans/sanitized/locationoptions') .query(true) - .reply( - 200, - { - locationOptions: { - labelId: "state", - labelName: "State", - options: [ - { - name: "AL", - value: "AL", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Birmingham", value: "NOAM-US-AL-BI", locationOptions: [] }, - { name: "Huntsville", value: "NOAM-US-AL-HN", locationOptions: [] }, - { name: "Mobile", value: "NOAM-US-AL-MO", locationOptions: [] }, - { name: "Montgomery", value: "NOAM-US-AL-MN", locationOptions: [] } - ] - } - ] - }, - { - name: "AR", - value: "AR", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Fort Smith", value: "NOAM-US-AR-FS", locationOptions: [] }, - { name: "Jonesboro", value: "NOAM-US-AR-JO", locationOptions: [] }, - { name: "Little Rock", value: "NOAM-US-AR-LR", locationOptions: [] } - ] - } - ] - }, - { - name: "AZ", - value: "AZ", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Phoenix", value: "NOAM-US-AZ-PH", locationOptions: [] }] - } - ] - }, - { - name: "CA", - value: "CA", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Burbank", value: "NOAM-US-CA-BU", locationOptions: [] }, - { name: "Concord", value: "NOAM-US-CA-CO", locationOptions: [] }, - { name: "Fresno", value: "NOAM-US-CA-FR", locationOptions: [] }, - { name: "Irvine", value: "NOAM-US-CA-IR", locationOptions: [] }, - { name: "Los Angeles", value: "NOAM-US-CA-LA", locationOptions: [] }, - { name: "Riverside", value: "NOAM-US-CA-RI", locationOptions: [] }, - { name: "Sacramento", value: "NOAM-US-CA-SA", locationOptions: [] }, - { name: "Salinas", value: "NOAM-US-CA-SL", locationOptions: [] }, - { name: "San Diego", value: "NOAM-US-CA-SD", locationOptions: [] }, - { name: "San Francisco", value: "NOAM-US-CA-SF", locationOptions: [] }, - { name: "San Jose", value: "NOAM-US-CA-SJ", locationOptions: [] }, - { name: "Santa Barbara", value: "NOAM-US-CA-SB", locationOptions: [] }, - { name: "Santa Clarita", value: "NOAM-US-CA-SC", locationOptions: [] }, - { name: "Santa Rosa", value: "NOAM-US-CA-SR", locationOptions: [] }, - { name: "Stockton", value: "NOAM-US-CA-ST", locationOptions: [] } - ] - } - ] - }, - { - name: "CL", - value: "CL", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Washington DC", value: "NOAM-US-CL-DC", locationOptions: [] }] - } - ] - }, - { - name: "CO", - value: "CO", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Denver", value: "NOAM-US-CO-DE", locationOptions: [] }, - { name: "Pueblo", value: "NOAM-US-CO-PU", locationOptions: [] } - ] - } - ] - }, - { - name: "CT", - value: "CT", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Bridgeport", value: "NOAM-US-CT-BR", locationOptions: [] }, - { name: "Hartford", value: "NOAM-US-CT-HA", locationOptions: [] } - ] - } - ] - }, - { - name: "DE", - value: "DE", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Wilmington", value: "NOAM-US-DE-WI", locationOptions: [] }] - } - ] - }, - { - name: "FL", - value: "FL", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Cape Coral", value: "NOAM-US-FL-CC", locationOptions: [] }, - { name: "Fort Lauderdale", value: "NOAM-US-FL-FL", locationOptions: [] }, - { name: "Gainesville", value: "NOAM-US-FL-GA", locationOptions: [] }, - { name: "Jacksonville", value: "NOAM-US-FL-JA", locationOptions: [] }, - { name: "Lakeland", value: "NOAM-US-FL-LA", locationOptions: [] }, - { name: "Miami", value: "NOAM-US-FL-MI", locationOptions: [] }, - { name: "Orlando", value: "NOAM-US-FL-OR", locationOptions: [] }, - { name: "Port St Lucie", value: "NOAM-US-FL-PS", locationOptions: [] }, - { name: "Sarasota", value: "NOAM-US-FL-SA", locationOptions: [] }, - { name: "St. Petersburg", value: "NOAM-US-FL-SP", locationOptions: [] }, - { name: "Tallahassee", value: "NOAM-US-FL-TA", locationOptions: [] }, - { name: "West Palm Beach", value: "NOAM-US-FL-WP", locationOptions: [] } - ] - } - ] - }, - { - name: "GA", - value: "GA", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Albany", value: "NOAM-US-GA-AL", locationOptions: [] }, - { name: "Atlanta", value: "NOAM-US-GA-AT", locationOptions: [] }, - { name: "Augusta", value: "NOAM-US-GA-AU", locationOptions: [] }, - { name: "Macon", value: "NOAM-US-GA-MA", locationOptions: [] }, - { name: "Savannah", value: "NOAM-US-GA-SA", locationOptions: [] } - ] - } - ] - }, - { - name: "HI", - value: "HI", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Honolulu", value: "NOAM-US-HI-HO", locationOptions: [] }] - } - ] - }, - { - name: "IA", - value: "IA", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Cedar Rapids", value: "NOAM-US-IA-CR", locationOptions: [] }, - { name: "Davenport", value: "NOAM-US-IA-DA", locationOptions: [] }, - { name: "Mason City", value: "NOAM-US-IA-MC", locationOptions: [] }, - { name: "Sioux City", value: "NOAM-US-IA-SC", locationOptions: [] } - ] - } - ] - }, - { - name: "ID", - value: "ID", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Boise", value: "NOAM-US-ID-BO", locationOptions: [] }] - } - ] - }, - { - name: "IL", - value: "IL", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Alton", value: "NOAM-US-IL-AL", locationOptions: [] }, - { name: "Aurora", value: "NOAM-US-IL-AU", locationOptions: [] }, - { name: "Big Rock", value: "NOAM-US-IL-BK", locationOptions: [] }, - { name: "Chicago", value: "NOAM-US-IL-CH", locationOptions: [] }, - { name: "Rock Island", value: "NOAM-US-IL-RI", locationOptions: [] }, - { name: "Rockford", value: "NOAM-US-IL-RO", locationOptions: [] }, - { name: "Waukegan", value: "NOAM-US-IL-WK", locationOptions: [] } - ] - } - ] - }, - { - name: "IN", - value: "IN", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Evansville", value: "NOAM-US-IN-EV", locationOptions: [] }, - { name: "Fort Wayne", value: "NOAM-US-IN-FW", locationOptions: [] }, - { name: "Gary", value: "NOAM-US-IN-GA", locationOptions: [] }, - { name: "Indianapolis", value: "NOAM-US-IN-IN", locationOptions: [] }, - { name: "South Bend", value: "NOAM-US-IN-SB", locationOptions: [] } - ] - } - ] - }, - { - name: "KS", - value: "KS", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Kansas City", value: "NOAM-US-KS-KS", locationOptions: [] }, - { name: "Topeka", value: "NOAM-US-KS-TO", locationOptions: [] }, - { name: "Wichita", value: "NOAM-US-KS-WI", locationOptions: [] } - ] - } - ] - }, - { - name: "KY", - value: "KY", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Lexington", value: "NOAM-US-KY-LE", locationOptions: [] }, - { name: "Louisville", value: "NOAM-US-KY-LO", locationOptions: [] } - ] - } - ] - }, - { - name: "LA", - value: "LA", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Baton Rouge", value: "NOAM-US-LA-BR", locationOptions: [] }, - { name: "Lafayette", value: "NOAM-US-LA-LA", locationOptions: [] }, - { name: "New Orleans", value: "NOAM-US-LA-NO", locationOptions: [] }, - { name: "Shreveport", value: "NOAM-US-LA-SH", locationOptions: [] } - ] - } - ] - }, - { - name: "MA", - value: "MA", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Lowell", value: "NOAM-US-MA-LO", locationOptions: [] }] - } - ] - }, - { - name: "MD", - value: "MD", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Baltimore", value: "NOAM-US-MD-BA", locationOptions: [] }] - } - ] - }, - { - name: "ME", - value: "ME", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Portland", value: "NOAM-US-ME-PO", locationOptions: [] }] - } - ] - }, - { - name: "MI", - value: "MI", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Ann Arbor", value: "NOAM-US-MI-AA", locationOptions: [] }, - { name: "Detroit", value: "NOAM-US-MI-DE", locationOptions: [] }, - { name: "Flint", value: "NOAM-US-MI-FL", locationOptions: [] }, - { name: "Grand Rapids", value: "NOAM-US-MI-GP", locationOptions: [] }, - { name: "Grant", value: "NOAM-US-MI-GR", locationOptions: [] }, - { name: "Lansing", value: "NOAM-US-MI-LA", locationOptions: [] }, - { name: "Otsego", value: "NOAM-US-MI-OT", locationOptions: [] }, - { name: "Saginaw", value: "NOAM-US-MI-SA", locationOptions: [] }, - { name: "Sault Ste Marie", value: "NOAM-US-MI-SS", locationOptions: [] }, - { name: "Troy", value: "NOAM-US-MI-TR", locationOptions: [] } - ] - } - ] - }, - { - name: "MN", - value: "MN", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Alexandria", value: "NOAM-US-MN-AL", locationOptions: [] }, - { name: "Duluth", value: "NOAM-US-MN-DU", locationOptions: [] }, - { name: "Minneapolis", value: "NOAM-US-MN-MI", locationOptions: [] }, - { name: "Plymouth", value: "NOAM-US-MN-PL", locationOptions: [] } - ] - } - ] - }, - { - name: "MO", - value: "MO", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Columbia", value: "NOAM-US-MO-CO", locationOptions: [] }, - { name: "Kansas City", value: "NOAM-US-MO-KS", locationOptions: [] }, - { name: "Marshall", value: "NOAM-US-MO-MA", locationOptions: [] }, - { name: "Springfield", value: "NOAM-US-MO-SP", locationOptions: [] }, - { name: "St. Charles", value: "NOAM-US-MO-SC", locationOptions: [] }, - { name: "St. Louis", value: "NOAM-US-MO-SL", locationOptions: [] } - ] - } - ] - }, - { - name: "MS", - value: "MS", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Biloxi", value: "NOAM-US-MS-BI", locationOptions: [] }, - { name: "Jackson", value: "NOAM-US-MS-JA", locationOptions: [] }, - { name: "Starkville", value: "NOAM-US-MS-ST", locationOptions: [] } - ] - } - ] - }, - { - name: "MT", - value: "MT", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Billings", value: "NOAM-US-MT-BI", locationOptions: [] }] - } - ] - }, - { - name: "NC", - value: "NC", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Asheville", value: "NOAM-US-NC-AS", locationOptions: [] }, - { name: "Charlotte", value: "NOAM-US-NC-CH", locationOptions: [] }, - { name: "Fayetteville", value: "NOAM-US-NC-FA", locationOptions: [] }, - { name: "Greensboro", value: "NOAM-US-NC-GR", locationOptions: [] }, - { name: "Raleigh", value: "NOAM-US-NC-RA", locationOptions: [] }, - { name: "Rocky Mount", value: "NOAM-US-NC-RM", locationOptions: [] } - ] - } - ] - }, - { - name: "ND", - value: "ND", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Fargo", value: "NOAM-US-ND-FA", locationOptions: [] }] - } - ] - }, - { - name: "NE", - value: "NE", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Kearney", value: "NOAM-US-NE-KE", locationOptions: [] }, - { name: "Omaha", value: "NOAM-US-NE-OM", locationOptions: [] } - ] - } - ] - }, - { - name: "NJ", - value: "NJ", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Atlantic City", value: "NOAM-US-NJ-AC", locationOptions: [] }, - { name: "Camden", value: "NOAM-US-NJ-CA", locationOptions: [] }, - { name: "Edison", value: "NOAM-US-NJ-ED", locationOptions: [] }, - { name: "Elizabeth", value: "NOAM-US-NJ-EL", locationOptions: [] }, - { name: "Jersey City", value: "NOAM-US-NJ-JC", locationOptions: [] }, - { name: "Newark", value: "NOAM-US-NJ-NE", locationOptions: [] } - ] - } - ] - }, - { - name: "NM", - value: "NM", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Albuquerque", value: "NOAM-US-NM-AL", locationOptions: [] }, - { name: "Las Cruces", value: "NOAM-US-NM-LC", locationOptions: [] } - ] - } - ] - }, - { - name: "NV", - value: "NV", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Las Vegas", value: "NOAM-US-NV-LV", locationOptions: [] }, - { name: "Reno", value: "NOAM-US-NV-RE", locationOptions: [] } - ] - } - ] - }, - { - name: "NY", - value: "NY", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Albany", value: "NOAM-US-NY-AL", locationOptions: [] }, - { name: "Brentwood", value: "NOAM-US-NY-BR", locationOptions: [] }, - { name: "Elmira", value: "NOAM-US-NY-EL", locationOptions: [] }, - { name: "Hempstead", value: "NOAM-US-NY-HE", locationOptions: [] }, - { name: "New York City", value: "NOAM-US-NY-NY", locationOptions: [] }, - { name: "Niagara Falls", value: "NOAM-US-NY-NF", locationOptions: [] }, - { name: "Rochester", value: "NOAM-US-NY-RO", locationOptions: [] }, - { name: "Syracuse", value: "NOAM-US-NY-SY", locationOptions: [] }, - { name: "Yonkers", value: "NOAM-US-NY-YO", locationOptions: [] } - ] - } - ] - }, - { - name: "OH", - value: "OH", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Akron", value: "NOAM-US-OH-AK", locationOptions: [] }, - { name: "Cincinnati", value: "NOAM-US-OH-CI", locationOptions: [] }, - { name: "Cleveland", value: "NOAM-US-OH-CL", locationOptions: [] }, - { name: "Columbus", value: "NOAM-US-OH-CO", locationOptions: [] }, - { name: "Dayton", value: "NOAM-US-OH-DA", locationOptions: [] }, - { name: "Toledo", value: "NOAM-US-OH-TO", locationOptions: [] } - ] - } - ] - }, - { - name: "OK", - value: "OK", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Lawton", value: "NOAM-US-OK-LA", locationOptions: [] }, - { name: "Oklahoma City", value: "NOAM-US-OK-OC", locationOptions: [] }, - { name: "Tulsa", value: "NOAM-US-OK-TU", locationOptions: [] } - ] - } - ] - }, - { - name: "OR", - value: "OR", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Portland", value: "NOAM-US-OR-PO", locationOptions: [] }] - } - ] - }, - { - name: "PA", - value: "PA", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Erie", value: "NOAM-US-PA-ER", locationOptions: [] }, - { name: "Lancaster", value: "NOAM-US-PA-LA", locationOptions: [] }, - { name: "Philadelphia", value: "NOAM-US-PA-PI", locationOptions: [] }, - { name: "Pittsburgh", value: "NOAM-US-PA-PT", locationOptions: [] }, - { name: "Scranton", value: "NOAM-US-PA-SC", locationOptions: [] } - ] - } - ] - }, - { - name: "RI", - value: "RI", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Providence", value: "NOAM-US-RI-PR", locationOptions: [] }] - } - ] - }, - { - name: "SC", - value: "SC", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Charleston", value: "NOAM-US-SC-CH", locationOptions: [] }, - { name: "Columbia", value: "NOAM-US-SC-CO", locationOptions: [] }, - { name: "Greenville", value: "NOAM-US-SC-GR", locationOptions: [] } - ] - } - ] - }, - { - name: "SD", - value: "SD", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Sioux Falls", value: "NOAM-US-SD-SF", locationOptions: [] }] - } - ] - }, - { - name: "TN", - value: "TN", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Chattanooga", value: "NOAM-US-TN-CH", locationOptions: [] }, - { name: "Clarksville", value: "NOAM-US-TN-CL", locationOptions: [] }, - { name: "Jackson", value: "NOAM-US-TN-JA", locationOptions: [] }, - { name: "Knoxville", value: "NOAM-US-TN-KN", locationOptions: [] }, - { name: "Memphis", value: "NOAM-US-TN-ME", locationOptions: [] }, - { name: "Nashville", value: "NOAM-US-TN-NA", locationOptions: [] } - ] - } - ] - }, - { - name: "TX", - value: "TX", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Abilene", value: "NOAM-US-TX-AB", locationOptions: [] }, - { name: "Austin", value: "NOAM-US-TX-AU", locationOptions: [] }, - { name: "Bryan", value: "NOAM-US-TX-BR", locationOptions: [] }, - { name: "Corpus Christi", value: "NOAM-US-TX-CC", locationOptions: [] }, - { name: "Denton", value: "NOAM-US-TX-DE", locationOptions: [] }, - { name: "El Paso", value: "NOAM-US-TX-EP", locationOptions: [] }, - { name: "Fort Worth", value: "NOAM-US-TX-FW", locationOptions: [] }, - { name: "Galveston", value: "NOAM-US-TX-GA", locationOptions: [] }, - { name: "Houston", value: "NOAM-US-TX-HO", locationOptions: [] }, - { name: "Huntsville", value: "NOAM-US-TX-HU", locationOptions: [] }, - { name: "Laredo", value: "NOAM-US-TX-LA", locationOptions: [] }, - { name: "Lubbock", value: "NOAM-US-TX-LU", locationOptions: [] }, - { name: "Tyler", value: "NOAM-US-TX-TY", locationOptions: [] } - ] - } - ] - }, - { - name: "UT", - value: "UT", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "St. George", value: "NOAM-US-UT-SG", locationOptions: [] }] - } - ] - }, - { - name: "VA", - value: "VA", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Arlington", value: "NOAM-US-VA-AR", locationOptions: [] }, - { name: "Danville", value: "NOAM-US-VA-DA", locationOptions: [] }, - { name: "Lynchburg", value: "NOAM-US-VA-LY", locationOptions: [] }, - { name: "Richmond", value: "NOAM-US-VA-RI", locationOptions: [] }, - { name: "Roanoke", value: "NOAM-US-VA-RO", locationOptions: [] }, - { name: "Virginia Beach", value: "NOAM-US-VA-VB", locationOptions: [] } - ] - } - ] - }, - { - name: "VT", - value: "VT", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Brattleboro", value: "NOAM-US-VT-BR", locationOptions: [] }, - { name: "Burlington", value: "NOAM-US-VT-BU", locationOptions: [] }, - { name: "Newport", value: "NOAM-US-VT-NE", locationOptions: [] } - ] - } - ] - }, - { - name: "WI", - value: "WI", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [ - { name: "Eau Claire", value: "NOAM-US-WI-EC", locationOptions: [] }, - { name: "Green Bay", value: "NOAM-US-WI-GB", locationOptions: [] }, - { name: "Kenosha", value: "NOAM-US-WI-KE", locationOptions: [] }, - { name: "Madison", value: "NOAM-US-WI-MA", locationOptions: [] }, - { name: "Milwaukee", value: "NOAM-US-WI-MI", locationOptions: [] } - ] - } - ] - }, - { - name: "WY", - value: "WY", - locationOptions: [ - { - labelId: "city", - labelName: "City", - options: [{ name: "Laramie", value: "NOAM-US-WY-LA", locationOptions: [] }] - } - ] - } - ] - } - }, - [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "1HinBk3zW0CVAk3wxbQ8Sw.0", - "X-Processing-Time", - "275ms", - "X-Azure-Ref", - "0/Yy4XwAAAABujlQanjwLR5j7y4ro+l3QWVZSMzBFREdFMDQxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Sat, 21 Nov 2020 03:43:57 GMT" - ] - ); + .reply(200, {"locationOptions":{"labelId":"state","labelName":"State","options":[{"name":"AL","value":"AL","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Birmingham","value":"NOAM-US-AL-BI","locationOptions":[]},{"name":"Huntsville","value":"NOAM-US-AL-HN","locationOptions":[]},{"name":"Mobile","value":"NOAM-US-AL-MO","locationOptions":[]},{"name":"Montgomery","value":"NOAM-US-AL-MN","locationOptions":[]}]}]},{"name":"AR","value":"AR","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Fort Smith","value":"NOAM-US-AR-FS","locationOptions":[]},{"name":"Jonesboro","value":"NOAM-US-AR-JO","locationOptions":[]},{"name":"Little Rock","value":"NOAM-US-AR-LR","locationOptions":[]}]}]},{"name":"AZ","value":"AZ","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Phoenix","value":"NOAM-US-AZ-PH","locationOptions":[]}]}]},{"name":"CA","value":"CA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Anaheim","value":"NOAM-US-CA-AN","locationOptions":[]},{"name":"Burbank","value":"NOAM-US-CA-BU","locationOptions":[]},{"name":"Concord","value":"NOAM-US-CA-CO","locationOptions":[]},{"name":"Fresno","value":"NOAM-US-CA-FR","locationOptions":[]},{"name":"Irvine","value":"NOAM-US-CA-IR","locationOptions":[]},{"name":"Los Angeles","value":"NOAM-US-CA-LA","locationOptions":[]},{"name":"Riverside","value":"NOAM-US-CA-RI","locationOptions":[]},{"name":"Sacramento","value":"NOAM-US-CA-SA","locationOptions":[]},{"name":"Salinas","value":"NOAM-US-CA-SL","locationOptions":[]},{"name":"San Diego","value":"NOAM-US-CA-SD","locationOptions":[]},{"name":"San Francisco","value":"NOAM-US-CA-SF","locationOptions":[]},{"name":"San Jose","value":"NOAM-US-CA-SJ","locationOptions":[]},{"name":"Santa Barbara","value":"NOAM-US-CA-SB","locationOptions":[]},{"name":"Santa Clarita","value":"NOAM-US-CA-SC","locationOptions":[]},{"name":"Santa Rosa","value":"NOAM-US-CA-SR","locationOptions":[]},{"name":"Stockton","value":"NOAM-US-CA-ST","locationOptions":[]},{"name":"Truckee","value":"NOAM-US-CA-TR","locationOptions":[]}]}]},{"name":"CL","value":"CL","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Washington DC","value":"NOAM-US-CL-DC","locationOptions":[]}]}]},{"name":"CO","value":"CO","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Denver","value":"NOAM-US-CO-DE","locationOptions":[]},{"name":"Pueblo","value":"NOAM-US-CO-PU","locationOptions":[]}]}]},{"name":"CT","value":"CT","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Bridgeport","value":"NOAM-US-CT-BR","locationOptions":[]},{"name":"Hartford","value":"NOAM-US-CT-HA","locationOptions":[]}]}]},{"name":"DE","value":"DE","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Wilmington","value":"NOAM-US-DE-WI","locationOptions":[]}]}]},{"name":"FL","value":"FL","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Cape Coral","value":"NOAM-US-FL-CC","locationOptions":[]},{"name":"Daytona Beach","value":"NOAM-US-FL-DB","locationOptions":[]},{"name":"Fort Lauderdale","value":"NOAM-US-FL-FL","locationOptions":[]},{"name":"Gainesville","value":"NOAM-US-FL-GA","locationOptions":[]},{"name":"Jacksonville","value":"NOAM-US-FL-JA","locationOptions":[]},{"name":"Lakeland","value":"NOAM-US-FL-LA","locationOptions":[]},{"name":"Miami","value":"NOAM-US-FL-MI","locationOptions":[]},{"name":"Orlando","value":"NOAM-US-FL-OR","locationOptions":[]},{"name":"Port St Lucie","value":"NOAM-US-FL-PS","locationOptions":[]},{"name":"Sarasota","value":"NOAM-US-FL-SA","locationOptions":[]},{"name":"St. Petersburg","value":"NOAM-US-FL-SP","locationOptions":[]},{"name":"Tallahassee","value":"NOAM-US-FL-TA","locationOptions":[]},{"name":"West Palm Beach","value":"NOAM-US-FL-WP","locationOptions":[]}]}]},{"name":"GA","value":"GA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Albany","value":"NOAM-US-GA-AL","locationOptions":[]},{"name":"Atlanta","value":"NOAM-US-GA-AT","locationOptions":[]},{"name":"Augusta","value":"NOAM-US-GA-AU","locationOptions":[]},{"name":"Macon","value":"NOAM-US-GA-MA","locationOptions":[]},{"name":"Savannah","value":"NOAM-US-GA-SA","locationOptions":[]}]}]},{"name":"HI","value":"HI","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Honolulu","value":"NOAM-US-HI-HO","locationOptions":[]}]}]},{"name":"IA","value":"IA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Cedar Rapids","value":"NOAM-US-IA-CR","locationOptions":[]},{"name":"Davenport","value":"NOAM-US-IA-DA","locationOptions":[]},{"name":"Mason City","value":"NOAM-US-IA-MC","locationOptions":[]},{"name":"Sioux City","value":"NOAM-US-IA-SC","locationOptions":[]}]}]},{"name":"ID","value":"ID","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Boise","value":"NOAM-US-ID-BO","locationOptions":[]}]}]},{"name":"IL","value":"IL","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Aurora","value":"NOAM-US-IL-AU","locationOptions":[]},{"name":"Champaign","value":"NOAM-US-IL-CA","locationOptions":[]},{"name":"Chicago","value":"NOAM-US-IL-CH","locationOptions":[]},{"name":"Cicero","value":"NOAM-US-IL-CI","locationOptions":[]},{"name":"Rock Island","value":"NOAM-US-IL-RI","locationOptions":[]},{"name":"Rockford","value":"NOAM-US-IL-RO","locationOptions":[]}]}]},{"name":"IN","value":"IN","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Evansville","value":"NOAM-US-IN-EV","locationOptions":[]},{"name":"Fort Wayne","value":"NOAM-US-IN-FW","locationOptions":[]},{"name":"Gary","value":"NOAM-US-IN-GA","locationOptions":[]},{"name":"Indianapolis","value":"NOAM-US-IN-IN","locationOptions":[]},{"name":"South Bend","value":"NOAM-US-IN-SB","locationOptions":[]}]}]},{"name":"KS","value":"KS","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Dodge City","value":"NOAM-US-KS-DC","locationOptions":[]},{"name":"Kansas City","value":"NOAM-US-KS-KS","locationOptions":[]},{"name":"Topeka","value":"NOAM-US-KS-TO","locationOptions":[]},{"name":"Wichita","value":"NOAM-US-KS-WI","locationOptions":[]}]}]},{"name":"KY","value":"KY","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Ashland","value":"NOAM-US-KY-AS","locationOptions":[]},{"name":"Lexington","value":"NOAM-US-KY-LE","locationOptions":[]},{"name":"Louisville","value":"NOAM-US-KY-LO","locationOptions":[]},{"name":"Owensboro","value":"NOAM-US-KY-OW","locationOptions":[]}]}]},{"name":"LA","value":"LA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Baton Rouge","value":"NOAM-US-LA-BR","locationOptions":[]},{"name":"Lafayette","value":"NOAM-US-LA-LA","locationOptions":[]},{"name":"New Orleans","value":"NOAM-US-LA-NO","locationOptions":[]},{"name":"Shreveport","value":"NOAM-US-LA-SH","locationOptions":[]}]}]},{"name":"MA","value":"MA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Lowell","value":"NOAM-US-MA-LO","locationOptions":[]}]}]},{"name":"MD","value":"MD","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Baltimore","value":"NOAM-US-MD-BA","locationOptions":[]}]}]},{"name":"ME","value":"ME","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Portland","value":"NOAM-US-ME-PO","locationOptions":[]}]}]},{"name":"MI","value":"MI","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Ann Arbor","value":"NOAM-US-MI-AA","locationOptions":[]},{"name":"Detroit","value":"NOAM-US-MI-DE","locationOptions":[]},{"name":"Flint","value":"NOAM-US-MI-FL","locationOptions":[]},{"name":"Grand Rapids","value":"NOAM-US-MI-GP","locationOptions":[]},{"name":"Grant","value":"NOAM-US-MI-GR","locationOptions":[]},{"name":"Lansing","value":"NOAM-US-MI-LA","locationOptions":[]},{"name":"Otsego","value":"NOAM-US-MI-OT","locationOptions":[]},{"name":"Saginaw","value":"NOAM-US-MI-SA","locationOptions":[]},{"name":"Sault Ste Marie","value":"NOAM-US-MI-SS","locationOptions":[]}]}]},{"name":"MN","value":"MN","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Alexandria","value":"NOAM-US-MN-AL","locationOptions":[]},{"name":"Bloomington","value":"NOAM-US-MN-BL","locationOptions":[]},{"name":"Duluth","value":"NOAM-US-MN-DU","locationOptions":[]},{"name":"Minneapolis","value":"NOAM-US-MN-MI","locationOptions":[]},{"name":"Plymouth","value":"NOAM-US-MN-PL","locationOptions":[]}]}]},{"name":"MO","value":"MO","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Columbia","value":"NOAM-US-MO-CO","locationOptions":[]},{"name":"Kansas City","value":"NOAM-US-MO-KS","locationOptions":[]},{"name":"Marshall","value":"NOAM-US-MO-MA","locationOptions":[]},{"name":"Springfield","value":"NOAM-US-MO-SP","locationOptions":[]},{"name":"St. Charles","value":"NOAM-US-MO-SC","locationOptions":[]},{"name":"St. Louis","value":"NOAM-US-MO-SL","locationOptions":[]}]}]},{"name":"MS","value":"MS","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Biloxi","value":"NOAM-US-MS-BI","locationOptions":[]},{"name":"Jackson","value":"NOAM-US-MS-JA","locationOptions":[]},{"name":"Starkville","value":"NOAM-US-MS-ST","locationOptions":[]}]}]},{"name":"MT","value":"MT","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Billings","value":"NOAM-US-MT-BI","locationOptions":[]}]}]},{"name":"NC","value":"NC","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Asheville","value":"NOAM-US-NC-AS","locationOptions":[]},{"name":"Charlotte","value":"NOAM-US-NC-CH","locationOptions":[]},{"name":"Fayetteville","value":"NOAM-US-NC-FA","locationOptions":[]},{"name":"Greensboro","value":"NOAM-US-NC-GR","locationOptions":[]},{"name":"Raleigh","value":"NOAM-US-NC-RA","locationOptions":[]},{"name":"Rocky Mount","value":"NOAM-US-NC-RM","locationOptions":[]}]}]},{"name":"ND","value":"ND","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Fargo","value":"NOAM-US-ND-FA","locationOptions":[]}]}]},{"name":"NE","value":"NE","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Kearney","value":"NOAM-US-NE-KE","locationOptions":[]},{"name":"Omaha","value":"NOAM-US-NE-OM","locationOptions":[]}]}]},{"name":"NH","value":"NH","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Concord","value":"NOAM-US-NH-CO","locationOptions":[]}]}]},{"name":"NJ","value":"NJ","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Atlantic City","value":"NOAM-US-NJ-AC","locationOptions":[]},{"name":"Camden","value":"NOAM-US-NJ-CA","locationOptions":[]},{"name":"Edison","value":"NOAM-US-NJ-ED","locationOptions":[]},{"name":"Elizabeth","value":"NOAM-US-NJ-EL","locationOptions":[]},{"name":"Jersey City","value":"NOAM-US-NJ-JC","locationOptions":[]},{"name":"Newark","value":"NOAM-US-NJ-NE","locationOptions":[]}]}]},{"name":"NM","value":"NM","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Albuquerque","value":"NOAM-US-NM-AL","locationOptions":[]},{"name":"Las Cruces","value":"NOAM-US-NM-LC","locationOptions":[]}]}]},{"name":"NV","value":"NV","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Las Vegas","value":"NOAM-US-NV-LV","locationOptions":[]},{"name":"Reno","value":"NOAM-US-NV-RE","locationOptions":[]}]}]},{"name":"NY","value":"NY","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Albany","value":"NOAM-US-NY-AL","locationOptions":[]},{"name":"Brentwood","value":"NOAM-US-NY-BR","locationOptions":[]},{"name":"Elmira","value":"NOAM-US-NY-EL","locationOptions":[]},{"name":"Hempstead","value":"NOAM-US-NY-HE","locationOptions":[]},{"name":"New York City","value":"NOAM-US-NY-NY","locationOptions":[]},{"name":"Niagara Falls","value":"NOAM-US-NY-NF","locationOptions":[]},{"name":"Rochester","value":"NOAM-US-NY-RO","locationOptions":[]},{"name":"Yonkers","value":"NOAM-US-NY-YO","locationOptions":[]}]}]},{"name":"OH","value":"OH","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Akron","value":"NOAM-US-OH-AK","locationOptions":[]},{"name":"Cincinnati","value":"NOAM-US-OH-CI","locationOptions":[]},{"name":"Cleveland","value":"NOAM-US-OH-CL","locationOptions":[]},{"name":"Columbus","value":"NOAM-US-OH-CO","locationOptions":[]},{"name":"Dayton","value":"NOAM-US-OH-DA","locationOptions":[]},{"name":"Toledo","value":"NOAM-US-OH-TO","locationOptions":[]}]}]},{"name":"OK","value":"OK","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Lawton","value":"NOAM-US-OK-LA","locationOptions":[]},{"name":"Oklahoma City","value":"NOAM-US-OK-OC","locationOptions":[]},{"name":"Tulsa","value":"NOAM-US-OK-TU","locationOptions":[]}]}]},{"name":"OR","value":"OR","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Portland","value":"NOAM-US-OR-PO","locationOptions":[]}]}]},{"name":"PA","value":"PA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Erie","value":"NOAM-US-PA-ER","locationOptions":[]},{"name":"Lancaster","value":"NOAM-US-PA-LA","locationOptions":[]},{"name":"Philadelphia","value":"NOAM-US-PA-PI","locationOptions":[]},{"name":"Pittsburgh","value":"NOAM-US-PA-PT","locationOptions":[]},{"name":"Scranton","value":"NOAM-US-PA-SC","locationOptions":[]}]}]},{"name":"RI","value":"RI","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Providence","value":"NOAM-US-RI-PR","locationOptions":[]}]}]},{"name":"SC","value":"SC","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Charleston","value":"NOAM-US-SC-CH","locationOptions":[]},{"name":"Columbia","value":"NOAM-US-SC-CO","locationOptions":[]},{"name":"Greenville","value":"NOAM-US-SC-GR","locationOptions":[]}]}]},{"name":"SD","value":"SD","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Sioux Falls","value":"NOAM-US-SD-SF","locationOptions":[]}]}]},{"name":"TN","value":"TN","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Chattanooga","value":"NOAM-US-TN-CH","locationOptions":[]},{"name":"Clarksville","value":"NOAM-US-TN-CL","locationOptions":[]},{"name":"Jackson","value":"NOAM-US-TN-JA","locationOptions":[]},{"name":"Knoxville","value":"NOAM-US-TN-KN","locationOptions":[]},{"name":"Memphis","value":"NOAM-US-TN-ME","locationOptions":[]},{"name":"Nashville","value":"NOAM-US-TN-NA","locationOptions":[]}]}]},{"name":"TX","value":"TX","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Abilene","value":"NOAM-US-TX-AB","locationOptions":[]},{"name":"Austin","value":"NOAM-US-TX-AU","locationOptions":[]},{"name":"Bryan","value":"NOAM-US-TX-BR","locationOptions":[]},{"name":"Corpus Christi","value":"NOAM-US-TX-CC","locationOptions":[]},{"name":"Dallas","value":"NOAM-US-TX-DA","locationOptions":[]},{"name":"Denton","value":"NOAM-US-TX-DE","locationOptions":[]},{"name":"El Paso","value":"NOAM-US-TX-EP","locationOptions":[]},{"name":"Fort Worth","value":"NOAM-US-TX-FW","locationOptions":[]},{"name":"Galveston","value":"NOAM-US-TX-GA","locationOptions":[]},{"name":"Hamilton","value":"NOAM-US-TX-HA","locationOptions":[]},{"name":"Houston","value":"NOAM-US-TX-HO","locationOptions":[]},{"name":"Huntsville","value":"NOAM-US-TX-HU","locationOptions":[]},{"name":"Laredo","value":"NOAM-US-TX-LA","locationOptions":[]},{"name":"Lubbock","value":"NOAM-US-TX-LU","locationOptions":[]},{"name":"Odessa","value":"NOAM-US-TX-OD","locationOptions":[]},{"name":"San Antonio","value":"NOAM-US-TX-SA","locationOptions":[]},{"name":"Tyler","value":"NOAM-US-TX-TY","locationOptions":[]}]}]},{"name":"UT","value":"UT","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Salt Lake City","value":"NOAM-US-UT-SL","locationOptions":[]},{"name":"St. George","value":"NOAM-US-UT-SG","locationOptions":[]}]}]},{"name":"VA","value":"VA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Arlington","value":"NOAM-US-VA-AR","locationOptions":[]},{"name":"Lynchburg","value":"NOAM-US-VA-LY","locationOptions":[]},{"name":"Richmond","value":"NOAM-US-VA-RI","locationOptions":[]},{"name":"Roanoke","value":"NOAM-US-VA-RO","locationOptions":[]},{"name":"Virginia Beach","value":"NOAM-US-VA-VB","locationOptions":[]}]}]},{"name":"VT","value":"VT","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Brattleboro","value":"NOAM-US-VT-BR","locationOptions":[]},{"name":"Burlington","value":"NOAM-US-VT-BU","locationOptions":[]},{"name":"Newport","value":"NOAM-US-VT-NE","locationOptions":[]}]}]},{"name":"WI","value":"WI","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Eau Claire","value":"NOAM-US-WI-EC","locationOptions":[]},{"name":"Kenosha","value":"NOAM-US-WI-KE","locationOptions":[]},{"name":"Madison","value":"NOAM-US-WI-MA","locationOptions":[]},{"name":"Milwaukee","value":"NOAM-US-WI-MI","locationOptions":[]}]}]},{"name":"WV","value":"WV","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Charleston","value":"NOAM-US-WV-CH","locationOptions":[]}]}]},{"name":"WY","value":"WY","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Laramie","value":"NOAM-US-WY-LA","locationOptions":[]}]}]}]}}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Request-Context', + 'appId=', + 'MS-CV', + 'zYqyp5H2wUe1K3YfpRcCBw.0', + 'X-Processing-Time', + '425ms', + 'X-Azure-Ref', + '0hOUFYAAAAACQh1I8jmuPQZ6BwuOUgCC+RVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Mon, 18 Jan 2021 19:46:12 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_phoneplangroupid_and_phoneplanid_for_other_tests.js b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_phoneplangroupid_and_phoneplanid_for_other_tests.js index fedcd54f7541..893cc199349a 100644 --- a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_phoneplangroupid_and_phoneplanid_for_other_tests.js +++ b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_phoneplangroupid_and_phoneplanid_for_other_tests.js @@ -1,91 +1,45 @@ -let nock = require("nock"); +let nock = require('nock'); -module.exports.hash = "49dc918822aecfcd2a5b63198b917b34"; +module.exports.hash = "dec4a115d96e27442dce416e17a705bb"; -module.exports.testInfo = { uniqueName: {}, newDate: {} }; +module.exports.testInfo = {"uniqueName":{},"newDate":{}} -nock("https://endpoint", { encodedQueryParams: true }) - .get("/administration/phonenumbers/countries/US/phoneplangroups") +nock('https://endpoint', {"encodedQueryParams":false}) + .get('/administration/phonenumbers/countries/US/phoneplangroups') .query(true) - .reply( - 200, - { - phonePlanGroups: [ - { - phonePlanGroupId: "sanitized", - phoneNumberType: "Geographic", - localizedName: "Azure- User - Geographic", - localizedDescription: "These are numbers used by Azure resources." - }, - { - phonePlanGroupId: "sanitized", - phoneNumberType: "Geographic", - localizedName: "Azure - Geographic", - localizedDescription: "These are numbers used by Azure resources." - }, - { - phonePlanGroupId: "sanitized", - phoneNumberType: "TollFree", - localizedName: "Azure - Toll Free", - localizedDescription: "These are toll free numbers used by Azure resources." - } - ], - nextLink: null - }, - [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "chQ2ac17VkOTug5T1zsfuw.0", - "X-Processing-Time", - "251ms", - "X-Azure-Ref", - "0/Iy4XwAAAABVPhUhRfEtRoR141TnlSqyWVZSMzBFREdFMDMxMQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Sat, 21 Nov 2020 03:43:56 GMT" - ] - ); + .reply(200, {"phonePlanGroups":[{"phonePlanGroupId":"sanitized","phoneNumberType":"Geographic","localizedName":"Azure- User - Geographic","localizedDescription":"These are numbers used by Azure resources."},{"phonePlanGroupId":"sanitized","phoneNumberType":"Geographic","localizedName":"Azure - Geographic","localizedDescription":"These are numbers used by Azure resources."},{"phonePlanGroupId":"sanitized","phoneNumberType":"TollFree","localizedName":"Azure - Toll Free","localizedDescription":"These are toll free numbers used by Azure resources."}],"nextLink":null}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Request-Context', + 'appId=', + 'MS-CV', + 'HKu6PbrTEUejg1blYguRIQ.0', + 'X-Processing-Time', + '412ms', + 'X-Azure-Ref', + '0g+UFYAAAAACy/DlzIxHLTZt8jT1W98YqRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Mon, 18 Jan 2021 19:46:11 GMT' +]); -nock("https://endpoint", { encodedQueryParams: true }) - .get("/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans") +nock('https://endpoint', {"encodedQueryParams":false}) + .get('/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans') .query(true) - .reply( - 200, - { - phonePlans: [ - { - phonePlanId: "sanitized", - localizedName: "Outbound Only PSTN For User - Geographic", - locationType: "Selection", - areaCodes: [], - capabilities: ["Azure", "OutboundCalling", "UserAssignment", "Geographic"], - maximumSearchSize: 20 - }, - { - phonePlanId: "sanitized", - localizedName: "Inbound Only PSTN For User - Geographic", - locationType: "Selection", - areaCodes: [], - capabilities: ["Azure", "InboundCalling", "UserAssignment", "Geographic"], - maximumSearchSize: 20 - } - ], - nextLink: null - }, - [ - "Transfer-Encoding", - "chunked", - "Content-Type", - "application/json; charset=utf-8", - "MS-CV", - "mCmyBprAPkaplV2z/zI9eQ.0", - "X-Processing-Time", - "232ms", - "X-Azure-Ref", - "0/Iy4XwAAAABrWlnJLOQkSapZ1enaKyH3WVZSMzBFREdFMDMxMQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "Date", - "Sat, 21 Nov 2020 03:43:57 GMT" - ] - ); + .reply(200, {"phonePlans":[{"phonePlanId":"sanitized","localizedName":"Outbound Only PSTN For User - Geographic","locationType":"Selection","areaCodes":[],"capabilities":["OutboundCalling","UserAssignment","Geographic"],"maximumSearchSize":20},{"phonePlanId":"sanitized","localizedName":"Inbound Only PSTN For User - Geographic","locationType":"Selection","areaCodes":[],"capabilities":["InboundCalling","UserAssignment","Geographic"],"maximumSearchSize":20}],"nextLink":null}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Request-Context', + 'appId=', + 'MS-CV', + 'cUbpVknoqUepQ45Iwbpkkw.0', + 'X-Processing-Time', + '419ms', + 'X-Azure-Ref', + '0g+UFYAAAAAC++oZC+qGwSrPnaiOrkJ7YRVdSMzBFREdFMDYxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Mon, 18 Jan 2021 19:46:11 GMT' +]); diff --git a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.js b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.js new file mode 100644 index 000000000000..b004c723c099 --- /dev/null +++ b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.js @@ -0,0 +1,58 @@ +let nock = require('nock'); + +module.exports.hash = "327f8adc568814406df75b5dba40ca9d"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://endpoint', {"encodedQueryParams":false}) + .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0Ny8iLCJpYXQiOjE2MTExODcxNzIsIm5iZiI6MTYxMTE4NzE3MiwiZXhwIjoxNjExMjczODcyLCJhaW8iOiJFMkpnWVBpY2x1dy9UVDk5ejIrQlAvcmhrbnYzQXdBPSIsImFwcGlkIjoiNmM4MTgxYzctOTFhNi00ZTJlLTg0ODAtZDU0MDIxYWM0YzRiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsIm9pZCI6IjNlMGM3MTRmLTk3YWMtNGQ2My1hZWFmLTE0YmFhNWUwNjRjYiIsInJoIjoiMC5BUm9BdjRqNWN2R0dyMEdScXkxODBCSGJSOGVCZ1d5bWtTNU9oSURWUUNHc1RFc2FBQUEuIiwic3ViIjoiM2UwYzcxNGYtOTdhYy00ZDYzLWFlYWYtMTRiYWE1ZTA2NGNiIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoiQXRCbmszWWV5a21mckQ3UTRQOFVBQSIsInZlciI6IjEuMCJ9.TiQUDCVYNuJQVmqloZ4u0gP4rS4XaV7HwcpgCbTn994QoIBGGUMKOK-KR8e8U_gifiWGsatnVq9-LTvLq0OjCCuO9UFe-d4UNljyJtSZ2WF_DuchwA4vIzBY1-9CmmXkCpTUfFUsghKEf3UrVXRaDsdnoSKV_exYKMxrkzNNcVAjlgcwvTap5TuUVLmPNv9BWmnf-SfkKNklMdO03jJ9j46BacWf5lToH8gQJ0Q5pAehJQ9hsRDRRB-KZXn4e2CHtzpyxMtnnmbNlD3fIyTI_NMC29qjpWZINJCmSwvxNe_pM0dHwy6VE5P3Mt4fq2t4T0ehSJmmz8HH0Ra7eKBj_Q"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'sanitized', + 'x-ms-ests-server', + '2.1.11419.13 - NCUS ProdSlices', + 'Set-Cookie', + 'fpc=AtQYQhtVXGxAl2HRYGEM9KBWyo4SAwAAAAu8mtcOAAAA; expires=Sat, 20-Feb-2021 00:04:32 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 21 Jan 2021 00:04:32 GMT', + 'Content-Length', + '1327' +]); + +nock('https://endpoint', {"encodedQueryParams":false}) + .get('/administration/phonenumbers/countries/US/phoneplangroups') + .query(true) + .reply(200, {"phonePlanGroups":[{"phonePlanGroupId":"sanitized","phoneNumberType":"Geographic","localizedName":"Azure- User - Geographic","localizedDescription":"These are numbers used by Azure resources."},{"phonePlanGroupId":"sanitized","phoneNumberType":"Geographic","localizedName":"Azure - Geographic","localizedDescription":"These are numbers used by Azure resources."},{"phonePlanGroupId":"sanitized","phoneNumberType":"TollFree","localizedName":"Azure - Toll Free","localizedDescription":"These are toll free numbers used by Azure resources."}],"nextLink":null}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Request-Context', + 'appId=', + 'MS-CV', + '+4uJIAe1x0OvPbKUJMtlUA.0', + 'X-Processing-Time', + '623ms', + 'X-Azure-Ref', + '0EMUIYAAAAAC0o6cAdVC/TbazsMk2AVIfRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + 'Date', + 'Thu, 21 Jan 2021 00:04:32 GMT' +]); diff --git a/sdk/communication/communication-administration/review/communication-administration.api.md b/sdk/communication/communication-administration/review/communication-administration.api.md index b788763378c9..0ed4f3468612 100644 --- a/sdk/communication/communication-administration/review/communication-administration.api.md +++ b/sdk/communication/communication-administration/review/communication-administration.api.md @@ -289,6 +289,7 @@ export interface PageableOptions extends OperationOptions { export class PhoneNumberAdministrationClient { constructor(connectionString: string, options?: PhoneNumberAdministrationClientOptions); constructor(url: string, credential: KeyCredential, options?: PhoneNumberAdministrationClientOptions); + constructor(url: string, credential: TokenCredential, options?: PhoneNumberAdministrationClientOptions); beginPurchaseReservation(reservationId: string, options?: BeginPurchaseReservationOptions): Promise, void>>; beginReleasePhoneNumbers(phoneNumbers: string[], options?: BeginReleasePhoneNumbersOptions): Promise, PhoneNumberRelease>>; beginReservePhoneNumbers(reservationRequest: CreateReservationRequest, options?: BeginReservePhoneNumbersOptions): Promise, PhoneNumberReservation>>; diff --git a/sdk/communication/communication-administration/src/phoneNumber/phoneNumberAdministrationClient.ts b/sdk/communication/communication-administration/src/phoneNumber/phoneNumberAdministrationClient.ts index 0ae1480a9e4d..abb80a5b5ca8 100644 --- a/sdk/communication/communication-administration/src/phoneNumber/phoneNumberAdministrationClient.ts +++ b/sdk/communication/communication-administration/src/phoneNumber/phoneNumberAdministrationClient.ts @@ -3,11 +3,11 @@ /// import { - createCommunicationAccessKeyCredentialPolicy, parseClientArguments, - isKeyCredential + isKeyCredential, + createCommunicationAuthPolicy } from "@azure/communication-common"; -import { KeyCredential } from "@azure/core-auth"; +import { KeyCredential, TokenCredential } from "@azure/core-auth"; import { PipelineOptions, InternalPipelineOptions, @@ -116,9 +116,21 @@ export class PhoneNumberAdministrationClient { options?: PhoneNumberAdministrationClientOptions ); + /** + * Initializes a new instance of the PhoneNumberAdministrationClient class using a TokenCredential. + * @param url The endpoint of the service (ex: https://contoso.eastus.communications.azure.net). + * @param credential TokenCredential that is used to authenticate requests to the service. + * @param options Optional. Options to configure the HTTP pipeline. + */ + public constructor( + url: string, + credential: TokenCredential, + options?: PhoneNumberAdministrationClientOptions + ); + public constructor( connectionStringOrUrl: string, - credentialOrOptions?: KeyCredential | PhoneNumberAdministrationClientOptions, + credentialOrOptions?: KeyCredential | TokenCredential | PhoneNumberAdministrationClientOptions, maybeOptions: PhoneNumberAdministrationClientOptions = {} ) { const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions); @@ -146,7 +158,7 @@ export class PhoneNumberAdministrationClient { } }; - const authPolicy = createCommunicationAccessKeyCredentialPolicy(credential as KeyCredential); + const authPolicy = createCommunicationAuthPolicy(credential); const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); this.client = new PhoneNumberRestClient(url, pipeline).phoneNumberAdministration; } diff --git a/sdk/communication/communication-administration/test/phoneNumberAdministrationClientWithToken.spec.ts b/sdk/communication/communication-administration/test/phoneNumberAdministrationClientWithToken.spec.ts new file mode 100644 index 000000000000..bacef039a026 --- /dev/null +++ b/sdk/communication/communication-administration/test/phoneNumberAdministrationClientWithToken.spec.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { isPlaybackMode, Recorder } from "@azure/test-utils-recorder"; +import { assert } from "chai"; +import { PhoneNumberAdministrationClient } from "../src"; +import { createRecordedPhoneNumberAdministrationClientWithToken } from "./utils/recordedClient"; + +describe("PhoneNumberAdministrationClientWithToken [Playback/Live]", function() { + let recorder: Recorder; + let client: PhoneNumberAdministrationClient; + let includePhoneNumberLiveTests: boolean; + let phonePlanGroupId: string; + let shouldSkip = false; + const countryCode = "US"; + + beforeEach(function() { + const recordedClient = createRecordedPhoneNumberAdministrationClientWithToken(this); + if (!recordedClient) { + shouldSkip = true; + } else { + client = recordedClient.client; + recorder = recordedClient.recorder; + includePhoneNumberLiveTests = recordedClient.includePhoneNumberLiveTests; + } + }); + + afterEach(async function() { + if (!this.currentTest?.isPending()) { + await recorder.stop(); + } + }); + + it("successfully gets phonePlanGroupId", async function() { + if ((!includePhoneNumberLiveTests && !isPlaybackMode()) || shouldSkip) { + this.skip(); + } + + for await (const phonePlanGroup of client.listPhonePlanGroups(countryCode)) { + assert.isString(phonePlanGroup.phonePlanGroupId); + ({ phonePlanGroupId } = phonePlanGroup); + assert.isString(phonePlanGroupId); + break; + } + }).timeout(5000); +}); diff --git a/sdk/communication/communication-administration/test/utils/recordedClient.ts b/sdk/communication/communication-administration/test/utils/recordedClient.ts index 29b59551d743..db0c825aaedd 100644 --- a/sdk/communication/communication-administration/test/utils/recordedClient.ts +++ b/sdk/communication/communication-administration/test/utils/recordedClient.ts @@ -14,6 +14,7 @@ import { import { isNode, TokenCredential } from "@azure/core-http"; import { CommunicationIdentityClient, PhoneNumberAdministrationClient } from "../../src"; import { DefaultAzureCredential } from "@azure/identity"; +import { parseConnectionString } from "@azure/communication-common"; if (isNode) { dotenv.config(); @@ -27,7 +28,6 @@ export interface RecordedClient { const replaceableVariables: { [k: string]: string } = { COMMUNICATION_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana", INCLUDE_PHONENUMBER_LIVE_TESTS: "false", - COMMUNICATION_ENDPOINT: "https://endpoint/", AZURE_CLIENT_ID: "SomeClientId", AZURE_CLIENT_SECRET: "SomeClientSecret", AZURE_TENANT_ID: "SomeTenantId" @@ -81,7 +81,7 @@ export function createRecordedCommunicationIdentityClientWithToken( ): RecordedClient | undefined { const recorder = record(context, environmentSetup); let credential: TokenCredential; - + const endpoint = parseConnectionString(env.COMMUNICATION_CONNECTION_STRING).endpoint; if (isPlaybackMode()) { credential = { getToken: async (_scopes) => { @@ -90,7 +90,7 @@ export function createRecordedCommunicationIdentityClientWithToken( }; return { - client: new CommunicationIdentityClient(env.COMMUNICATION_ENDPOINT, credential), + client: new CommunicationIdentityClient(endpoint, credential), recorder }; } @@ -102,7 +102,7 @@ export function createRecordedCommunicationIdentityClientWithToken( } return { - client: new CommunicationIdentityClient(env.COMMUNICATION_ENDPOINT, credential), + client: new CommunicationIdentityClient(endpoint, credential), recorder }; } @@ -121,6 +121,44 @@ export function createRecordedPhoneNumberAdministrationClient( }; } +export function createRecordedPhoneNumberAdministrationClientWithToken( + context: Context +): + | (RecordedClient & { + includePhoneNumberLiveTests: boolean; + }) + | undefined { + const recorder = record(context, environmentSetup); + let credential: TokenCredential; + const endpoint = parseConnectionString(env.COMMUNICATION_CONNECTION_STRING).endpoint; + + if (isPlaybackMode()) { + credential = { + getToken: async (_scopes) => { + return { token: "testToken", expiresOnTimestamp: 11111 }; + } + }; + + return { + client: new PhoneNumberAdministrationClient(endpoint, credential), + recorder, + includePhoneNumberLiveTests: env.INCLUDE_PHONENUMBER_LIVE_TESTS == "true" + }; + } + + try { + credential = new DefaultAzureCredential(); + } catch { + return undefined; + } + + return { + client: new PhoneNumberAdministrationClient(endpoint, credential), + recorder, + includePhoneNumberLiveTests: env.INCLUDE_PHONENUMBER_LIVE_TESTS == "true" + }; +} + export const testPollerOptions = { pollInterval: isPlaybackMode() ? 0 : undefined }; diff --git a/sdk/communication/communication-administration/tests.yml b/sdk/communication/communication-administration/tests.yml index af3010fa96fd..179db414c2e9 100644 --- a/sdk/communication/communication-administration/tests.yml +++ b/sdk/communication/communication-administration/tests.yml @@ -5,3 +5,7 @@ extends: parameters: PackageName: "@azure/communication-administration" ResourceServiceDirectory: communication + EnvVars: + AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) \ No newline at end of file