-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[communication] update new phone numbers client #13560
[communication] update new phone numbers client #13560
Conversation
Co-authored-by: Dominik <[email protected]>
Co-authored-by: Dominik <[email protected]>
…Client.ts Co-authored-by: Dominik <[email protected]>
…Client.ts Co-authored-by: Dominik <[email protected]>
…Client.ts Co-authored-by: Dominik <[email protected]>
…pt/README.md Co-authored-by: Dominik <[email protected]>
…pt/README.md Co-authored-by: Dominik <[email protected]>
…pt/README.md Co-authored-by: Dominik <[email protected]>
…pt/README.md Co-authored-by: Dominik <[email protected]>
…Client.ts Co-authored-by: Dominik <[email protected]>
Co-authored-by: Dominik <[email protected]>
…Client.ts Co-authored-by: Dominik <[email protected]>
…ign-phone-number-client
…Azure/azure-sdk-for-js into redesign-phone-number-client
…Azure/azure-sdk-for-js into redesign-phone-number-client
acquiredPhoneNumber, | ||
update | ||
); | ||
const phoneNumber = await updatePoller.pollUntilDone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still working on the LROs. This actually works in node but fails in the browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great progress!!
Left some comments but feel free to merge and iterate.
@@ -30,7 +30,7 @@ | |||
"lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-phone-numbers-lintReport.html || exit 0", | |||
"pack": "npm pack 2>&1", | |||
"prebuild": "npm run clean", | |||
"test": "npm run build:test && npm run unit-test && npm run integration-test", | |||
"test": "rimraf dist-test && npm run build:test && npm run unit-test && npm run integration-test", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we need to add rimraf here?
export interface AcquiredPhoneNumberUpdate { | ||
applicationId?: string; | ||
callbackUri?: string; | ||
purchaseDate?: Date; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up: These will change again in a future swagger, applicationId
and callbackUri
are going away, cost
and purchaseDate
will become required.
// @public (undocumented) | ||
export type ListPhoneNumbersOptions = OperationOptions; | ||
// @public | ||
export const enum KnownBillingFrequency { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this Known
prefix come from?
} | ||
|
||
// @public | ||
export const enum KnownPhoneNumberType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did autorest change how it models extensible enums? I would have expected string unions (and prefer them from a TS language perspective :-( )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea this changed with the version of autorest/ts I got to fix the LRO problem.
@@ -243,23 +158,14 @@ export class PhoneNumbersClient { | |||
*/ | |||
public listPhoneNumbers( | |||
options: ListPhoneNumbersOptions = {} | |||
): PagedAsyncIterableIterator<AcquiredPhoneNumber> { | |||
): PagedAsyncIterableIterator<AcquiredPhoneNumber, AcquiredPhoneNumber[], PageSettings> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I look at PagedAsyncIterableIterator
, the second and third value are T[] and PageSettings by default, so this should still be the same as PagedAsyncIterableIterator<AcquiredPhoneNumber>
sms: "inbound+outbound", | ||
calling: "none" | ||
}, | ||
areaCode: "844" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment. If the service keeps giving out of stock errors, we should not specify an area code and let the service pick one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service requires an area code to be sent though ¯_(ツ)_/¯
} | ||
|
||
const quantity = 2; | ||
searchRequest.quantity = quantity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: instead of modifying the searchRequest that's shared across tests I'd spread it and modify quantity, so on line 61
{...searchRequest, quantity: 2}
}; | ||
}; | ||
|
||
// Fisher-Yates Shuffle algo implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, overkill but okay. Used to be one of the easier interview questions I asked.
export const getPhoneNumberHttpClient: HttpClient = createMockHttpClient<AcquiredPhoneNumber>(200, { | ||
id: "+18005550100", | ||
phoneNumber: "+18005550100", | ||
countryCode: "US", | ||
phoneNumberType: "geographic", | ||
assignmentType: "person", | ||
assignmentType: "user", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh, this should still be "person". Need to follow up with service folks
recording.replace(/\/identities\/[^\/'",]*/, "/identities/sanitized"), | ||
(recording: string): string => recording.replace(/\+\d{1}\d{3}\d{3}\d{4}/g, "+18005551234"), | ||
(recording: string): string => recording.replace(/(https:\/\/)([^\/'",}]*)/, "$1endpoint"), | ||
(recording: string): string => recording.replace(/\d{1}\d{3}\d{3}\d{4}/g, "14155550100"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning this up and removing the unused bits 👍
* [communication] new phone numbers package (#13349) * [communication] update new phone numbers client (#13560) * [communication] disable extensible enums (#13806) * [communication] new phone numbers package (#13349) * [communication] update new phone numbers client (#13560) * [communication] disable extensible enums (#13806) * [communication] add samples to readme (#13957) * [communication] regenerate client from latest swagger (#13976) * regenerate client from latest swagger * update autorest/ts version also validates that change to lro code from regen does not break lros that worked before * add space * get lock file from master and build * Update package.json * rebuild
Merge Dev-containerservice-microsoft.containerservice-2021-03-01 API to master (Azure#13737) * Adds base for updating Microsoft.ContainerService from version stable/2021-02-01 to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * fix the top swagger offenses caused by privateLinkResources, enableCSIProxy and OSDiskSize range (Azure#13349) Co-authored-by: Charlie Li <[email protected]> * Add enableFIPS property to 2021-03-01 API in dev 2021-03-01 branch (Azure#13359) * fix the top swagger offenses caused by privateLinkResources, enableCSIProxy and OSDiskSize range * Add enableFIPS property to the 2021-03-01 API * Add enableFIPS property to the 2021-03-01 API Co-authored-by: Charlie Li <[email protected]> * adding node-image upgrade channel enum (Azure#13375) Co-authored-by: Charlie McBride <[email protected]> * Add httpProxyConfig specs to 2021-03-01 API - dev (Azure#13410) * Add httpProxyConfig specs to 2021-03-01 API - dev * Fix prettier * aks: add `bindingSelector` to managed cluster pod identity profile (Azure#13399) * AKS runCommand new feature (Azure#13420) * runCommand target to 03-01 * fix api-version in examples * Add property disableLocalAccounts to 2021-03-01 API version (Azure#13385) * Add property disableLocalAccounts * Fix indentation * Add OSSKU and GPUInstanceProfile to containerservice/microsoft.container API 2021-03-01 (Azure#13532) * Add OSSKU and GPUInstanceProfile * Add sample for OSSKU and GPUInstanceProfile * Fix custom words * Reference sample files * update custom-words * Update readme for sdks (Azure#13515) * update readme for sdks * update readme for sdks Co-authored-by: Charlie Li <[email protected]> * Add example to create agent pool with FIPS enabled (Azure#13557) * add example to create agent pool with FIPS enabled * change a property name in the example file Co-authored-by: Charlie Li <[email protected]> * Added extended location parameter to managed cluster which will target all agent pools to that extended location. (Azure#13560) * Add data model for get OS options. (Azure#13619) * Add data model for get OS options. * Add default resource name in API path. * Fix container service tags. (Azure#13739) Co-authored-by: Tongyao Si <[email protected]> Co-authored-by: Charlie Li <[email protected]> Co-authored-by: Charlie McBride <[email protected]> Co-authored-by: Charlie McBride <[email protected]> Co-authored-by: Bo Wang <[email protected]> Co-authored-by: hbc <[email protected]> Co-authored-by: Haitao Chen <[email protected]> Co-authored-by: Tony Xu <[email protected]> Co-authored-by: Mirza Sikander <[email protected]> Co-authored-by: Jun Sun <[email protected]>
This PR:
areaCode
a required member ofPhoneNumberSearchRequest
NB
PR does not include test recordings to reduce noise.