-
Notifications
You must be signed in to change notification settings - Fork 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] - SMS - Refactor SMS SDK and add *withResponse methods #19666
Conversation
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.
Changes looks good. General Question: Do we need to apply this 'withResponse' method to other langs sdks?
...ation-sms/src/samples/java/com/azure/communication/sms/samples/quickstart/ReadmeSamples.java
Show resolved
Hide resolved
...tion/azure-communication-sms/src/main/java/com/azure/communication/sms/SmsClientBuilder.java
Show resolved
Hide resolved
.../test/resources/session-records/SmsAsyncClientTests.sendSmsToSingleNumberWithOptions[1].json
Show resolved
Hide resolved
...ation-sms/src/samples/java/com/azure/communication/sms/samples/quickstart/ReadmeSamples.java
Outdated
Show resolved
Hide resolved
|
...cation/azure-communication-sms/src/main/java/com/azure/communication/sms/SmsAsyncClient.java
Show resolved
Hide resolved
...n/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsAsyncClientTests.java
Outdated
Show resolved
Hide resolved
public void sendSmsToGroup(HttpClient httpClient) { | ||
// Arrange | ||
SmsClientBuilder builder = getSmsClient(httpClient); | ||
client = setupSyncClient(builder, "sendSmsToGroupSync"); |
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.
name should be without Sync
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.
For all the Sync test cases, I've put "Sync" so that we can differentiate it from the async test cases. I didn't think it was necessary to suffix all the Async test cases with "Async" since it's a blit clunky.
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.
how does this work in other sdks? i would've thought the default was sync, and async needs to be specified.
I'm ok as long as it's consistent
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've named it with the same convention with the other SDKs as well :)
...cation/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsClientTests.java
Show resolved
Hide resolved
...cation/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsClientTests.java
Show resolved
Hide resolved
...cation/azure-communication-sms/src/main/java/com/azure/communication/sms/SmsAsyncClient.java
Outdated
Show resolved
Hide resolved
...cation/azure-communication-sms/src/main/java/com/azure/communication/sms/SmsAsyncClient.java
Outdated
Show resolved
Hide resolved
...tion/azure-communication-sms/src/main/java/com/azure/communication/sms/SmsClientBuilder.java
Outdated
Show resolved
Hide resolved
/azp run java - communication - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
|
||
### Azure Active Directory Token Authentication | ||
A `DefaultAzureCredential` object must be passed to the `SmsClientBuilder` via the credential() function. Endpoint and httpClient must also be set via the endpoint() and httpClient() functions respectively. |
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 ok using the DefaultAzureCredential as our example, but this statement makes me think we can only use DefaultAzureCredential. The .net readme has "SMS clients can also be authenticated using a valid token credential." So maybe something more like that?
SmsClient smsClient = new SmsClientBuilder() | ||
.connectionString(connectionString) | ||
.httpClient(httpClient) | ||
.buildClient(); | ||
``` | ||
|
||
## Key concepts | ||
|
||
There are two different forms of authentication to use the Azure Communication SMS Service. |
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.
this should be before instead of after the auth section
This PR updates: