From 101ca53fb93db00495187b13187570546f02b922 Mon Sep 17 00:00:00 2001 From: Anu Thomas Chandy Date: Fri, 2 Jul 2021 09:54:08 -0700 Subject: [PATCH 1/2] Rename adminEmails to admins, viewerEmails to viewers & correcting links in README --- .../azure-ai-metricsadvisor/README.md | 3 +- ...tricsAdvisorAdministrationAsyncClient.java | 8 ++-- .../models/DataFeedOptions.java | 40 +++++++++---------- .../models/EmailNotificationHook.java | 8 ++-- .../models/NotificationHook.java | 22 +++++----- .../models/WebNotificationHook.java | 14 ++++--- .../util/DataFeedTransforms.java | 4 +- .../implementation/util/HookHelper.java | 6 +-- .../implementation/util/HookTransforms.java | 12 +++--- .../administration/DatafeedAsyncSample.java | 4 +- .../administration/DatafeedSample.java | 4 +- ...trationAsyncClientJavaDocCodeSnippets.java | 4 +- ...ministrationClientJavaDocCodeSnippets.java | 4 +- .../ai/metricsadvisor/DataFeedTestBase.java | 4 +- .../NotificationHookTestBase.java | 4 +- 15 files changed, 72 insertions(+), 69 deletions(-) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md index e01580cadc367..eb063d40d0104 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md @@ -415,12 +415,13 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK [metrics_advisor_account]: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesMetricsAdvisor [metrics_advisor_doc]: https://docs.microsoft.com/azure/cognitive-services/Metrics-advisor/glossary -[mvn_package]: https://search.maven.org/artifact/com.azure/azure-ai-metricsadvisor/1.0.0-beta.1/jar +[mvn_package]: https://search.maven.org/search?q=a:azure-ai-metricsadvisor [product_documentation]: https://docs.microsoft.com/azure/cognitive-services/metrics-advisor/overview [register_AAD_application]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal [source_code]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/metricsadvisor/azure-ai-metricsadvisor/src [samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples [samples_readme]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/README.md [wiki_identity]: https://github.com/Azure/azure-sdk-for-java/wiki/Identity-and-Authentication +[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%metricsadvisor%2Fazure-ai-metricsadvisor%2FREADME.png) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationAsyncClient.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationAsyncClient.java index 90ca0c750366b..76bac5ba223b3 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationAsyncClient.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationAsyncClient.java @@ -213,8 +213,8 @@ Mono> createDataFeedWithResponse(DataFeed dataFeed, Context c .setFillMissingPointValue(dataFeedMissingDataPointFillSettings.getCustomFillValue()) .setViewMode(ViewMode.fromString(finalDataFeedOptions.getAccessMode() == null ? null : finalDataFeedOptions.getAccessMode().toString())) - .setViewers(finalDataFeedOptions.getViewerEmails()) - .setAdmins(finalDataFeedOptions.getAdminEmails()) + .setViewers(finalDataFeedOptions.getViewers()) + .setAdmins(finalDataFeedOptions.getAdmins()) .setActionLinkTemplate(finalDataFeedOptions.getActionLinkTemplate()), withTracing) .flatMap(createDataFeedResponse -> { final String dataFeedId = @@ -353,8 +353,8 @@ Mono> updateDataFeedWithResponse(DataFeed dataFeed, Context c dataFeedOptions.getAccessMode() != null ? ViewMode.fromString(dataFeedOptions.getAccessMode().toString()) : null) - .setViewers(dataFeedOptions.getViewerEmails()) - .setAdmins(dataFeedOptions.getAdminEmails()) + .setViewers(dataFeedOptions.getViewers()) + .setAdmins(dataFeedOptions.getAdmins()) .setStatus( dataFeed.getStatus() != null ? EntityStatus.fromString(dataFeed.getStatus().toString()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/DataFeedOptions.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/DataFeedOptions.java index c6a486857b535..85afc4f959b6e 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/DataFeedOptions.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/DataFeedOptions.java @@ -17,8 +17,8 @@ public final class DataFeedOptions { private DataFeedRollupSettings dataFeedRollupSettings; private DataFeedMissingDataPointFillSettings dataFeedMissingDataPointFillSettings; private DataFeedAccessMode dataFeedAccessMode; - private List adminEmails; - private List viewerEmails; + private List admins; + private List viewers; private String actionLinkTemplate; /** @@ -86,46 +86,46 @@ public DataFeedOptions setAccessMode(DataFeedAccessMode dataFeedAccessMode) { } /** - * Get the list of data feed administrator emails. + * Get the list of data feed administrator emails and clientIds. * - * @return the adminEmails value. + * @return the admins value. */ - public List getAdminEmails() { - return this.adminEmails == null - ? null : Collections.unmodifiableList(this.adminEmails); + public List getAdmins() { + return this.admins == null + ? null : Collections.unmodifiableList(this.admins); } /** - * Set the list of data feed administrator emails. + * Set the list of data feed administrator emails and clientIds. * - * @param adminEmails the adminEmails value to set. + * @param admins the admins value to set. * * @return the DataFeedOptions object itself. */ - public DataFeedOptions setAdminEmails(List adminEmails) { - this.adminEmails = adminEmails; + public DataFeedOptions setAdmins(List admins) { + this.admins = admins; return this; } /** - * Get the list of data feed viewer emails. + * Get the list of data feed viewer emails and clientIds. * - * @return the viewerEmails value. + * @return the viewers value. */ - public List getViewerEmails() { - return this.viewerEmails == null - ? null : Collections.unmodifiableList(this.viewerEmails); + public List getViewers() { + return this.viewers == null + ? null : Collections.unmodifiableList(this.viewers); } /** - * Set the list of data feed viewer emails. + * Set the list of data feed viewer emails and clientIds. * - * @param viewerEmails the viewerEmails value to set. + * @param viewers the viewers value to set. * * @return the DataFeedOptions object itself. */ - public DataFeedOptions setViewerEmails(List viewerEmails) { - this.viewerEmails = viewerEmails; + public DataFeedOptions setViewers(List viewers) { + this.viewers = viewers; return this; } diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/EmailNotificationHook.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/EmailNotificationHook.java index 7cc67b76e698e..3601f1fd2e717 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/EmailNotificationHook.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/EmailNotificationHook.java @@ -117,13 +117,13 @@ public EmailNotificationHook setExternalLink(String externalLink) { } /** - * Sets the user e-mails with administrative rights to manage the hook. + * Sets the user e-mails and clientIds with administrative rights to manage the hook. * - * @param emails The emails. + * @param emails The emails and clientIds * @return The EmailNotificationHook object itself. */ - public EmailNotificationHook setAdminEmails(List emails) { - super.setAdministratorEmails(emails); + public EmailNotificationHook setAdmins(List emails) { + super.setAdministrators(emails); return this; } diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/NotificationHook.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/NotificationHook.java index 505f262f5d654..e570a413e83a0 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/NotificationHook.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/NotificationHook.java @@ -16,7 +16,7 @@ */ public abstract class NotificationHook { private String id; - private List adminEmails; + private List admins; static { HookHelper.setAccessor(new HookHelper.HookAccessor() { @@ -26,8 +26,8 @@ public void setId(NotificationHook hook, String id) { } @Override - public List getAdminEmailsRaw(NotificationHook hook) { - return hook.getAdminEmailsRaw(); + public List getAdminsRaw(NotificationHook hook) { + return hook.getAdminsRaw(); } @Override @@ -66,13 +66,13 @@ public String getId() { public abstract String getDescription(); /** - * The list of user e-mails with administrative rights to manage the hook. + * Gets the list of user e-mails and clientIds with administrative rights to manage the hook. * * @return The emails of admins. */ - public List getAdminEmails() { - if (this.adminEmails != null) { - return Collections.unmodifiableList(this.adminEmails); + public List getAdmins() { + if (this.admins != null) { + return Collections.unmodifiableList(this.admins); } else { return Collections.emptyList(); } @@ -82,13 +82,13 @@ private void setId(String id) { this.id = id; } - private List getAdminEmailsRaw() { + private List getAdminsRaw() { // Getter that won't translate null admin-emails to empty-list. - return this.adminEmails; + return this.admins; } - void setAdministratorEmails(List emails) { - this.adminEmails = emails != null ? dedupe(emails) : null; + void setAdministrators(List emails) { + this.admins = emails != null ? dedupe(emails) : null; } /** diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/WebNotificationHook.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/WebNotificationHook.java index f8cdf95ae1d50..16323bd2f5cef 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/WebNotificationHook.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/models/WebNotificationHook.java @@ -54,7 +54,8 @@ public String getEndpoint() { } /** - * Gets the external link. + * Gets the external link url, this will be included in the notification sent to the users, + * this is usually a reference to any troubleshooting guide. * * @return The external link. */ @@ -145,7 +146,8 @@ public WebNotificationHook setDescription(String description) { } /** - * Sets the customized external link. + * Sets the customized external link, it will be included in the notification sent to the users, + * this is usually a reference to any troubleshooting guide. * * @param externalLink The customized link. * @return The WebNotificationHook object itself. @@ -193,13 +195,13 @@ public WebNotificationHook setHttpHeaders(HttpHeaders httpHeaders) { } /** - * Sets the user e-mails with administrative rights to manage the hook. + * Sets the user e-mails and clientIds with administrative rights to manage the hook. * - * @param emails The emails. + * @param emails The emails and clientIds * @return The WebNotificationHook object itself. */ - public WebNotificationHook setAdminEmails(List emails) { - super.setAdministratorEmails(emails); + public WebNotificationHook setAdmins(List emails) { + super.setAdministrators(emails); return this; } diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/DataFeedTransforms.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/DataFeedTransforms.java index a6f66075a1736..589c3494214cc 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/DataFeedTransforms.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/DataFeedTransforms.java @@ -127,14 +127,14 @@ public static DataFeed fromInner(final DataFeedDetail dataFeedDetail) { .setFillType(DataFeedMissingDataPointFillType.fromString( dataFeedDetail.getFillMissingPointType().toString()))) .setAccessMode(DataFeedAccessMode.fromString(dataFeedDetail.getViewMode().toString())) - .setAdminEmails(dataFeedDetail.getAdmins()) + .setAdmins(dataFeedDetail.getAdmins()) .setRollupSettings(new DataFeedRollupSettings() .setAlreadyRollup(dataFeedDetail.getAllUpIdentification()) .setAutoRollup(DataFeedAutoRollUpMethod.fromString(dataFeedDetail.getRollUpMethod().toString()), dataFeedDetail.getRollUpColumns()) .setRollupType(DataFeedRollupType.fromString(dataFeedDetail.getNeedRollup().toString()))) .setActionLinkTemplate(dataFeedDetail.getActionLinkTemplate()) - .setViewerEmails(dataFeedDetail.getViewers())); + .setViewers(dataFeedDetail.getViewers())); DataFeedHelper.setId(dataFeed, dataFeedDetail.getDataFeedId().toString()); DataFeedHelper.setCreatedTime(dataFeed, dataFeedDetail.getCreatedTime()); diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/HookHelper.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/HookHelper.java index 9128b06b5274e..5516b6cc24512 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/HookHelper.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/HookHelper.java @@ -23,7 +23,7 @@ private HookHelper() { } */ public interface HookAccessor { void setId(NotificationHook hook, String id); - List getAdminEmailsRaw(NotificationHook hook); + List getAdminsRaw(NotificationHook hook); List getEmailsToAlertRaw(EmailNotificationHook emailHook); HttpHeaders getHttpHeadersRaw(WebNotificationHook webHook); } @@ -41,8 +41,8 @@ public static void setId(NotificationHook hook, String id) { accessor.setId(hook, id); } - public static List getAdminEmailsRaw(NotificationHook hook) { - return accessor.getAdminEmailsRaw(hook); + public static List getAdminsRaw(NotificationHook hook) { + return accessor.getAdminsRaw(hook); } public static List getEmailsToAlertRaw(EmailNotificationHook emailHook) { diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/HookTransforms.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/HookTransforms.java index 39e33e00dc826..a3917d6f6af7c 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/HookTransforms.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/implementation/util/HookTransforms.java @@ -56,7 +56,7 @@ public static HookInfo toInnerForCreate(ClientLogger logger, NotificationHook no innerEmailHook.setHookParameter(new EmailHookParameter() .setToList(emailsToAlert)); } - innerEmailHook.setAdmins(HookHelper.getAdminEmailsRaw(emailHook)); + innerEmailHook.setAdmins(HookHelper.getAdminsRaw(emailHook)); return innerEmailHook; } else if (notificationHook instanceof WebNotificationHook) { WebNotificationHook webHook = (WebNotificationHook) notificationHook; @@ -82,7 +82,7 @@ public static HookInfo toInnerForCreate(ClientLogger logger, NotificationHook no if (headers != null) { hookParameter.setHeaders(headers.toMap()); } - innerWebHook.setAdmins(HookHelper.getAdminEmailsRaw(webHook)); + innerWebHook.setAdmins(HookHelper.getAdminsRaw(webHook)); innerWebHook.setHookParameter(hookParameter); return innerWebHook; } else { @@ -104,7 +104,7 @@ public static HookInfoPatch toInnerForUpdate(ClientLogger logger, NotificationHo innerEmailHook.setHookParameter(new EmailHookParameterPatch() .setToList(emailsToAlert)); } - innerEmailHook.setAdmins(HookHelper.getAdminEmailsRaw(emailHook)); + innerEmailHook.setAdmins(HookHelper.getAdminsRaw(emailHook)); return innerEmailHook; } else if (notificationHook instanceof WebNotificationHook) { WebNotificationHook webHook = (WebNotificationHook) notificationHook; @@ -123,7 +123,7 @@ public static HookInfoPatch toInnerForUpdate(ClientLogger logger, NotificationHo hookParameter.setHeaders(headers.toMap()); } innerWebHook.setHookParameter(hookParameter); - innerWebHook.setAdmins(HookHelper.getAdminEmailsRaw(webHook)); + innerWebHook.setAdmins(HookHelper.getAdminsRaw(webHook)); return innerWebHook; } else { throw logger @@ -143,7 +143,7 @@ public static NotificationHook fromInner(ClientLogger logger, HookInfo innerHook HookHelper.setId(emailHook, innerEmailHook.getHookId().toString()); - emailHook.setAdminEmails(innerEmailHook.getAdmins()); + emailHook.setAdmins(innerEmailHook.getAdmins()); return emailHook; } else if (innerHook instanceof WebhookHookInfo) { @@ -167,7 +167,7 @@ public static NotificationHook fromInner(ClientLogger logger, HookInfo innerHook HookHelper.setId(webHook, innerWebHook.getHookId().toString()); - webHook.setAdminEmails(innerWebHook.getAdmins()); + webHook.setAdmins(innerWebHook.getAdmins()); return webHook; } else { diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/DatafeedAsyncSample.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/DatafeedAsyncSample.java index 7f0b38a1e9414..c10652607cf6d 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/DatafeedAsyncSample.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/DatafeedAsyncSample.java @@ -97,14 +97,14 @@ public static void main(String[] args) { Mono updateDataFeedMono = fetchDataFeedMono .flatMap(dataFeed -> { return advisorAdministrationAsyncClient.updateDataFeed(dataFeed - .setOptions(new DataFeedOptions().setAdminEmails(Collections.singletonList("admin1@admin.com")))) + .setOptions(new DataFeedOptions().setAdmins(Collections.singletonList("admin1@admin.com")))) .doOnSubscribe(__ -> System.out.printf("Updating data feed: %s%n", dataFeed.getId())) .doOnSuccess(updatedDataFeed -> { System.out.printf("Updated data feed%n"); System.out.printf("Updated data feed admin list: %s%n", - String.join(",", updatedDataFeed.getOptions().getAdminEmails())); + String.join(",", updatedDataFeed.getOptions().getAdmins())); }); }); diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/DatafeedSample.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/DatafeedSample.java index a3a63c36eed12..f91c705b25b53 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/DatafeedSample.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/DatafeedSample.java @@ -80,10 +80,10 @@ public static void main(String[] args) { // Update the data feed. System.out.printf("Updating data feed: %s%n", dataFeed.getId()); dataFeed = advisorAdministrationClient.updateDataFeed(dataFeed.setOptions(new DataFeedOptions() - .setAdminEmails(Collections.singletonList("admin1@admin.com")) + .setAdmins(Collections.singletonList("admin1@admin.com")) )); System.out.printf("Updated data feed admin list: %s%n", - String.join(",", dataFeed.getOptions().getAdminEmails())); + String.join(",", dataFeed.getOptions().getAdmins())); // Delete the data feed. System.out.printf("Deleting data feed: %s%n", dataFeed.getId()); diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationAsyncClientJavaDocCodeSnippets.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationAsyncClientJavaDocCodeSnippets.java index 5c4651b5e41c5..20a4c4adbe984 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationAsyncClientJavaDocCodeSnippets.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationAsyncClientJavaDocCodeSnippets.java @@ -538,7 +538,7 @@ public void listHooksWithOptions() { System.out.printf("Email Hook Description: %s%n", emailHook.getDescription()); System.out.printf("Email Hook External Link: %s%n", emailHook.getExternalLink()); System.out.printf("Email Hook Emails: %s%n", String.join(",", emailHook.getEmailsToAlert())); - System.out.printf("Email Hook Admins: %s%n", String.join(",", emailHook.getAdminEmails())); + System.out.printf("Email Hook Admins: %s%n", String.join(",", emailHook.getAdmins())); } else if (notificationHook instanceof WebNotificationHook) { WebNotificationHook webHook = (WebNotificationHook) notificationHook; System.out.printf("Web Hook Id: %s%n", webHook.getId()); @@ -547,7 +547,7 @@ public void listHooksWithOptions() { System.out.printf("Web Hook External Link: %s%n", webHook.getExternalLink()); System.out.printf("Web Hook Endpoint: %s%n", webHook.getEndpoint()); System.out.printf("Web Hook Headers: %s%n", webHook.getHttpHeaders()); - System.out.printf("Web Hook Admins: %s%n", String.join(",", webHook.getAdminEmails())); + System.out.printf("Web Hook Admins: %s%n", String.join(",", webHook.getAdmins())); } } }); diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationClientJavaDocCodeSnippets.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationClientJavaDocCodeSnippets.java index e8782cc50dbb4..cac4b8850e27a 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationClientJavaDocCodeSnippets.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationClientJavaDocCodeSnippets.java @@ -523,7 +523,7 @@ public void listHooksWithOptions() { System.out.printf("Email Hook External Link: %s%n", emailHook.getExternalLink()); System.out.printf("Email Hook Emails: %s%n", String.join(",", emailHook.getEmailsToAlert())); - System.out.printf("Email Hook Admins: %s%n", String.join(",", emailHook.getAdminEmails())); + System.out.printf("Email Hook Admins: %s%n", String.join(",", emailHook.getAdmins())); } else if (notificationHook instanceof WebNotificationHook) { WebNotificationHook webHook = (WebNotificationHook) notificationHook; System.out.printf("Web Hook Id: %s%n", webHook.getId()); @@ -532,7 +532,7 @@ public void listHooksWithOptions() { System.out.printf("Web Hook External Link: %s%n", webHook.getExternalLink()); System.out.printf("Web Hook Endpoint: %s%n", webHook.getEndpoint()); System.out.printf("Web Hook Headers: %s%n", webHook.getHttpHeaders()); - System.out.printf("Web Hook Admins: %s%n", String.join(",", webHook.getAdminEmails())); + System.out.printf("Web Hook Admins: %s%n", String.join(",", webHook.getAdmins())); } } }); diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/test/java/com/azure/ai/metricsadvisor/DataFeedTestBase.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/test/java/com/azure/ai/metricsadvisor/DataFeedTestBase.java index 80113ebc19486..f9a9edf1f3c02 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/test/java/com/azure/ai/metricsadvisor/DataFeedTestBase.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/test/java/com/azure/ai/metricsadvisor/DataFeedTestBase.java @@ -310,8 +310,8 @@ private void validateDataFeedOptions(DataFeedOptions expectedOptions, DataFeedOp if (expectedOptions != null) { assertEquals(expectedOptions.getDescription(), actualOptions.getDescription()); assertEquals(expectedOptions.getActionLinkTemplate(), actualOptions.getActionLinkTemplate()); - assertIterableEquals(expectedOptions.getAdminEmails(), actualOptions.getAdminEmails()); - assertIterableEquals(expectedOptions.getViewerEmails(), actualOptions.getViewerEmails()); + assertIterableEquals(expectedOptions.getAdmins(), actualOptions.getAdmins()); + assertIterableEquals(expectedOptions.getViewers(), actualOptions.getViewers()); assertNotNull(actualOptions.getAccessMode()); if (expectedOptions.getAccessMode() != null) { assertEquals(expectedOptions.getAccessMode(), actualOptions.getAccessMode()); diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/test/java/com/azure/ai/metricsadvisor/NotificationHookTestBase.java b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/test/java/com/azure/ai/metricsadvisor/NotificationHookTestBase.java index 3d16d39fc4ffb..de3ac6eb49b6c 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/src/test/java/com/azure/ai/metricsadvisor/NotificationHookTestBase.java +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/src/test/java/com/azure/ai/metricsadvisor/NotificationHookTestBase.java @@ -43,7 +43,7 @@ protected void assertCreateEmailHookOutput(NotificationHook notificationHook) { Assertions.assertTrue(notificationHook instanceof EmailNotificationHook); EmailNotificationHook emailHook = (EmailNotificationHook) notificationHook; Assertions.assertNotNull(emailHook.getId()); - Assertions.assertNotNull(emailHook.getAdminEmails()); + Assertions.assertNotNull(emailHook.getAdmins()); Assertions.assertNotNull(emailHook.getName()); Assertions.assertEquals(CreateEmailHookInput.INSTANCE.description, emailHook.getDescription()); Assertions.assertEquals(CreateEmailHookInput.INSTANCE.externalLink, emailHook.getExternalLink()); @@ -82,7 +82,7 @@ protected void assertCreateWebHookOutput(NotificationHook notificationHook) { Assertions.assertTrue(notificationHook instanceof WebNotificationHook); WebNotificationHook webHook = (WebNotificationHook) notificationHook; Assertions.assertNotNull(webHook.getId()); - Assertions.assertNotNull(webHook.getAdminEmails()); + Assertions.assertNotNull(webHook.getAdmins()); Assertions.assertNotNull(webHook.getName()); Assertions.assertEquals(CreateWebHookInput.INSTANCE.description, webHook.getDescription()); Assertions.assertEquals(CreateWebHookInput.INSTANCE.externalLink, webHook.getExternalLink()); From d11b521336f755ea0ea26a36a93e4499a193b4ab Mon Sep 17 00:00:00 2001 From: Anu Thomas Chandy Date: Fri, 2 Jul 2021 09:59:54 -0700 Subject: [PATCH 2/2] Remove duplicate logging ref in readme --- sdk/metricsadvisor/azure-ai-metricsadvisor/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md index eb063d40d0104..c266537797ffe 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md @@ -422,6 +422,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples [samples_readme]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/metricsadvisor/azure-ai-metricsadvisor/src/samples/README.md [wiki_identity]: https://github.com/Azure/azure-sdk-for-java/wiki/Identity-and-Authentication -[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%metricsadvisor%2Fazure-ai-metricsadvisor%2FREADME.png)