From bb569c38d82d27830abfdacca7aa33645cd0e94a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 15 Mar 2024 04:49:46 -0400 Subject: [PATCH] [Automation] Generate Fluent Lite from newrelic#package-2024-01-01 (#39247) * [Automation] External Change * [Automation] Generate Fluent Lite from newrelic#package-2024-01-01 --- eng/versioning/version_client.txt | 2 +- .../CHANGELOG.md | 71 +- .../README.md | 10 +- .../SAMPLE.md | 955 ++++---- .../pom.xml | 6 +- .../NewRelicObservabilityManager.java | 148 +- .../fluent/AccountsClient.java | 8 +- .../fluent/BillingInfoesClient.java | 43 + .../ConnectedPartnerResourcesClient.java | 45 + .../fluent/MonitoredSubscriptionsClient.java | 272 +++ .../fluent/MonitorsClient.java | 185 +- .../fluent/NewRelicObservability.java | 47 +- .../fluent/OperationsClient.java | 16 +- .../fluent/OrganizationsClient.java | 8 +- .../fluent/PlansClient.java | 8 +- .../fluent/TagRulesClient.java | 72 +- .../fluent/models/AccountProperties.java | 32 +- .../fluent/models/AccountResourceInner.java | 34 +- .../fluent/models/AppServiceInfoInner.java | 22 +- .../models/BillingInfoResponseInner.java | 88 + ...nectedPartnerResourcesListFormatInner.java | 58 + .../fluent/models/LinkedResourceInner.java | 54 + .../fluent/models/MetricRulesInner.java | 22 +- .../models/MetricsStatusResponseInner.java | 14 +- .../fluent/models/MonitorProperties.java | 94 +- .../fluent/models/MonitoredResourceInner.java | 30 +- .../models/MonitoredSubscriptionInner.java | 136 ++ .../MonitoredSubscriptionPropertiesInner.java | 61 + .../MonitoringTagRulesPropertiesInner.java | 20 +- .../models/NewRelicMonitorResourceInner.java | 114 +- ...wRelicMonitorResourceUpdateProperties.java | 38 +- .../fluent/models/OperationInner.java | 22 +- .../fluent/models/OrganizationProperties.java | 22 +- .../models/OrganizationResourceInner.java | 26 +- .../fluent/models/PlanDataProperties.java | 22 +- .../fluent/models/PlanDataResourceInner.java | 26 +- .../fluent/models/TagRuleInner.java | 29 +- .../fluent/models/TagRuleUpdateInner.java | 20 +- .../models/TagRuleUpdatePropertiesInner.java | 18 +- .../models/VMExtensionPayloadInner.java | 14 +- .../fluent/models/VMInfoInner.java | 22 +- .../fluent/models/package-info.java | 5 +- .../fluent/package-info.java | 5 +- .../implementation/AccountResourceImpl.java | 3 +- .../implementation/AccountsClientImpl.java | 191 +- .../implementation/AccountsImpl.java | 7 +- .../implementation/AppServiceInfoImpl.java | 3 +- .../BillingInfoResponseImpl.java | 38 + .../BillingInfoesClientImpl.java | 188 ++ .../implementation/BillingInfoesImpl.java | 57 + .../ConnectedPartnerResourcesClientImpl.java | 312 +++ .../ConnectedPartnerResourcesImpl.java | 50 + ...nnectedPartnerResourcesListFormatImpl.java | 33 + .../implementation/LinkedResourceImpl.java | 32 + .../implementation/MetricRulesImpl.java | 3 +- .../MetricsStatusResponseImpl.java | 3 +- .../implementation/MonitoredResourceImpl.java | 3 +- .../MonitoredSubscriptionImpl.java | 52 + .../MonitoredSubscriptionPropertiesImpl.java | 120 + .../MonitoredSubscriptionsClientImpl.java | 1299 +++++++++++ .../MonitoredSubscriptionsImpl.java | 169 ++ .../MonitoringTagRulesPropertiesImpl.java | 3 +- .../implementation/MonitorsClientImpl.java | 2076 +++++++---------- .../implementation/MonitorsImpl.java | 193 +- .../NewRelicMonitorResourceImpl.java | 88 +- .../NewRelicObservabilityBuilder.java | 46 +- .../NewRelicObservabilityImpl.java | 175 +- .../implementation/OperationImpl.java | 3 +- .../implementation/OperationsClientImpl.java | 167 +- .../implementation/OperationsImpl.java | 7 +- .../OrganizationResourceImpl.java | 3 +- .../OrganizationsClientImpl.java | 198 +- .../implementation/OrganizationsImpl.java | 7 +- .../implementation/PlanDataResourceImpl.java | 3 +- .../implementation/PlansClientImpl.java | 201 +- .../implementation/PlansImpl.java | 7 +- .../{Utils.java => ResourceManagerUtils.java} | 45 +- .../implementation/TagRuleImpl.java | 59 +- .../implementation/TagRuleUpdateImpl.java | 3 +- .../TagRuleUpdatePropertiesImpl.java | 3 +- .../implementation/TagRulesClientImpl.java | 727 ++---- .../implementation/TagRulesImpl.java | 132 +- .../VMExtensionPayloadImpl.java | 3 +- .../implementation/VMInfoImpl.java | 3 +- .../implementation/package-info.java | 5 +- .../models/AccountCreationSource.java | 18 +- .../models/AccountInfo.java | 28 +- .../models/AccountResource.java | 24 +- .../models/Accounts.java | 8 +- .../models/AccountsListResponse.java | 23 +- .../models/ActionType.java | 14 +- .../models/AppServiceInfo.java | 12 +- .../models/AppServicesGetRequest.java | 23 +- .../models/AppServicesListResponse.java | 23 +- .../models/BillingCycle.java | 22 +- .../models/BillingInfoResponse.java | 33 + .../models/BillingInfoes.java | 38 + .../models/BillingSource.java | 18 +- .../models/ConfigurationName.java | 48 + .../ConnectedPartnerResourceProperties.java | 132 ++ .../models/ConnectedPartnerResources.java | 40 + .../ConnectedPartnerResourcesListFormat.java | 27 + ...ConnectedPartnerResourcesListResponse.java | 85 + .../models/FilteringTag.java | 18 +- .../models/HostsGetRequest.java | 23 +- .../models/LiftrResourceCategories.java | 18 +- .../models/LinkedResource.java | 26 + .../models/LinkedResourceListResponse.java | 85 + .../models/LogRules.java | 38 +- .../models/ManagedServiceIdentity.java | 47 +- .../models/ManagedServiceIdentityType.java | 30 +- .../models/MarketplaceSaaSInfo.java | 160 ++ .../models/MarketplaceSubscriptionStatus.java | 14 +- .../models/MetricRules.java | 12 +- .../models/MetricsRequest.java | 19 +- .../models/MetricsStatusRequest.java | 23 +- .../models/MetricsStatusResponse.java | 8 +- .../models/MonitoredResource.java | 16 +- .../models/MonitoredResourceListResponse.java | 24 +- .../models/MonitoredSubscription.java | 47 + .../MonitoredSubscriptionProperties.java | 187 ++ .../MonitoredSubscriptionPropertiesList.java | 85 + .../models/MonitoredSubscriptions.java | 148 ++ .../models/MonitoringStatus.java | 18 +- .../models/MonitoringTagRulesProperties.java | 12 +- .../models/Monitors.java | 139 +- .../models/MonitorsSwitchBillingHeaders.java | 12 +- .../models/MonitorsSwitchBillingResponse.java | 16 +- .../models/NewRelicAccountProperties.java | 26 +- .../models/NewRelicMonitorResource.java | 329 ++- .../NewRelicMonitorResourceListResult.java | 24 +- .../models/NewRelicMonitorResourceUpdate.java | 44 +- .../NewRelicSingleSignOnProperties.java | 26 +- .../models/Operation.java | 16 +- .../models/OperationDisplay.java | 18 +- .../models/OperationListResult.java | 14 +- .../models/Operations.java | 16 +- .../models/OrgCreationSource.java | 18 +- .../models/OrganizationInfo.java | 14 +- .../models/OrganizationResource.java | 20 +- .../models/Organizations.java | 8 +- .../models/OrganizationsListResponse.java | 23 +- .../newrelicobservability/models/Origin.java | 18 +- .../models/PartnerBillingEntity.java | 80 + .../models/PatchOperation.java | 68 + .../models/PlanData.java | 26 +- .../models/PlanDataListResponse.java | 23 +- .../models/PlanDataResource.java | 20 +- .../newrelicobservability/models/Plans.java | 8 +- .../models/ProvisioningState.java | 46 +- .../models/SendAadLogsStatus.java | 18 +- .../models/SendActivityLogsStatus.java | 18 +- .../models/SendMetricsStatus.java | 18 +- .../models/SendSubscriptionLogsStatus.java | 18 +- .../models/SendingLogsStatus.java | 18 +- .../models/SendingMetricsStatus.java | 18 +- .../models/SingleSignOnStates.java | 26 +- .../newrelicobservability/models/Status.java | 63 + .../models/SubscriptionList.java | 100 + .../models/SwitchBillingRequest.java | 31 +- .../models/TagAction.java | 18 +- .../newrelicobservability/models/TagRule.java | 95 +- .../models/TagRuleListResult.java | 23 +- .../models/TagRuleUpdate.java | 10 +- .../models/TagRuleUpdateProperties.java | 10 +- .../models/TagRules.java | 30 +- .../models/UsageType.java | 18 +- .../models/UserAssignedIdentity.java | 14 +- .../models/UserInfo.java | 30 +- .../models/VMExtensionPayload.java | 8 +- .../models/VMHostsListResponse.java | 23 +- .../newrelicobservability/models/VMInfo.java | 12 +- .../models/package-info.java | 5 +- .../newrelicobservability/package-info.java | 5 +- .../src/main/java/module-info.java | 10 +- .../proxy-config.json | 1 + .../reflect-config.json | 411 ++++ .../generated/AccountsListSamples.java | 14 +- .../generated/BillingInfoGetSamples.java | 24 + .../ConnectedPartnerResourcesListSamples.java | 25 + ...redSubscriptionsCreateorUpdateSamples.java | 27 + .../MonitoredSubscriptionsDeleteSamples.java | 27 + .../MonitoredSubscriptionsGetSamples.java | 27 + .../MonitoredSubscriptionsListSamples.java | 24 + .../MonitoredSubscriptionsUpdateSamples.java | 29 + .../MonitorsCreateOrUpdateSamples.java | 68 +- .../generated/MonitorsDeleteSamples.java | 32 +- .../MonitorsGetByResourceGroupSamples.java | 13 +- .../MonitorsGetMetricRulesSamples.java | 32 +- .../MonitorsGetMetricStatusSamples.java | 40 +- .../MonitorsListAppServicesSamples.java | 40 +- .../MonitorsListByResourceGroupSamples.java | 9 +- .../generated/MonitorsListHostsSamples.java | 40 +- .../MonitorsListLinkedResourcesSamples.java | 25 + ...MonitorsListMonitoredResourcesSamples.java | 24 +- .../generated/MonitorsListSamples.java | 9 +- .../MonitorsSwitchBillingSamples.java | 47 +- .../generated/MonitorsUpdateSamples.java | 70 +- .../MonitorsVmHostPayloadSamples.java | 24 +- .../generated/OperationsListSamples.java | 14 +- .../generated/OrganizationsListSamples.java | 14 +- .../generated/PlansListSamples.java | 24 +- .../TagRulesCreateOrUpdateSamples.java | 56 +- .../generated/TagRulesDeleteSamples.java | 32 +- .../generated/TagRulesGetSamples.java | 40 +- ...sListByNewRelicMonitorResourceSamples.java | 26 +- .../generated/TagRulesUpdateSamples.java | 70 +- .../generated/AccountPropertiesTests.java | 16 +- .../generated/AccountResourceInnerTests.java | 16 +- .../generated/AccountsListMockTests.java | 51 +- .../generated/AccountsListResponseTests.java | 22 +- .../generated/AppServiceInfoInnerTests.java | 27 +- .../generated/AppServicesGetRequestTests.java | 17 +- .../AppServicesListResponseTests.java | 47 +- .../BillingInfoResponseInnerTests.java | 46 + ...BillingInfoesGetWithResponseMockTests.java | 62 + ...nnectedPartnerResourcePropertiesTests.java | 33 + ...dPartnerResourcesListFormatInnerTests.java | 35 + ...onnectedPartnerResourcesListMockTests.java | 60 + ...ctedPartnerResourcesListResponseTests.java | 48 + .../generated/FilteringTagTests.java | 21 +- .../generated/HostsGetRequestTests.java | 18 +- .../generated/LinkedResourceInnerTests.java | 24 + .../LinkedResourceListResponseTests.java | 33 + .../generated/LogRulesTests.java | 57 +- .../ManagedServiceIdentityTests.java | 17 +- .../generated/MarketplaceSaaSInfoTests.java | 36 + .../generated/MetricRulesInnerTests.java | 40 +- .../generated/MetricsRequestTests.java | 9 +- .../generated/MetricsStatusRequestTests.java | 20 +- .../MetricsStatusResponseInnerTests.java | 11 +- .../MonitoredResourceInnerTests.java | 34 +- .../MonitoredResourceListResponseTests.java | 66 +- .../MonitoredSubscriptionInnerTests.java | 85 + ...toredSubscriptionPropertiesInnerTests.java | 101 + ...itoredSubscriptionPropertiesListTests.java | 85 + ...dSubscriptionsCreateorUpdateMockTests.java | 90 + ...SubscriptionsGetWithResponseMockTests.java | 62 + .../MonitoredSubscriptionsListMockTests.java | 65 + ...onitoringTagRulesPropertiesInnerTests.java | 92 +- .../MonitorsCreateOrUpdateMockTests.java | 136 -- .../generated/MonitorsDeleteMockTests.java | 36 +- ...tByResourceGroupWithResponseMockTests.java | 89 - ...rsGetMetricRulesWithResponseMockTests.java | 52 +- ...sGetMetricStatusWithResponseMockTests.java | 55 +- .../MonitorsListAppServicesMockTests.java | 59 +- .../MonitorsListByResourceGroupMockTests.java | 89 - .../generated/MonitorsListHostsMockTests.java | 56 +- .../MonitorsListLinkedResourcesMockTests.java | 56 + .../generated/MonitorsListMockTests.java | 88 - ...nitorsListMonitoredResourcesMockTests.java | 45 +- ...orsSwitchBillingWithResponseMockTests.java | 104 - .../NewRelicMonitorResourceInnerTests.java | 112 - ...ewRelicMonitorResourceListResultTests.java | 105 - .../NewRelicMonitorResourceUpdateTests.java | 101 - .../NewRelicSingleSignOnPropertiesTests.java | 33 +- .../generated/OperationDisplayTests.java | 8 +- .../generated/OperationInnerTests.java | 8 +- .../generated/OperationListResultTests.java | 8 +- .../generated/OperationsListMockTests.java | 34 +- .../generated/OrganizationInfoTests.java | 9 +- .../OrganizationPropertiesTests.java | 23 +- .../OrganizationResourceInnerTests.java | 27 +- .../generated/OrganizationsListMockTests.java | 43 +- .../OrganizationsListResponseTests.java | 46 +- .../generated/PartnerBillingEntityTests.java | 29 + .../generated/PlanDataListResponseTests.java | 48 +- .../generated/PlanDataPropertiesTests.java | 42 +- .../generated/PlanDataResourceInnerTests.java | 34 +- .../generated/PlanDataTests.java | 32 +- .../generated/PlansListMockTests.java | 48 +- .../generated/SubscriptionListTests.java | 99 + .../generated/SwitchBillingRequestTests.java | 48 +- .../generated/TagRuleInnerTests.java | 62 +- .../generated/TagRuleListResultTests.java | 50 +- .../generated/TagRuleUpdateInnerTests.java | 57 +- .../TagRuleUpdatePropertiesInnerTests.java | 87 +- .../TagRulesCreateOrUpdateMockTests.java | 80 +- .../generated/TagRulesDeleteMockTests.java | 36 +- .../TagRulesGetWithResponseMockTests.java | 53 +- ...istByNewRelicMonitorResourceMockTests.java | 62 +- .../generated/UserAssignedIdentityTests.java | 8 +- .../generated/UserInfoTests.java | 37 +- .../generated/VMHostsListResponseTests.java | 38 +- .../generated/VMInfoInnerTests.java | 22 +- 285 files changed, 11663 insertions(+), 6564 deletions(-) create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/BillingInfoesClient.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/ConnectedPartnerResourcesClient.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitoredSubscriptionsClient.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/BillingInfoResponseInner.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/ConnectedPartnerResourcesListFormatInner.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LinkedResourceInner.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionInner.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionPropertiesInner.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoResponseImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesClientImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesClientImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesListFormatImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/LinkedResourceImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionPropertiesImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsClientImpl.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsImpl.java rename sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/{Utils.java => ResourceManagerUtils.java} (80%) create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoResponse.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoes.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConfigurationName.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourceProperties.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResources.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListFormat.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListResponse.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResource.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResourceListResponse.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSaaSInfo.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscription.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionProperties.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionPropertiesList.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptions.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PartnerBillingEntity.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PatchOperation.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Status.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SubscriptionList.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/proxy-config.json create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/reflect-config.json create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoGetSamples.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListSamples.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateSamples.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsDeleteSamples.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetSamples.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListSamples.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsUpdateSamples.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesSamples.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoResponseInnerTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoesGetWithResponseMockTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcePropertiesTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListFormatInnerTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListMockTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListResponseTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceInnerTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceListResponseTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MarketplaceSaaSInfoTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionInnerTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesInnerTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesListTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateMockTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetWithResponseMockTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListMockTests.java delete mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateMockTests.java delete mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupMockTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesMockTests.java delete mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMockTests.java delete mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingWithResponseMockTests.java delete mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceInnerTests.java delete mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceListResultTests.java delete mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceUpdateTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PartnerBillingEntityTests.java create mode 100644 sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SubscriptionListTests.java diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index d1864724cda9e..82f95aad9708b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -426,7 +426,7 @@ com.azure.resourcemanager:azure-resourcemanager-storagemover;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-voiceservices;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-graphservices;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-paloaltonetworks-ngfw;1.1.0;1.2.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.0.0;1.1.0 com.azure.resourcemanager:azure-resourcemanager-qumulo;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-selfhelp;1.0.0;1.1.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-networkcloud;1.0.0;1.1.0-beta.1 diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md index d38db317ede72..febcf1feeffcf 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md @@ -1,14 +1,77 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0 (2024-03-15) + +- Azure Resource Manager NewRelicObservability client library for Java. This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2024-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.ConfigurationName` was added + +* `models.MarketplaceSaaSInfo` was added + +* `models.MonitoredSubscriptionProperties$UpdateStages` was added + +* `models.MonitoredSubscription` was added + +* `models.MonitoredSubscriptionProperties$Definition` was added + +* `models.BillingInfoResponse` was added + +* `models.MonitoredSubscriptionPropertiesList` was added + +* `models.ConnectedPartnerResources` was added + +* `models.SubscriptionList` was added + +* `models.ConnectedPartnerResourcesListResponse` was added + +* `models.ConnectedPartnerResourcesListFormat` was added + +* `models.BillingInfoes` was added + +* `models.PatchOperation` was added + +* `models.MonitoredSubscriptionProperties$Update` was added + +* `models.Status` was added + +* `models.MonitoredSubscriptionProperties$DefinitionStages` was added + +* `models.ConnectedPartnerResourceProperties` was added + +* `models.MonitoredSubscriptionProperties` was added + +* `models.LinkedResource` was added + +* `models.PartnerBillingEntity` was added + +* `models.MonitoredSubscriptions` was added + +* `models.LinkedResourceListResponse` was added + +#### `models.NewRelicMonitorResource` was modified + +* `saaSAzureSubscriptionStatus()` was added +* `listLinkedResources(com.azure.core.util.Context)` was added +* `listLinkedResources()` was added +* `subscriptionState()` was added + +#### `models.NewRelicMonitorResource$Definition` was modified + +* `withSaaSAzureSubscriptionStatus(java.lang.String)` was added +* `withSubscriptionState(java.lang.String)` was added + +#### `models.Monitors` was modified + +* `listLinkedResources(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listLinkedResources(java.lang.String,java.lang.String)` was added -### Bugs Fixed +#### `NewRelicObservabilityManager` was modified -### Other Changes +* `connectedPartnerResources()` was added +* `monitoredSubscriptions()` was added +* `billingInfoes()` was added ## 1.0.0 (2023-05-18) diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md index ee2a7521149c3..83d0779a85648 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md @@ -2,7 +2,7 @@ Azure Resource Manager NewRelicObservability client library for Java. -This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2022-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2024-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-newrelicobservability - 1.0.0 + 1.1.0 ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -94,7 +94,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fnewrelicobservability%2Fazure-resourcemanager-newrelicobservability%2FREADME.png) diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md index d4d683f27b3b1..e482148640f75 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md @@ -5,6 +5,22 @@ - [List](#accounts_list) +## BillingInfo + +- [Get](#billinginfo_get) + +## ConnectedPartnerResources + +- [List](#connectedpartnerresources_list) + +## MonitoredSubscriptions + +- [CreateorUpdate](#monitoredsubscriptions_createorupdate) +- [Delete](#monitoredsubscriptions_delete) +- [Get](#monitoredsubscriptions_get) +- [List](#monitoredsubscriptions_list) +- [Update](#monitoredsubscriptions_update) + ## Monitors - [CreateOrUpdate](#monitors_createorupdate) @@ -16,6 +32,7 @@ - [ListAppServices](#monitors_listappservices) - [ListByResourceGroup](#monitors_listbyresourcegroup) - [ListHosts](#monitors_listhosts) +- [ListLinkedResources](#monitors_listlinkedresources) - [ListMonitoredResources](#monitors_listmonitoredresources) - [SwitchBilling](#monitors_switchbilling) - [Update](#monitors_update) @@ -43,14 +60,17 @@ ### Accounts_List ```java -/** Samples for Accounts List. */ +/** + * Samples for Accounts List. + */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Accounts_List_MinimumSet_Gen.json */ /** * Sample code: Accounts_List_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void accountsListMinimumSetGen( @@ -59,11 +79,12 @@ public final class AccountsListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Accounts_List_MaximumSet_Gen.json */ /** * Sample code: Accounts_List_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void accountsListMaximumSetGen( @@ -73,12 +94,190 @@ public final class AccountsListSamples { } ``` +### BillingInfo_Get + +```java +/** + * Samples for BillingInfo Get. + */ +public final class BillingInfoGetSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/BillingInfo_Get.json + */ + /** + * Sample code: BillingInfo_Get. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void + billingInfoGet(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.billingInfoes().getWithResponse("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedPartnerResources_List + +```java +/** + * Samples for ConnectedPartnerResources List. + */ +public final class ConnectedPartnerResourcesListSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * ConnectedPartnerResources_List.json + */ + /** + * Sample code: ConnectedPartnerResources_List. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void connectedPartnerResourcesList( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.connectedPartnerResources().list("myResourceGroup", "myMonitor", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoredSubscriptions_CreateorUpdate + +```java +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; + +/** + * Samples for MonitoredSubscriptions CreateorUpdate. + */ +public final class MonitoredSubscriptionsCreateorUpdateSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_CreateorUpdate.json + */ + /** + * Sample code: Monitors_AddMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsAddMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitoredSubscriptions().define(ConfigurationName.DEFAULT) + .withExistingMonitor("myResourceGroup", "myMonitor").create(); + } +} +``` + +### MonitoredSubscriptions_Delete + +```java +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; + +/** + * Samples for MonitoredSubscriptions Delete. + */ +public final class MonitoredSubscriptionsDeleteSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_Delete.json + */ + /** + * Sample code: Monitors_DeleteMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsDeleteMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitoredSubscriptions().delete("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoredSubscriptions_Get + +```java +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; + +/** + * Samples for MonitoredSubscriptions Get. + */ +public final class MonitoredSubscriptionsGetSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_Get.json + */ + /** + * Sample code: Monitors_GetMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsGetMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitoredSubscriptions().getWithResponse("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoredSubscriptions_List + +```java +/** + * Samples for MonitoredSubscriptions List. + */ +public final class MonitoredSubscriptionsListSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_List.json + */ + /** + * Sample code: Monitors_GetMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsGetMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitoredSubscriptions().list("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoredSubscriptions_Update + +```java +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; + +/** + * Samples for MonitoredSubscriptions Update. + */ +public final class MonitoredSubscriptionsUpdateSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_Update.json + */ + /** + * Sample code: Monitors_UpdateMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsUpdateMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + MonitoredSubscriptionProperties resource = manager.monitoredSubscriptions().getWithResponse("myResourceGroup", + "myMonitor", ConfigurationName.DEFAULT, com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); + } +} +``` + ### Monitors_CreateOrUpdate ```java import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.AccountInfo; import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; +import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; +import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; import com.azure.resourcemanager.newrelicobservability.models.NewRelicSingleSignOnProperties; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; @@ -87,62 +286,48 @@ import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; import com.azure.resourcemanager.newrelicobservability.models.SingleSignOnStates; import com.azure.resourcemanager.newrelicobservability.models.UsageType; +import com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity; import com.azure.resourcemanager.newrelicobservability.models.UserInfo; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; -/** Samples for Monitors CreateOrUpdate. */ +/** + * Samples for Monitors CreateOrUpdate. + */ public final class MonitorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Monitors_CreateOrUpdate_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .define("cdlymktqw") - .withRegion("k") - .withExistingResourceGroup("rgNewRelic") - .withTags(mapOf("key6976", "oaxfhf")) - .withNewRelicAccountProperties( - new NewRelicAccountProperties() - .withUserId("vcscxlncofcuduadesd") - .withAccountInfo( - new AccountInfo() - .withAccountId("xhqmg") - .withIngestionKey("fakeTokenPlaceholder") - .withRegion("ljcf")) - .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) - .withSingleSignOnProperties( - new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL) - .withEnterpriseAppId("kwiwfz") - .withSingleSignOnUrl("kvseueuljsxmfwpqctz") - .withProvisioningState(ProvisioningState.ACCEPTED))) - .withUserInfo( - new UserInfo() - .withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") - .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc") - .withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") - .withPhoneNumber("krf") - .withCountry("hslqnwdanrconqyekwbnttaetv")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga") - .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.LIFTR) - .create(); + manager.monitors().define("cdlymktqw").withRegion("k").withExistingResourceGroup("rgNewRelic") + .withTags(mapOf("key6976", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) + .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("vcscxlncofcuduadesd") + .withAccountInfo(new AccountInfo() + .withAccountId("xhqmg").withIngestionKey("fakeTokenPlaceholder").withRegion("ljcf")) + .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) + .withSingleSignOnProperties(new NewRelicSingleSignOnProperties() + .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("kwiwfz") + .withSingleSignOnUrl("kvseueuljsxmfwpqctz").withProvisioningState(ProvisioningState.ACCEPTED))) + .withUserInfo(new UserInfo().withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") + .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc").withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") + .withPhoneNumber("krf").withCountry("hslqnwdanrconqyekwbnttaetv")) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR).withAccountCreationSource(AccountCreationSource.LIFTR) + .withSubscriptionState("Suspended").withSaaSAzureSubscriptionStatus("Subscribed").create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -159,44 +344,38 @@ public final class MonitorsCreateOrUpdateSamples { ### Monitors_Delete ```java -/** Samples for Monitors Delete. */ +/** + * Samples for Monitors Delete. + */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_Delete_MinimumSet_Gen.json */ /** * Sample code: Monitors_Delete_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .delete( - "rgopenapi", - "ruxvg@xqkmdhrnoo.hlmbpm", - "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors().delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_Delete_MaximumSet_Gen.json */ /** * Sample code: Monitors_Delete_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .delete( - "rgopenapi", - "ruxvg@xqkmdhrnoo.hlmbpm", - "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors().delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } ``` @@ -204,18 +383,21 @@ public final class MonitorsDeleteSamples { ### Monitors_GetByResourceGroup ```java -/** Samples for Monitors GetByResourceGroup. */ +/** + * Samples for Monitors GetByResourceGroup. + */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_Get_MaximumSet_Gen.json */ /** * Sample code: Monitors_Get_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void monitorsGetMaximumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + public static void + monitorsGetMaximumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { manager.monitors().getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE); } } @@ -226,44 +408,38 @@ public final class MonitorsGetByResourceGroupSamples { ```java import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; -/** Samples for Monitors GetMetricRules. */ +/** + * Samples for Monitors GetMetricRules. + */ public final class MonitorsGetMetricRulesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_GetMetricRules_MinimumSet_Gen.json */ /** * Sample code: Monitors_GetMetricRules_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsGetMetricRulesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .getMetricRulesWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_GetMetricRules_MaximumSet_Gen.json */ /** * Sample code: Monitors_GetMetricRules_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsGetMetricRulesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .getMetricRulesWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } } ``` @@ -274,46 +450,44 @@ public final class MonitorsGetMetricRulesSamples { import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; import java.util.Arrays; -/** Samples for Monitors GetMetricStatus. */ +/** + * Samples for Monitors GetMetricStatus. + */ public final class MonitorsGetMetricStatusSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_GetMetricStatus_MinimumSet_Gen.json */ /** * Sample code: Monitors_GetMetricStatus_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsGetMetricStatusMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .getMetricStatusWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsStatusRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_GetMetricStatus_MaximumSet_Gen.json */ /** * Sample code: Monitors_GetMetricStatus_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsGetMetricStatusMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .getMetricStatusWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsStatusRequest() - .withAzureResourceIds(Arrays.asList("enfghpfw")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } ``` @@ -321,14 +495,17 @@ public final class MonitorsGetMetricStatusSamples { ### Monitors_List ```java -/** Samples for Monitors List. */ +/** + * Samples for Monitors List. + */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListBySubscription_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListBySubscriptionMaximumSetGen( @@ -344,46 +521,44 @@ public final class MonitorsListSamples { import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; import java.util.Arrays; -/** Samples for Monitors ListAppServices. */ +/** + * Samples for Monitors ListAppServices. + */ public final class MonitorsListAppServicesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListAppServices_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListAppServices_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListAppServicesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listAppServices( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new AppServicesGetRequest() - .withAzureResourceIds(Arrays.asList("pvzrksrmzowobuhxpwiotnpcvjbu")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListAppServices_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListAppServices_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListAppServicesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listAppServices( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new AppServicesGetRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } ``` @@ -391,14 +566,17 @@ public final class MonitorsListAppServicesSamples { ### Monitors_ListByResourceGroup ```java -/** Samples for Monitors ListByResourceGroup. */ +/** + * Samples for Monitors ListByResourceGroup. + */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListByResourceGroup_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListByResourceGroupMaximumSetGen( @@ -414,48 +592,66 @@ public final class MonitorsListByResourceGroupSamples { import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; import java.util.Arrays; -/** Samples for Monitors ListHosts. */ +/** + * Samples for Monitors ListHosts. + */ public final class MonitorsListHostsSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListHosts_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListHosts_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListHostsMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listHosts( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - new HostsGetRequest() - .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().listHosts( + "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", new HostsGetRequest() + .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")).withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListHosts_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListHosts_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListHostsMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listHosts( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - new HostsGetRequest() - .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().listHosts( + "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", new HostsGetRequest() + .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")).withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Monitors_ListLinkedResources + +```java +/** + * Samples for Monitors ListLinkedResources. + */ +public final class MonitorsListLinkedResourcesSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/LinkedResources_List. + * json + */ + /** + * Sample code: Monitors_ListLinkedResources. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsListLinkedResources( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors().listLinkedResources("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); } } ``` @@ -463,36 +659,38 @@ public final class MonitorsListHostsSamples { ### Monitors_ListMonitoredResources ```java -/** Samples for Monitors ListMonitoredResources. */ +/** + * Samples for Monitors ListMonitoredResources. + */ public final class MonitorsListMonitoredResourcesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListMonitoredResources_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListMonitoredResources_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListMonitoredResourcesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.monitors().listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListMonitoredResources_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListMonitoredResources_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListMonitoredResourcesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.monitors().listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } ``` @@ -506,53 +704,44 @@ import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingReque import com.azure.resourcemanager.newrelicobservability.models.UsageType; import java.time.OffsetDateTime; -/** Samples for Monitors SwitchBilling. */ +/** + * Samples for Monitors SwitchBilling. + */ public final class MonitorsSwitchBillingSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_SwitchBilling_MinimumSet_Gen.json */ /** * Sample code: Monitors_SwitchBilling_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsSwitchBillingMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .switchBillingWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new SwitchBillingRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new SwitchBillingRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_SwitchBilling_MaximumSet_Gen.json */ /** * Sample code: Monitors_SwitchBilling_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsSwitchBillingMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .switchBillingWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new SwitchBillingRequest() - .withAzureResourceId("enfghpfw") - .withOrganizationId("k") - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga") - .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new SwitchBillingRequest().withAzureResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") + .withOrganizationId("k") + .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } ``` @@ -580,63 +769,43 @@ import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; -/** Samples for Monitors Update. */ +/** + * Samples for Monitors Update. + */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_Update_MaximumSet_Gen.json */ /** * Sample code: Monitors_Update_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - NewRelicMonitorResource resource = - manager - .monitors() - .getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("key164", "jqakdrrmmyzytqu")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) - .withNewRelicAccountProperties( - new NewRelicAccountProperties() - .withUserId("vcscxlncofcuduadesd") - .withAccountInfo( - new AccountInfo() - .withAccountId("xhqmg") - .withIngestionKey("fakeTokenPlaceholder") - .withRegion("ljcf")) - .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) - .withSingleSignOnProperties( - new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL) - .withEnterpriseAppId("kwiwfz") - .withSingleSignOnUrl("kvseueuljsxmfwpqctz") - .withProvisioningState(ProvisioningState.ACCEPTED))) - .withUserInfo( - new UserInfo() - .withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") - .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc") - .withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") - .withPhoneNumber("krf") - .withCountry("hslqnwdanrconqyekwbnttaetv")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga") - .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.LIFTR) + NewRelicMonitorResource resource = manager.monitors() + .getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("key164", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) + .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("vcscxlncofcuduadesd") + .withAccountInfo(new AccountInfo() + .withAccountId("xhqmg").withIngestionKey("fakeTokenPlaceholder").withRegion("ljcf")) + .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) + .withSingleSignOnProperties(new NewRelicSingleSignOnProperties() + .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("kwiwfz") + .withSingleSignOnUrl("kvseueuljsxmfwpqctz").withProvisioningState(ProvisioningState.ACCEPTED))) + .withUserInfo(new UserInfo().withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") + .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc").withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") + .withPhoneNumber("krf").withCountry("hslqnwdanrconqyekwbnttaetv")) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR).withAccountCreationSource(AccountCreationSource.LIFTR) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -653,36 +822,38 @@ public final class MonitorsUpdateSamples { ### Monitors_VmHostPayload ```java -/** Samples for Monitors VmHostPayload. */ +/** + * Samples for Monitors VmHostPayload. + */ public final class MonitorsVmHostPayloadSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_VmHostPayload_MinimumSet_Gen.json */ /** * Sample code: Monitors_VmHostPayload_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsVmHostPayloadMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.monitors().vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_VmHostPayload_MaximumSet_Gen.json */ /** * Sample code: Monitors_VmHostPayload_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsVmHostPayloadMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.monitors().vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } ``` @@ -690,14 +861,17 @@ public final class MonitorsVmHostPayloadSamples { ### Operations_List ```java -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void operationsListMinimumSetGen( @@ -706,11 +880,12 @@ public final class OperationsListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void operationsListMaximumSetGen( @@ -723,14 +898,17 @@ public final class OperationsListSamples { ### Organizations_List ```java -/** Samples for Organizations List. */ +/** + * Samples for Organizations List. + */ public final class OrganizationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Organizations_List_MinimumSet_Gen.json */ /** * Sample code: Organizations_List_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void organizationsListMinimumSetGen( @@ -739,11 +917,12 @@ public final class OrganizationsListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Organizations_List_MaximumSet_Gen.json */ /** * Sample code: Organizations_List_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void organizationsListMaximumSetGen( @@ -756,32 +935,36 @@ public final class OrganizationsListSamples { ### Plans_List ```java -/** Samples for Plans List. */ +/** + * Samples for Plans List. + */ public final class PlansListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Plans_List_MaximumSet_Gen.json */ /** * Sample code: Plans_List_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void plansListMaximumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + public static void + plansListMaximumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { manager.plans().list("pwuxgvrmkk", "hilawwjz", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Plans_List_MinimumSet_Gen.json */ /** * Sample code: Plans_List_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void plansListMinimumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.plans().list(null, null, com.azure.core.util.Context.NONE); + public static void + plansListMinimumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.plans().list(null, "hilawwjz", com.azure.core.util.Context.NONE); } } ``` @@ -798,62 +981,48 @@ import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLo import com.azure.resourcemanager.newrelicobservability.models.TagAction; import java.util.Arrays; -/** Samples for TagRules CreateOrUpdate. */ +/** + * Samples for TagRules CreateOrUpdate. + */ public final class TagRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: TagRules_CreateOrUpdate_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .define("bxcantgzggsepbhqmedjqyrqeezmfb") + manager.tagRules().define("bxcantgzggsepbhqmedjqyrqeezmfb") .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron") - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb") - .withAction(TagAction.INCLUDE)))) - .withMetricRules( - new MetricRulesInner() - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb") - .withAction(TagAction.INCLUDE))) - .withUserEmail("test@testing.com")) + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") + .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE)))) + .withMetricRules(new MetricRulesInner() + .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") + .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE))) + .withUserEmail("test@testing.com")) .create(); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: TagRules_CreateOrUpdate_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .define("bxcantgzggsepbhqmedjqyrqeezmfb") - .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron") - .create(); + manager.tagRules().define("bxcantgzggsepbhqmedjqyrqeezmfb") + .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron").create(); } } ``` @@ -861,44 +1030,38 @@ public final class TagRulesCreateOrUpdateSamples { ### TagRules_Delete ```java -/** Samples for TagRules Delete. */ +/** + * Samples for TagRules Delete. + */ public final class TagRulesDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Delete_MinimumSet_Gen.json */ /** * Sample code: TagRules_Delete_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .delete( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules().delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Delete_MaximumSet_Gen.json */ /** * Sample code: TagRules_Delete_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .delete( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules().delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } } ``` @@ -906,44 +1069,38 @@ public final class TagRulesDeleteSamples { ### TagRules_Get ```java -/** Samples for TagRules Get. */ +/** + * Samples for TagRules Get. + */ public final class TagRulesGetSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Get_MinimumSet_Gen.json */ /** * Sample code: TagRules_Get_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void tagRulesGetMinimumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .getWithResponse( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + public static void + tagRulesGetMinimumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Get_MaximumSet_Gen.json */ /** * Sample code: TagRules_Get_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void tagRulesGetMaximumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .getWithResponse( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + public static void + tagRulesGetMaximumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } } ``` @@ -951,38 +1108,38 @@ public final class TagRulesGetSamples { ### TagRules_ListByNewRelicMonitorResource ```java -/** Samples for TagRules ListByNewRelicMonitorResource. */ +/** + * Samples for TagRules ListByNewRelicMonitorResource. + */ public final class TagRulesListByNewRelicMonitorResourceSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json */ /** * Sample code: TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesListByNewRelicMonitorResourceMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .listByNewRelicMonitorResource( - "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.tagRules().listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json */ /** * Sample code: TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesListByNewRelicMonitorResourceMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .listByNewRelicMonitorResource( - "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.tagRules().listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } ``` @@ -1000,73 +1157,49 @@ import com.azure.resourcemanager.newrelicobservability.models.TagAction; import com.azure.resourcemanager.newrelicobservability.models.TagRule; import java.util.Arrays; -/** Samples for TagRules Update. */ +/** + * Samples for TagRules Update. + */ public final class TagRulesUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Update_MaximumSet_Gen.json */ /** * Sample code: TagRules_Update_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - TagRule resource = - manager - .tagRules() - .getWithResponse( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb") - .withAction(TagAction.INCLUDE)))) - .withMetricRules( - new MetricRulesInner() - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb") - .withAction(TagAction.INCLUDE))) - .withUserEmail("test@testing.com")) + TagRule resource = manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + "bxcantgzggsepbhqmedjqyrqeezmfb", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") + .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE)))) + .withMetricRules(new MetricRulesInner() + .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") + .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE))) + .withUserEmail("test@testing.com")) .apply(); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Update_MinimumSet_Gen.json */ /** * Sample code: TagRules_Update_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesUpdateMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - TagRule resource = - manager - .tagRules() - .getWithResponse( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE) - .getValue(); + TagRule resource = manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + "bxcantgzggsepbhqmedjqyrqeezmfb", com.azure.core.util.Context.NONE).getValue(); resource.update().apply(); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml index 752d961bcda11..2d56892ed8412 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-newrelicobservability - 1.1.0-beta.1 + 1.1.0 jar Microsoft Azure SDK for NewRelicObservability Management - This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2022-07-01. + This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-01-01. https://github.com/Azure/azure-sdk-for-java @@ -87,8 +87,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/NewRelicObservabilityManager.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/NewRelicObservabilityManager.java index f4814b4ee32f6..39c86b6333721 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/NewRelicObservabilityManager.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/NewRelicObservabilityManager.java @@ -25,6 +25,9 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.NewRelicObservability; import com.azure.resourcemanager.newrelicobservability.implementation.AccountsImpl; +import com.azure.resourcemanager.newrelicobservability.implementation.BillingInfoesImpl; +import com.azure.resourcemanager.newrelicobservability.implementation.ConnectedPartnerResourcesImpl; +import com.azure.resourcemanager.newrelicobservability.implementation.MonitoredSubscriptionsImpl; import com.azure.resourcemanager.newrelicobservability.implementation.MonitorsImpl; import com.azure.resourcemanager.newrelicobservability.implementation.NewRelicObservabilityBuilder; import com.azure.resourcemanager.newrelicobservability.implementation.OperationsImpl; @@ -32,6 +35,9 @@ import com.azure.resourcemanager.newrelicobservability.implementation.PlansImpl; import com.azure.resourcemanager.newrelicobservability.implementation.TagRulesImpl; import com.azure.resourcemanager.newrelicobservability.models.Accounts; +import com.azure.resourcemanager.newrelicobservability.models.BillingInfoes; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResources; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptions; import com.azure.resourcemanager.newrelicobservability.models.Monitors; import com.azure.resourcemanager.newrelicobservability.models.Operations; import com.azure.resourcemanager.newrelicobservability.models.Organizations; @@ -44,7 +50,9 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to NewRelicObservabilityManager. */ +/** + * Entry point to NewRelicObservabilityManager. + */ public final class NewRelicObservabilityManager { private Operations operations; @@ -56,26 +64,28 @@ public final class NewRelicObservabilityManager { private Plans plans; + private BillingInfoes billingInfoes; + + private ConnectedPartnerResources connectedPartnerResources; + private TagRules tagRules; + private MonitoredSubscriptions monitoredSubscriptions; + private final NewRelicObservability clientObject; - private NewRelicObservabilityManager( - HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + private NewRelicObservabilityManager(HttpPipeline httpPipeline, AzureProfile profile, + Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new NewRelicObservabilityBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new NewRelicObservabilityBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval).buildClient(); } /** * Creates an instance of NewRelicObservability service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the NewRelicObservability service API instance. @@ -88,7 +98,7 @@ public static NewRelicObservabilityManager authenticate(TokenCredential credenti /** * Creates an instance of NewRelicObservability service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the NewRelicObservability service API instance. @@ -101,14 +111,16 @@ public static NewRelicObservabilityManager authenticate(HttpPipeline httpPipelin /** * Gets a Configurable instance that can be used to create NewRelicObservabilityManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new NewRelicObservabilityManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -180,8 +192,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -198,8 +210,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -219,21 +231,12 @@ public NewRelicObservabilityManager authenticate(TokenCredential credential, Azu Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.newrelicobservability") - .append("/") - .append("1.0.0"); + userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.newrelicobservability") + .append("/").append("1.1.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); + userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); } else { userAgentBuilder.append(" (auto-generated)"); } @@ -252,38 +255,25 @@ public NewRelicObservabilityManager authenticate(TokenCredential credential, Azu policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); return new NewRelicObservabilityManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -295,7 +285,7 @@ public Operations operations() { /** * Gets the resource collection API of Accounts. - * + * * @return Resource collection API of Accounts. */ public Accounts accounts() { @@ -307,7 +297,7 @@ public Accounts accounts() { /** * Gets the resource collection API of Monitors. It manages NewRelicMonitorResource. - * + * * @return Resource collection API of Monitors. */ public Monitors monitors() { @@ -319,7 +309,7 @@ public Monitors monitors() { /** * Gets the resource collection API of Organizations. - * + * * @return Resource collection API of Organizations. */ public Organizations organizations() { @@ -331,7 +321,7 @@ public Organizations organizations() { /** * Gets the resource collection API of Plans. - * + * * @return Resource collection API of Plans. */ public Plans plans() { @@ -341,9 +331,34 @@ public Plans plans() { return plans; } + /** + * Gets the resource collection API of BillingInfoes. + * + * @return Resource collection API of BillingInfoes. + */ + public BillingInfoes billingInfoes() { + if (this.billingInfoes == null) { + this.billingInfoes = new BillingInfoesImpl(clientObject.getBillingInfoes(), this); + } + return billingInfoes; + } + + /** + * Gets the resource collection API of ConnectedPartnerResources. + * + * @return Resource collection API of ConnectedPartnerResources. + */ + public ConnectedPartnerResources connectedPartnerResources() { + if (this.connectedPartnerResources == null) { + this.connectedPartnerResources + = new ConnectedPartnerResourcesImpl(clientObject.getConnectedPartnerResources(), this); + } + return connectedPartnerResources; + } + /** * Gets the resource collection API of TagRules. It manages TagRule. - * + * * @return Resource collection API of TagRules. */ public TagRules tagRules() { @@ -354,8 +369,23 @@ public TagRules tagRules() { } /** - * @return Wrapped service client NewRelicObservability providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets the resource collection API of MonitoredSubscriptions. It manages MonitoredSubscriptionProperties. + * + * @return Resource collection API of MonitoredSubscriptions. + */ + public MonitoredSubscriptions monitoredSubscriptions() { + if (this.monitoredSubscriptions == null) { + this.monitoredSubscriptions + = new MonitoredSubscriptionsImpl(clientObject.getMonitoredSubscriptions(), this); + } + return monitoredSubscriptions; + } + + /** + * Gets wrapped service client NewRelicObservability providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client NewRelicObservability. */ public NewRelicObservability serviceClient() { return this.clientObject; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/AccountsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/AccountsClient.java index bebbcf51a9f01..c8897603e468a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/AccountsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/AccountsClient.java @@ -10,11 +10,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner; -/** An instance of this class provides access to all the operations defined in AccountsClient. */ +/** + * An instance of this class provides access to all the operations defined in AccountsClient. + */ public interface AccountsClient { /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -27,7 +29,7 @@ public interface AccountsClient { /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/BillingInfoesClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/BillingInfoesClient.java new file mode 100644 index 0000000000000..24fbecdcd7ca2 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/BillingInfoesClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner; + +/** + * An instance of this class provides access to all the operations defined in BillingInfoesClient. + */ +public interface BillingInfoesClient { + /** + * Get marketplace info mapped to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace info mapped to the given monitor along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String monitorName, Context context); + + /** + * Get marketplace info mapped to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace info mapped to the given monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BillingInfoResponseInner get(String resourceGroupName, String monitorName); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/ConnectedPartnerResourcesClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/ConnectedPartnerResourcesClient.java new file mode 100644 index 0000000000000..fdb42682cc57d --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/ConnectedPartnerResourcesClient.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; + +/** + * An instance of this class provides access to all the operations defined in ConnectedPartnerResourcesClient. + */ +public interface ConnectedPartnerResourcesClient { + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Email Id of the user. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName, + String body, Context context); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitoredSubscriptionsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitoredSubscriptionsClient.java new file mode 100644 index 0000000000000..3c6d45adb7000 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitoredSubscriptionsClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; + +/** + * An instance of this class provides access to all the operations defined in MonitoredSubscriptionsClient. + */ +public interface MonitoredSubscriptionsClient { + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName, + Context context); + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String monitorName, + ConfigurationName configurationName, Context context); + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String monitorName, + ConfigurationName configurationName); + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName); + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body, Context context); + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, String monitorName, + ConfigurationName configurationName); + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoredSubscriptionPropertiesInner> + beginUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoredSubscriptionPropertiesInner> beginUpdate( + String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body, Context context); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String monitorName, + ConfigurationName configurationName); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + ConfigurationName configurationName); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + ConfigurationName configurationName, Context context); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName, Context context); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java index 974a640345eb2..549902266fa9a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java @@ -12,6 +12,7 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner; @@ -26,62 +27,64 @@ import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; -/** An instance of this class provides access to all the operations defined in MonitorsClient. */ +/** + * An instance of this class provides access to all the operations defined in MonitorsClient. + */ public interface MonitorsClient { /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Get a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -91,12 +94,12 @@ public interface MonitorsClient { * @return a NewRelicMonitorResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String monitorName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, + Context context); /** * Get a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,7 +112,7 @@ Response getByResourceGroupWithResponse( /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -119,12 +122,12 @@ Response getByResourceGroupWithResponse( * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, NewRelicMonitorResourceInner> beginCreateOrUpdate( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource); + SyncPoller, NewRelicMonitorResourceInner> + beginCreateOrUpdate(String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource); /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -140,7 +143,7 @@ SyncPoller, NewRelicMonitorResourceInne /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -150,12 +153,12 @@ SyncPoller, NewRelicMonitorResourceInne * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - NewRelicMonitorResourceInner createOrUpdate( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource); + NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, String monitorName, + NewRelicMonitorResourceInner resource); /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -166,12 +169,12 @@ NewRelicMonitorResourceInner createOrUpdate( * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - NewRelicMonitorResourceInner createOrUpdate( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context); + NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, String monitorName, + NewRelicMonitorResourceInner resource, Context context); /** * Update a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be updated. @@ -182,12 +185,12 @@ NewRelicMonitorResourceInner createOrUpdate( * @return a Monitor Resource by NewRelic along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties, Context context); + Response updateWithResponse(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties, Context context); /** * Update a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be updated. @@ -197,12 +200,12 @@ Response updateWithResponse( * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - NewRelicMonitorResourceInner update( - String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties); + NewRelicMonitorResourceInner update(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties); /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -216,7 +219,7 @@ NewRelicMonitorResourceInner update( /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -227,12 +230,12 @@ NewRelicMonitorResourceInner update( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String userEmail, String monitorName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String userEmail, String monitorName, + Context context); /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -245,7 +248,7 @@ SyncPoller, Void> beginDelete( /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -259,7 +262,7 @@ SyncPoller, Void> beginDelete( /** * Get metric rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -270,12 +273,12 @@ SyncPoller, Void> beginDelete( * @return metric rules along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getMetricRulesWithResponse( - String resourceGroupName, String monitorName, MetricsRequest request, Context context); + Response getMetricRulesWithResponse(String resourceGroupName, String monitorName, + MetricsRequest request, Context context); /** * Get metric rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -289,7 +292,7 @@ Response getMetricRulesWithResponse( /** * Get metric status. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -300,12 +303,12 @@ Response getMetricRulesWithResponse( * @return metric status along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getMetricStatusWithResponse( - String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context); + Response getMetricStatusWithResponse(String resourceGroupName, String monitorName, + MetricsStatusRequest request, Context context); /** * Get metric status. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -315,12 +318,12 @@ Response getMetricStatusWithResponse( * @return metric status. */ @ServiceMethod(returns = ReturnType.SINGLE) - MetricsStatusResponseInner getMetricStatus( - String resourceGroupName, String monitorName, MetricsStatusRequest request); + MetricsStatusResponseInner getMetricStatus(String resourceGroupName, String monitorName, + MetricsStatusRequest request); /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -330,12 +333,12 @@ MetricsStatusResponseInner getMetricStatus( * @return response of a list app services Operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppServices( - String resourceGroupName, String monitorName, AppServicesGetRequest request); + PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request); /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -346,12 +349,12 @@ PagedIterable listAppServices( * @return response of a list app services Operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppServices( - String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context); + PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context); /** * Switches the billing for NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the switch billing request. @@ -362,12 +365,12 @@ PagedIterable listAppServices( * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - MonitorsSwitchBillingResponse switchBillingWithResponse( - String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context); + MonitorsSwitchBillingResponse switchBillingWithResponse(String resourceGroupName, String monitorName, + SwitchBillingRequest request, Context context); /** * Switches the billing for NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the switch billing request. @@ -377,12 +380,12 @@ MonitorsSwitchBillingResponse switchBillingWithResponse( * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - NewRelicMonitorResourceInner switchBilling( - String resourceGroupName, String monitorName, SwitchBillingRequest request); + NewRelicMonitorResourceInner switchBilling(String resourceGroupName, String monitorName, + SwitchBillingRequest request); /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. @@ -396,7 +399,7 @@ NewRelicMonitorResourceInner switchBilling( /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. @@ -407,42 +410,70 @@ NewRelicMonitorResourceInner switchBilling( * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHosts( - String resourceGroupName, String monitorName, HostsGetRequest request, Context context); + PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request, + Context context); /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedIterable}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listMonitoredResources(String resourceGroupName, String monitorName); /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMonitoredResources(String resourceGroupName, String monitorName, + Context context); + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLinkedResources(String resourceGroupName, String monitorName); + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedIterable}. + * @return response of a list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMonitoredResources( - String resourceGroupName, String monitorName, Context context); + PagedIterable listLinkedResources(String resourceGroupName, String monitorName, + Context context); /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -452,12 +483,12 @@ PagedIterable listMonitoredResources( * @return response of payload to be passed while installing VM agent along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response vmHostPayloadWithResponse( - String resourceGroupName, String monitorName, Context context); + Response vmHostPayloadWithResponse(String resourceGroupName, String monitorName, + Context context); /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/NewRelicObservability.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/NewRelicObservability.java index 5057a6922bb54..7e0ff48dea9da 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/NewRelicObservability.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/NewRelicObservability.java @@ -7,82 +7,105 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for NewRelicObservability class. */ +/** + * The interface for NewRelicObservability class. + */ public interface NewRelicObservability { /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); /** * Gets the AccountsClient object to access its operations. - * + * * @return the AccountsClient object. */ AccountsClient getAccounts(); /** * Gets the MonitorsClient object to access its operations. - * + * * @return the MonitorsClient object. */ MonitorsClient getMonitors(); /** * Gets the OrganizationsClient object to access its operations. - * + * * @return the OrganizationsClient object. */ OrganizationsClient getOrganizations(); /** * Gets the PlansClient object to access its operations. - * + * * @return the PlansClient object. */ PlansClient getPlans(); + /** + * Gets the BillingInfoesClient object to access its operations. + * + * @return the BillingInfoesClient object. + */ + BillingInfoesClient getBillingInfoes(); + + /** + * Gets the ConnectedPartnerResourcesClient object to access its operations. + * + * @return the ConnectedPartnerResourcesClient object. + */ + ConnectedPartnerResourcesClient getConnectedPartnerResources(); + /** * Gets the TagRulesClient object to access its operations. - * + * * @return the TagRulesClient object. */ TagRulesClient getTagRules(); + + /** + * Gets the MonitoredSubscriptionsClient object to access its operations. + * + * @return the MonitoredSubscriptionsClient object. + */ + MonitoredSubscriptionsClient getMonitoredSubscriptions(); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OperationsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OperationsClient.java index 030cebabc15ae..a307b7f3ffeff 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OperationsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OperationsClient.java @@ -10,28 +10,30 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.newrelicobservability.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * List the operations for the provider. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OrganizationsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OrganizationsClient.java index 022c25a18cfe6..491a4703922aa 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OrganizationsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OrganizationsClient.java @@ -10,11 +10,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner; -/** An instance of this class provides access to all the operations defined in OrganizationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OrganizationsClient. + */ public interface OrganizationsClient { /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -27,7 +29,7 @@ public interface OrganizationsClient { /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/PlansClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/PlansClient.java index 5fdc8edde21f2..0b27f3e793e2a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/PlansClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/PlansClient.java @@ -10,11 +10,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner; -/** An instance of this class provides access to all the operations defined in PlansClient. */ +/** + * An instance of this class provides access to all the operations defined in PlansClient. + */ public interface PlansClient { /** * List plans data. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all plan data Operation as paginated response with {@link PagedIterable}. @@ -24,7 +26,7 @@ public interface PlansClient { /** * List plans data. - * + * * @param accountId Account Id. * @param organizationId Organization Id. * @param context The context to associate with this operation. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/TagRulesClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/TagRulesClient.java index b7d971519c4e7..e3d1e34d15e1c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/TagRulesClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/TagRulesClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdateInner; -/** An instance of this class provides access to all the operations defined in TagRulesClient. */ +/** + * An instance of this class provides access to all the operations defined in TagRulesClient. + */ public interface TagRulesClient { /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +33,7 @@ public interface TagRulesClient { /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -41,12 +43,12 @@ public interface TagRulesClient { * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNewRelicMonitorResource( - String resourceGroupName, String monitorName, Context context); + PagedIterable listByNewRelicMonitorResource(String resourceGroupName, String monitorName, + Context context); /** * Get a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -57,12 +59,12 @@ PagedIterable listByNewRelicMonitorResource( * @return a TagRule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String monitorName, String ruleSetName, Context context); + Response getWithResponse(String resourceGroupName, String monitorName, String ruleSetName, + Context context); /** * Get a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -76,7 +78,7 @@ Response getWithResponse( /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -87,12 +89,12 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TagRuleInner> beginCreateOrUpdate( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource); + SyncPoller, TagRuleInner> beginCreateOrUpdate(String resourceGroupName, String monitorName, + String ruleSetName, TagRuleInner resource); /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -104,12 +106,12 @@ SyncPoller, TagRuleInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TagRuleInner> beginCreateOrUpdate( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context); + SyncPoller, TagRuleInner> beginCreateOrUpdate(String resourceGroupName, String monitorName, + String ruleSetName, TagRuleInner resource, Context context); /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -120,12 +122,12 @@ SyncPoller, TagRuleInner> beginCreateOrUpdate( * @return a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagRuleInner createOrUpdate( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource); + TagRuleInner createOrUpdate(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleInner resource); /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -137,12 +139,12 @@ TagRuleInner createOrUpdate( * @return a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagRuleInner createOrUpdate( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context); + TagRuleInner createOrUpdate(String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, + Context context); /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -156,7 +158,7 @@ TagRuleInner createOrUpdate( /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -167,12 +169,12 @@ TagRuleInner createOrUpdate( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String monitorName, String ruleSetName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String ruleSetName, + Context context); /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -185,7 +187,7 @@ SyncPoller, Void> beginDelete( /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -199,7 +201,7 @@ SyncPoller, Void> beginDelete( /** * Update a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -211,16 +213,12 @@ SyncPoller, Void> beginDelete( * @return a tag rule belonging to NewRelic account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String monitorName, - String ruleSetName, - TagRuleUpdateInner properties, - Context context); + Response updateWithResponse(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties, Context context); /** * Update a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -231,6 +229,6 @@ Response updateWithResponse( * @return a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagRuleInner update( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdateInner properties); + TagRuleInner update(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountProperties.java index fe7862b7a39e4..9c2d1eba9b28d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountProperties.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** List of all the New relic accounts for the given user. */ +/** + * List of all the New relic accounts for the given user. + */ @Fluent public final class AccountProperties { /* @@ -29,18 +31,20 @@ public final class AccountProperties { private String accountName; /* - * region + * Region where New Relic account is present */ @JsonProperty(value = "region") private String region; - /** Creates an instance of AccountProperties class. */ + /** + * Creates an instance of AccountProperties class. + */ public AccountProperties() { } /** * Get the organizationId property: organization id. - * + * * @return the organizationId value. */ public String organizationId() { @@ -49,7 +53,7 @@ public String organizationId() { /** * Set the organizationId property: organization id. - * + * * @param organizationId the organizationId value to set. * @return the AccountProperties object itself. */ @@ -60,7 +64,7 @@ public AccountProperties withOrganizationId(String organizationId) { /** * Get the accountId property: account id. - * + * * @return the accountId value. */ public String accountId() { @@ -69,7 +73,7 @@ public String accountId() { /** * Set the accountId property: account id. - * + * * @param accountId the accountId value to set. * @return the AccountProperties object itself. */ @@ -80,7 +84,7 @@ public AccountProperties withAccountId(String accountId) { /** * Get the accountName property: account name. - * + * * @return the accountName value. */ public String accountName() { @@ -89,7 +93,7 @@ public String accountName() { /** * Set the accountName property: account name. - * + * * @param accountName the accountName value to set. * @return the AccountProperties object itself. */ @@ -99,8 +103,8 @@ public AccountProperties withAccountName(String accountName) { } /** - * Get the region property: region. - * + * Get the region property: Region where New Relic account is present. + * * @return the region value. */ public String region() { @@ -108,8 +112,8 @@ public String region() { } /** - * Set the region property: region. - * + * Set the region property: Region where New Relic account is present. + * * @param region the region value to set. * @return the AccountProperties object itself. */ @@ -120,7 +124,7 @@ public AccountProperties withRegion(String region) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountResourceInner.java index 1ed1f744a4001..b9fea867ecf55 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountResourceInner.java @@ -9,7 +9,9 @@ import com.azure.core.management.SystemData; import com.fasterxml.jackson.annotation.JsonProperty; -/** The details of a account resource. */ +/** + * The details of a account resource. + */ @Fluent public final class AccountResourceInner extends ProxyResource { /* @@ -24,13 +26,15 @@ public final class AccountResourceInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of AccountResourceInner class. */ + /** + * Creates an instance of AccountResourceInner class. + */ public AccountResourceInner() { } /** * Get the innerProperties property: The resource-specific properties for this resource. - * + * * @return the innerProperties value. */ private AccountProperties innerProperties() { @@ -39,7 +43,7 @@ private AccountProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -48,7 +52,7 @@ public SystemData systemData() { /** * Get the organizationId property: organization id. - * + * * @return the organizationId value. */ public String organizationId() { @@ -57,7 +61,7 @@ public String organizationId() { /** * Set the organizationId property: organization id. - * + * * @param organizationId the organizationId value to set. * @return the AccountResourceInner object itself. */ @@ -71,7 +75,7 @@ public AccountResourceInner withOrganizationId(String organizationId) { /** * Get the accountId property: account id. - * + * * @return the accountId value. */ public String accountId() { @@ -80,7 +84,7 @@ public String accountId() { /** * Set the accountId property: account id. - * + * * @param accountId the accountId value to set. * @return the AccountResourceInner object itself. */ @@ -94,7 +98,7 @@ public AccountResourceInner withAccountId(String accountId) { /** * Get the accountName property: account name. - * + * * @return the accountName value. */ public String accountName() { @@ -103,7 +107,7 @@ public String accountName() { /** * Set the accountName property: account name. - * + * * @param accountName the accountName value to set. * @return the AccountResourceInner object itself. */ @@ -116,8 +120,8 @@ public AccountResourceInner withAccountName(String accountName) { } /** - * Get the region property: region. - * + * Get the region property: Region where New Relic account is present. + * * @return the region value. */ public String region() { @@ -125,8 +129,8 @@ public String region() { } /** - * Set the region property: region. - * + * Set the region property: Region where New Relic account is present. + * * @param region the region value to set. * @return the AccountResourceInner object itself. */ @@ -140,7 +144,7 @@ public AccountResourceInner withRegion(String region) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AppServiceInfoInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AppServiceInfoInner.java index a06da081e1979..6ebc8c67419cb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AppServiceInfoInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AppServiceInfoInner.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Details of VM Resource having NewRelic OneAgent installed. */ +/** + * Details of VM Resource having NewRelic OneAgent installed. + */ @Fluent public final class AppServiceInfoInner { /* @@ -28,13 +30,15 @@ public final class AppServiceInfoInner { @JsonProperty(value = "agentStatus") private String agentStatus; - /** Creates an instance of AppServiceInfoInner class. */ + /** + * Creates an instance of AppServiceInfoInner class. + */ public AppServiceInfoInner() { } /** * Get the azureResourceId property: Azure App service resource ID. - * + * * @return the azureResourceId value. */ public String azureResourceId() { @@ -43,7 +47,7 @@ public String azureResourceId() { /** * Set the azureResourceId property: Azure App service resource ID. - * + * * @param azureResourceId the azureResourceId value to set. * @return the AppServiceInfoInner object itself. */ @@ -54,7 +58,7 @@ public AppServiceInfoInner withAzureResourceId(String azureResourceId) { /** * Get the agentVersion property: Version of the NewRelic agent installed on the App service. - * + * * @return the agentVersion value. */ public String agentVersion() { @@ -63,7 +67,7 @@ public String agentVersion() { /** * Set the agentVersion property: Version of the NewRelic agent installed on the App service. - * + * * @param agentVersion the agentVersion value to set. * @return the AppServiceInfoInner object itself. */ @@ -74,7 +78,7 @@ public AppServiceInfoInner withAgentVersion(String agentVersion) { /** * Get the agentStatus property: Status of the NewRelic agent installed on the App service. - * + * * @return the agentStatus value. */ public String agentStatus() { @@ -83,7 +87,7 @@ public String agentStatus() { /** * Set the agentStatus property: Status of the NewRelic agent installed on the App service. - * + * * @param agentStatus the agentStatus value to set. * @return the AppServiceInfoInner object itself. */ @@ -94,7 +98,7 @@ public AppServiceInfoInner withAgentStatus(String agentStatus) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/BillingInfoResponseInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/BillingInfoResponseInner.java new file mode 100644 index 0000000000000..835449f04a4f7 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/BillingInfoResponseInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.newrelicobservability.models.MarketplaceSaaSInfo; +import com.azure.resourcemanager.newrelicobservability.models.PartnerBillingEntity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Marketplace Subscription and Organization details to which resource gets billed into. + */ +@Fluent +public final class BillingInfoResponseInner { + /* + * Marketplace Subscription details + */ + @JsonProperty(value = "marketplaceSaasInfo") + private MarketplaceSaaSInfo marketplaceSaasInfo; + + /* + * Partner Billing Entity details: Organization Info + */ + @JsonProperty(value = "partnerBillingEntity") + private PartnerBillingEntity partnerBillingEntity; + + /** + * Creates an instance of BillingInfoResponseInner class. + */ + public BillingInfoResponseInner() { + } + + /** + * Get the marketplaceSaasInfo property: Marketplace Subscription details. + * + * @return the marketplaceSaasInfo value. + */ + public MarketplaceSaaSInfo marketplaceSaasInfo() { + return this.marketplaceSaasInfo; + } + + /** + * Set the marketplaceSaasInfo property: Marketplace Subscription details. + * + * @param marketplaceSaasInfo the marketplaceSaasInfo value to set. + * @return the BillingInfoResponseInner object itself. + */ + public BillingInfoResponseInner withMarketplaceSaasInfo(MarketplaceSaaSInfo marketplaceSaasInfo) { + this.marketplaceSaasInfo = marketplaceSaasInfo; + return this; + } + + /** + * Get the partnerBillingEntity property: Partner Billing Entity details: Organization Info. + * + * @return the partnerBillingEntity value. + */ + public PartnerBillingEntity partnerBillingEntity() { + return this.partnerBillingEntity; + } + + /** + * Set the partnerBillingEntity property: Partner Billing Entity details: Organization Info. + * + * @param partnerBillingEntity the partnerBillingEntity value to set. + * @return the BillingInfoResponseInner object itself. + */ + public BillingInfoResponseInner withPartnerBillingEntity(PartnerBillingEntity partnerBillingEntity) { + this.partnerBillingEntity = partnerBillingEntity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (marketplaceSaasInfo() != null) { + marketplaceSaasInfo().validate(); + } + if (partnerBillingEntity() != null) { + partnerBillingEntity().validate(); + } + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/ConnectedPartnerResourcesListFormatInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/ConnectedPartnerResourcesListFormatInner.java new file mode 100644 index 0000000000000..19a6b659015e8 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/ConnectedPartnerResourcesListFormatInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connected Partner Resources List Format. + */ +@Fluent +public final class ConnectedPartnerResourcesListFormatInner { + /* + * Connected Partner Resource Properties + */ + @JsonProperty(value = "properties") + private ConnectedPartnerResourceProperties properties; + + /** + * Creates an instance of ConnectedPartnerResourcesListFormatInner class. + */ + public ConnectedPartnerResourcesListFormatInner() { + } + + /** + * Get the properties property: Connected Partner Resource Properties. + * + * @return the properties value. + */ + public ConnectedPartnerResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Connected Partner Resource Properties. + * + * @param properties the properties value to set. + * @return the ConnectedPartnerResourcesListFormatInner object itself. + */ + public ConnectedPartnerResourcesListFormatInner withProperties(ConnectedPartnerResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LinkedResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LinkedResourceInner.java new file mode 100644 index 0000000000000..d3f7375f257f8 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LinkedResourceInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of a linked resource. + */ +@Fluent +public final class LinkedResourceInner { + /* + * The ARM id of the linked resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Creates an instance of LinkedResourceInner class. + */ + public LinkedResourceInner() { + } + + /** + * Get the id property: The ARM id of the linked resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM id of the linked resource. + * + * @param id the id value to set. + * @return the LinkedResourceInner object itself. + */ + public LinkedResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricRulesInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricRulesInner.java index 48c67894582cf..eadf1eb2a7474 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricRulesInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricRulesInner.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Set of rules for sending metrics for the Monitor resource. */ +/** + * Set of rules for sending metrics for the Monitor resource. + */ @Fluent public final class MetricRulesInner { /* @@ -31,13 +33,15 @@ public final class MetricRulesInner { @JsonProperty(value = "userEmail") private String userEmail; - /** Creates an instance of MetricRulesInner class. */ + /** + * Creates an instance of MetricRulesInner class. + */ public MetricRulesInner() { } /** * Get the sendMetrics property: Flag specifying if metrics should be sent for the Monitor resource. - * + * * @return the sendMetrics value. */ public SendMetricsStatus sendMetrics() { @@ -46,7 +50,7 @@ public SendMetricsStatus sendMetrics() { /** * Set the sendMetrics property: Flag specifying if metrics should be sent for the Monitor resource. - * + * * @param sendMetrics the sendMetrics value to set. * @return the MetricRulesInner object itself. */ @@ -57,7 +61,7 @@ public MetricRulesInner withSendMetrics(SendMetricsStatus sendMetrics) { /** * Get the filteringTags property: List of filtering tags to be used for capturing metrics. - * + * * @return the filteringTags value. */ public List filteringTags() { @@ -66,7 +70,7 @@ public List filteringTags() { /** * Set the filteringTags property: List of filtering tags to be used for capturing metrics. - * + * * @param filteringTags the filteringTags value to set. * @return the MetricRulesInner object itself. */ @@ -77,7 +81,7 @@ public MetricRulesInner withFilteringTags(List filteringTags) { /** * Get the userEmail property: User Email. - * + * * @return the userEmail value. */ public String userEmail() { @@ -86,7 +90,7 @@ public String userEmail() { /** * Set the userEmail property: User Email. - * + * * @param userEmail the userEmail value to set. * @return the MetricRulesInner object itself. */ @@ -97,7 +101,7 @@ public MetricRulesInner withUserEmail(String userEmail) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricsStatusResponseInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricsStatusResponseInner.java index 56ae936dc2f12..e3e0cb38499ec 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricsStatusResponseInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricsStatusResponseInner.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response of get metrics status Operation. */ +/** + * Response of get metrics status Operation. + */ @Fluent public final class MetricsStatusResponseInner { /* @@ -17,13 +19,15 @@ public final class MetricsStatusResponseInner { @JsonProperty(value = "azureResourceIds") private List azureResourceIds; - /** Creates an instance of MetricsStatusResponseInner class. */ + /** + * Creates an instance of MetricsStatusResponseInner class. + */ public MetricsStatusResponseInner() { } /** * Get the azureResourceIds property: Azure resource IDs. - * + * * @return the azureResourceIds value. */ public List azureResourceIds() { @@ -32,7 +36,7 @@ public List azureResourceIds() { /** * Set the azureResourceIds property: Azure resource IDs. - * + * * @param azureResourceIds the azureResourceIds value to set. * @return the MetricsStatusResponseInner object itself. */ @@ -43,7 +47,7 @@ public MetricsStatusResponseInner withAzureResourceIds(List azureResourc /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitorProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitorProperties.java index cfad9ad1adfe3..9684d76c19645 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitorProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitorProperties.java @@ -16,7 +16,9 @@ import com.azure.resourcemanager.newrelicobservability.models.UserInfo; import com.fasterxml.jackson.annotation.JsonProperty; -/** Properties specific to the NewRelic Monitor resource. */ +/** + * Properties specific to the NewRelic Monitor resource. + */ @Fluent public final class MonitorProperties { /* @@ -85,13 +87,27 @@ public final class MonitorProperties { @JsonProperty(value = "accountCreationSource") private AccountCreationSource accountCreationSource; - /** Creates an instance of MonitorProperties class. */ + /* + * State of the Azure Subscription containing the monitor resource + */ + @JsonProperty(value = "subscriptionState") + private String subscriptionState; + + /* + * Status of Azure Subscription where Marketplace SaaS is located. + */ + @JsonProperty(value = "saaSAzureSubscriptionStatus") + private String saaSAzureSubscriptionStatus; + + /** + * Creates an instance of MonitorProperties class. + */ public MonitorProperties() { } /** * Get the provisioningState property: Provisioning State of the resource. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -100,7 +116,7 @@ public ProvisioningState provisioningState() { /** * Get the monitoringStatus property: MonitoringStatus of the resource. - * + * * @return the monitoringStatus value. */ public MonitoringStatus monitoringStatus() { @@ -109,7 +125,7 @@ public MonitoringStatus monitoringStatus() { /** * Get the marketplaceSubscriptionStatus property: NewRelic Organization properties of the resource. - * + * * @return the marketplaceSubscriptionStatus value. */ public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { @@ -118,7 +134,7 @@ public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { /** * Get the marketplaceSubscriptionId property: Marketplace Subscription Id. - * + * * @return the marketplaceSubscriptionId value. */ public String marketplaceSubscriptionId() { @@ -127,7 +143,7 @@ public String marketplaceSubscriptionId() { /** * Get the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @return the newRelicAccountProperties value. */ public NewRelicAccountProperties newRelicAccountProperties() { @@ -136,7 +152,7 @@ public NewRelicAccountProperties newRelicAccountProperties() { /** * Set the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @param newRelicAccountProperties the newRelicAccountProperties value to set. * @return the MonitorProperties object itself. */ @@ -147,7 +163,7 @@ public MonitorProperties withNewRelicAccountProperties(NewRelicAccountProperties /** * Get the userInfo property: User Info. - * + * * @return the userInfo value. */ public UserInfo userInfo() { @@ -156,7 +172,7 @@ public UserInfo userInfo() { /** * Set the userInfo property: User Info. - * + * * @param userInfo the userInfo value to set. * @return the MonitorProperties object itself. */ @@ -167,7 +183,7 @@ public MonitorProperties withUserInfo(UserInfo userInfo) { /** * Get the planData property: Plan details. - * + * * @return the planData value. */ public PlanData planData() { @@ -176,7 +192,7 @@ public PlanData planData() { /** * Set the planData property: Plan details. - * + * * @param planData the planData value to set. * @return the MonitorProperties object itself. */ @@ -187,7 +203,7 @@ public MonitorProperties withPlanData(PlanData planData) { /** * Get the liftrResourceCategory property: Liftr resource category. - * + * * @return the liftrResourceCategory value. */ public LiftrResourceCategories liftrResourceCategory() { @@ -196,7 +212,7 @@ public LiftrResourceCategories liftrResourceCategory() { /** * Get the liftrResourcePreference property: Liftr resource preference. The priority of the resource. - * + * * @return the liftrResourcePreference value. */ public Integer liftrResourcePreference() { @@ -205,7 +221,7 @@ public Integer liftrResourcePreference() { /** * Get the orgCreationSource property: Source of org creation. - * + * * @return the orgCreationSource value. */ public OrgCreationSource orgCreationSource() { @@ -214,7 +230,7 @@ public OrgCreationSource orgCreationSource() { /** * Set the orgCreationSource property: Source of org creation. - * + * * @param orgCreationSource the orgCreationSource value to set. * @return the MonitorProperties object itself. */ @@ -225,7 +241,7 @@ public MonitorProperties withOrgCreationSource(OrgCreationSource orgCreationSour /** * Get the accountCreationSource property: Source of account creation. - * + * * @return the accountCreationSource value. */ public AccountCreationSource accountCreationSource() { @@ -234,7 +250,7 @@ public AccountCreationSource accountCreationSource() { /** * Set the accountCreationSource property: Source of account creation. - * + * * @param accountCreationSource the accountCreationSource value to set. * @return the MonitorProperties object itself. */ @@ -243,9 +259,49 @@ public MonitorProperties withAccountCreationSource(AccountCreationSource account return this; } + /** + * Get the subscriptionState property: State of the Azure Subscription containing the monitor resource. + * + * @return the subscriptionState value. + */ + public String subscriptionState() { + return this.subscriptionState; + } + + /** + * Set the subscriptionState property: State of the Azure Subscription containing the monitor resource. + * + * @param subscriptionState the subscriptionState value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withSubscriptionState(String subscriptionState) { + this.subscriptionState = subscriptionState; + return this; + } + + /** + * Get the saaSAzureSubscriptionStatus property: Status of Azure Subscription where Marketplace SaaS is located. + * + * @return the saaSAzureSubscriptionStatus value. + */ + public String saaSAzureSubscriptionStatus() { + return this.saaSAzureSubscriptionStatus; + } + + /** + * Set the saaSAzureSubscriptionStatus property: Status of Azure Subscription where Marketplace SaaS is located. + * + * @param saaSAzureSubscriptionStatus the saaSAzureSubscriptionStatus value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withSaaSAzureSubscriptionStatus(String saaSAzureSubscriptionStatus) { + this.saaSAzureSubscriptionStatus = saaSAzureSubscriptionStatus; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredResourceInner.java index 294cfd43a25ed..2067b0609c848 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredResourceInner.java @@ -9,7 +9,9 @@ import com.azure.resourcemanager.newrelicobservability.models.SendingMetricsStatus; import com.fasterxml.jackson.annotation.JsonProperty; -/** Details of resource being monitored by NewRelic monitor resource. */ +/** + * Details of resource being monitored by NewRelic monitor resource. + */ @Fluent public final class MonitoredResourceInner { /* @@ -42,13 +44,15 @@ public final class MonitoredResourceInner { @JsonProperty(value = "reasonForLogsStatus") private String reasonForLogsStatus; - /** Creates an instance of MonitoredResourceInner class. */ + /** + * Creates an instance of MonitoredResourceInner class. + */ public MonitoredResourceInner() { } /** * Get the id property: The ARM id of the resource. - * + * * @return the id value. */ public String id() { @@ -57,7 +61,7 @@ public String id() { /** * Set the id property: The ARM id of the resource. - * + * * @param id the id value to set. * @return the MonitoredResourceInner object itself. */ @@ -68,7 +72,7 @@ public MonitoredResourceInner withId(String id) { /** * Get the sendingMetrics property: Flag indicating if resource is sending metrics to NewRelic. - * + * * @return the sendingMetrics value. */ public SendingMetricsStatus sendingMetrics() { @@ -77,7 +81,7 @@ public SendingMetricsStatus sendingMetrics() { /** * Set the sendingMetrics property: Flag indicating if resource is sending metrics to NewRelic. - * + * * @param sendingMetrics the sendingMetrics value to set. * @return the MonitoredResourceInner object itself. */ @@ -89,7 +93,7 @@ public MonitoredResourceInner withSendingMetrics(SendingMetricsStatus sendingMet /** * Get the reasonForMetricsStatus property: Reason for why the resource is sending metrics (or why it is not * sending). - * + * * @return the reasonForMetricsStatus value. */ public String reasonForMetricsStatus() { @@ -99,7 +103,7 @@ public String reasonForMetricsStatus() { /** * Set the reasonForMetricsStatus property: Reason for why the resource is sending metrics (or why it is not * sending). - * + * * @param reasonForMetricsStatus the reasonForMetricsStatus value to set. * @return the MonitoredResourceInner object itself. */ @@ -110,7 +114,7 @@ public MonitoredResourceInner withReasonForMetricsStatus(String reasonForMetrics /** * Get the sendingLogs property: Flag indicating if resource is sending logs to NewRelic. - * + * * @return the sendingLogs value. */ public SendingLogsStatus sendingLogs() { @@ -119,7 +123,7 @@ public SendingLogsStatus sendingLogs() { /** * Set the sendingLogs property: Flag indicating if resource is sending logs to NewRelic. - * + * * @param sendingLogs the sendingLogs value to set. * @return the MonitoredResourceInner object itself. */ @@ -130,7 +134,7 @@ public MonitoredResourceInner withSendingLogs(SendingLogsStatus sendingLogs) { /** * Get the reasonForLogsStatus property: Reason for why the resource is sending logs (or why it is not sending). - * + * * @return the reasonForLogsStatus value. */ public String reasonForLogsStatus() { @@ -139,7 +143,7 @@ public String reasonForLogsStatus() { /** * Set the reasonForLogsStatus property: Reason for why the resource is sending logs (or why it is not sending). - * + * * @param reasonForLogsStatus the reasonForLogsStatus value to set. * @return the MonitoredResourceInner object itself. */ @@ -150,7 +154,7 @@ public MonitoredResourceInner withReasonForLogsStatus(String reasonForLogsStatus /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionInner.java new file mode 100644 index 0000000000000..46e8a7c4dbee2 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionInner.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.newrelicobservability.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of subscriptions and it's monitoring status by current NewRelic monitor. + */ +@Fluent +public final class MonitoredSubscriptionInner { + /* + * The subscriptionId to be monitored. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /* + * The state of monitoring. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * The reason of not monitoring the subscription. + */ + @JsonProperty(value = "error") + private String error; + + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "tagRules") + private MonitoringTagRulesPropertiesInner tagRules; + + /** + * Creates an instance of MonitoredSubscriptionInner class. + */ + public MonitoredSubscriptionInner() { + } + + /** + * Get the subscriptionId property: The subscriptionId to be monitored. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: The subscriptionId to be monitored. + * + * @param subscriptionId the subscriptionId value to set. + * @return the MonitoredSubscriptionInner object itself. + */ + public MonitoredSubscriptionInner withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the status property: The state of monitoring. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The state of monitoring. + * + * @param status the status value to set. + * @return the MonitoredSubscriptionInner object itself. + */ + public MonitoredSubscriptionInner withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the error property: The reason of not monitoring the subscription. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Set the error property: The reason of not monitoring the subscription. + * + * @param error the error value to set. + * @return the MonitoredSubscriptionInner object itself. + */ + public MonitoredSubscriptionInner withError(String error) { + this.error = error; + return this; + } + + /** + * Get the tagRules property: The resource-specific properties for this resource. + * + * @return the tagRules value. + */ + public MonitoringTagRulesPropertiesInner tagRules() { + return this.tagRules; + } + + /** + * Set the tagRules property: The resource-specific properties for this resource. + * + * @param tagRules the tagRules value to set. + * @return the MonitoredSubscriptionInner object itself. + */ + public MonitoredSubscriptionInner withTagRules(MonitoringTagRulesPropertiesInner tagRules) { + this.tagRules = tagRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tagRules() != null) { + tagRules().validate(); + } + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionPropertiesInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionPropertiesInner.java new file mode 100644 index 0000000000000..aa16c325c746f --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionPropertiesInner.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.newrelicobservability.models.SubscriptionList; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ +@Fluent +public final class MonitoredSubscriptionPropertiesInner extends ProxyResource { + /* + * The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @JsonProperty(value = "properties") + private SubscriptionList properties; + + /** + * Creates an instance of MonitoredSubscriptionPropertiesInner class. + */ + public MonitoredSubscriptionPropertiesInner() { + } + + /** + * Get the properties property: The request to update subscriptions needed to be monitored by the NewRelic monitor + * resource. + * + * @return the properties value. + */ + public SubscriptionList properties() { + return this.properties; + } + + /** + * Set the properties property: The request to update subscriptions needed to be monitored by the NewRelic monitor + * resource. + * + * @param properties the properties value to set. + * @return the MonitoredSubscriptionPropertiesInner object itself. + */ + public MonitoredSubscriptionPropertiesInner withProperties(SubscriptionList properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoringTagRulesPropertiesInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoringTagRulesPropertiesInner.java index d52542789b3f9..69fba227d8739 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoringTagRulesPropertiesInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoringTagRulesPropertiesInner.java @@ -9,7 +9,9 @@ import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; -/** The resource-specific properties for this resource. */ +/** + * The resource-specific properties for this resource. + */ @Fluent public final class MonitoringTagRulesPropertiesInner { /* @@ -30,13 +32,15 @@ public final class MonitoringTagRulesPropertiesInner { @JsonProperty(value = "metricRules") private MetricRulesInner metricRules; - /** Creates an instance of MonitoringTagRulesPropertiesInner class. */ + /** + * Creates an instance of MonitoringTagRulesPropertiesInner class. + */ public MonitoringTagRulesPropertiesInner() { } /** * Get the provisioningState property: Provisioning State of the resource. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -45,7 +49,7 @@ public ProvisioningState provisioningState() { /** * Get the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @return the logRules value. */ public LogRules logRules() { @@ -54,7 +58,7 @@ public LogRules logRules() { /** * Set the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @param logRules the logRules value to set. * @return the MonitoringTagRulesPropertiesInner object itself. */ @@ -65,7 +69,7 @@ public MonitoringTagRulesPropertiesInner withLogRules(LogRules logRules) { /** * Get the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @return the metricRules value. */ public MetricRulesInner metricRules() { @@ -74,7 +78,7 @@ public MetricRulesInner metricRules() { /** * Set the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @param metricRules the metricRules value to set. * @return the MonitoringTagRulesPropertiesInner object itself. */ @@ -85,7 +89,7 @@ public MonitoringTagRulesPropertiesInner withMetricRules(MetricRulesInner metric /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceInner.java index 54fbf990fbf46..2d24d2e99e2bc 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceInner.java @@ -21,7 +21,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** A Monitor Resource by NewRelic. */ +/** + * A Monitor Resource by NewRelic. + */ @Fluent public final class NewRelicMonitorResourceInner extends Resource { /* @@ -42,13 +44,15 @@ public final class NewRelicMonitorResourceInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of NewRelicMonitorResourceInner class. */ + /** + * Creates an instance of NewRelicMonitorResourceInner class. + */ public NewRelicMonitorResourceInner() { } /** * Get the innerProperties property: The resource-specific properties for this resource. - * + * * @return the innerProperties value. */ private MonitorProperties innerProperties() { @@ -57,7 +61,7 @@ private MonitorProperties innerProperties() { /** * Get the identity property: The managed service identities assigned to this resource. - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -66,7 +70,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: The managed service identities assigned to this resource. - * + * * @param identity the identity value to set. * @return the NewRelicMonitorResourceInner object itself. */ @@ -77,21 +81,25 @@ public NewRelicMonitorResourceInner withIdentity(ManagedServiceIdentity identity /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NewRelicMonitorResourceInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NewRelicMonitorResourceInner withTags(Map tags) { super.withTags(tags); @@ -100,7 +108,7 @@ public NewRelicMonitorResourceInner withTags(Map tags) { /** * Get the provisioningState property: Provisioning State of the resource. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -109,7 +117,7 @@ public ProvisioningState provisioningState() { /** * Get the monitoringStatus property: MonitoringStatus of the resource. - * + * * @return the monitoringStatus value. */ public MonitoringStatus monitoringStatus() { @@ -118,7 +126,7 @@ public MonitoringStatus monitoringStatus() { /** * Get the marketplaceSubscriptionStatus property: NewRelic Organization properties of the resource. - * + * * @return the marketplaceSubscriptionStatus value. */ public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { @@ -127,7 +135,7 @@ public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { /** * Get the marketplaceSubscriptionId property: Marketplace Subscription Id. - * + * * @return the marketplaceSubscriptionId value. */ public String marketplaceSubscriptionId() { @@ -136,7 +144,7 @@ public String marketplaceSubscriptionId() { /** * Get the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @return the newRelicAccountProperties value. */ public NewRelicAccountProperties newRelicAccountProperties() { @@ -145,12 +153,12 @@ public NewRelicAccountProperties newRelicAccountProperties() { /** * Set the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @param newRelicAccountProperties the newRelicAccountProperties value to set. * @return the NewRelicMonitorResourceInner object itself. */ - public NewRelicMonitorResourceInner withNewRelicAccountProperties( - NewRelicAccountProperties newRelicAccountProperties) { + public NewRelicMonitorResourceInner + withNewRelicAccountProperties(NewRelicAccountProperties newRelicAccountProperties) { if (this.innerProperties() == null) { this.innerProperties = new MonitorProperties(); } @@ -160,7 +168,7 @@ public NewRelicMonitorResourceInner withNewRelicAccountProperties( /** * Get the userInfo property: User Info. - * + * * @return the userInfo value. */ public UserInfo userInfo() { @@ -169,7 +177,7 @@ public UserInfo userInfo() { /** * Set the userInfo property: User Info. - * + * * @param userInfo the userInfo value to set. * @return the NewRelicMonitorResourceInner object itself. */ @@ -183,7 +191,7 @@ public NewRelicMonitorResourceInner withUserInfo(UserInfo userInfo) { /** * Get the planData property: Plan details. - * + * * @return the planData value. */ public PlanData planData() { @@ -192,7 +200,7 @@ public PlanData planData() { /** * Set the planData property: Plan details. - * + * * @param planData the planData value to set. * @return the NewRelicMonitorResourceInner object itself. */ @@ -206,7 +214,7 @@ public NewRelicMonitorResourceInner withPlanData(PlanData planData) { /** * Get the liftrResourceCategory property: Liftr resource category. - * + * * @return the liftrResourceCategory value. */ public LiftrResourceCategories liftrResourceCategory() { @@ -215,7 +223,7 @@ public LiftrResourceCategories liftrResourceCategory() { /** * Get the liftrResourcePreference property: Liftr resource preference. The priority of the resource. - * + * * @return the liftrResourcePreference value. */ public Integer liftrResourcePreference() { @@ -224,7 +232,7 @@ public Integer liftrResourcePreference() { /** * Get the orgCreationSource property: Source of org creation. - * + * * @return the orgCreationSource value. */ public OrgCreationSource orgCreationSource() { @@ -233,7 +241,7 @@ public OrgCreationSource orgCreationSource() { /** * Set the orgCreationSource property: Source of org creation. - * + * * @param orgCreationSource the orgCreationSource value to set. * @return the NewRelicMonitorResourceInner object itself. */ @@ -247,7 +255,7 @@ public NewRelicMonitorResourceInner withOrgCreationSource(OrgCreationSource orgC /** * Get the accountCreationSource property: Source of account creation. - * + * * @return the accountCreationSource value. */ public AccountCreationSource accountCreationSource() { @@ -256,7 +264,7 @@ public AccountCreationSource accountCreationSource() { /** * Set the accountCreationSource property: Source of account creation. - * + * * @param accountCreationSource the accountCreationSource value to set. * @return the NewRelicMonitorResourceInner object itself. */ @@ -268,17 +276,61 @@ public NewRelicMonitorResourceInner withAccountCreationSource(AccountCreationSou return this; } + /** + * Get the subscriptionState property: State of the Azure Subscription containing the monitor resource. + * + * @return the subscriptionState value. + */ + public String subscriptionState() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionState(); + } + + /** + * Set the subscriptionState property: State of the Azure Subscription containing the monitor resource. + * + * @param subscriptionState the subscriptionState value to set. + * @return the NewRelicMonitorResourceInner object itself. + */ + public NewRelicMonitorResourceInner withSubscriptionState(String subscriptionState) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withSubscriptionState(subscriptionState); + return this; + } + + /** + * Get the saaSAzureSubscriptionStatus property: Status of Azure Subscription where Marketplace SaaS is located. + * + * @return the saaSAzureSubscriptionStatus value. + */ + public String saaSAzureSubscriptionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().saaSAzureSubscriptionStatus(); + } + + /** + * Set the saaSAzureSubscriptionStatus property: Status of Azure Subscription where Marketplace SaaS is located. + * + * @param saaSAzureSubscriptionStatus the saaSAzureSubscriptionStatus value to set. + * @return the NewRelicMonitorResourceInner object itself. + */ + public NewRelicMonitorResourceInner withSaaSAzureSubscriptionStatus(String saaSAzureSubscriptionStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withSaaSAzureSubscriptionStatus(saaSAzureSubscriptionStatus); + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model NewRelicMonitorResourceInner")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property innerProperties in model NewRelicMonitorResourceInner")); } else { innerProperties().validate(); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceUpdateProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceUpdateProperties.java index 0d8d715951c77..f4ef675e1293d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceUpdateProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceUpdateProperties.java @@ -12,7 +12,9 @@ import com.azure.resourcemanager.newrelicobservability.models.UserInfo; import com.fasterxml.jackson.annotation.JsonProperty; -/** The updatable properties of the NewRelicMonitorResource. */ +/** + * The updatable properties of the NewRelicMonitorResource. + */ @Fluent public final class NewRelicMonitorResourceUpdateProperties { /* @@ -45,13 +47,15 @@ public final class NewRelicMonitorResourceUpdateProperties { @JsonProperty(value = "accountCreationSource") private AccountCreationSource accountCreationSource; - /** Creates an instance of NewRelicMonitorResourceUpdateProperties class. */ + /** + * Creates an instance of NewRelicMonitorResourceUpdateProperties class. + */ public NewRelicMonitorResourceUpdateProperties() { } /** * Get the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @return the newRelicAccountProperties value. */ public NewRelicAccountProperties newRelicAccountProperties() { @@ -60,19 +64,19 @@ public NewRelicAccountProperties newRelicAccountProperties() { /** * Set the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @param newRelicAccountProperties the newRelicAccountProperties value to set. * @return the NewRelicMonitorResourceUpdateProperties object itself. */ - public NewRelicMonitorResourceUpdateProperties withNewRelicAccountProperties( - NewRelicAccountProperties newRelicAccountProperties) { + public NewRelicMonitorResourceUpdateProperties + withNewRelicAccountProperties(NewRelicAccountProperties newRelicAccountProperties) { this.newRelicAccountProperties = newRelicAccountProperties; return this; } /** * Get the userInfo property: User Info. - * + * * @return the userInfo value. */ public UserInfo userInfo() { @@ -81,7 +85,7 @@ public UserInfo userInfo() { /** * Set the userInfo property: User Info. - * + * * @param userInfo the userInfo value to set. * @return the NewRelicMonitorResourceUpdateProperties object itself. */ @@ -92,7 +96,7 @@ public NewRelicMonitorResourceUpdateProperties withUserInfo(UserInfo userInfo) { /** * Get the planData property: Plan details. - * + * * @return the planData value. */ public PlanData planData() { @@ -101,7 +105,7 @@ public PlanData planData() { /** * Set the planData property: Plan details. - * + * * @param planData the planData value to set. * @return the NewRelicMonitorResourceUpdateProperties object itself. */ @@ -112,7 +116,7 @@ public NewRelicMonitorResourceUpdateProperties withPlanData(PlanData planData) { /** * Get the orgCreationSource property: Source of org creation. - * + * * @return the orgCreationSource value. */ public OrgCreationSource orgCreationSource() { @@ -121,7 +125,7 @@ public OrgCreationSource orgCreationSource() { /** * Set the orgCreationSource property: Source of org creation. - * + * * @param orgCreationSource the orgCreationSource value to set. * @return the NewRelicMonitorResourceUpdateProperties object itself. */ @@ -132,7 +136,7 @@ public NewRelicMonitorResourceUpdateProperties withOrgCreationSource(OrgCreation /** * Get the accountCreationSource property: Source of account creation. - * + * * @return the accountCreationSource value. */ public AccountCreationSource accountCreationSource() { @@ -141,19 +145,19 @@ public AccountCreationSource accountCreationSource() { /** * Set the accountCreationSource property: Source of account creation. - * + * * @param accountCreationSource the accountCreationSource value to set. * @return the NewRelicMonitorResourceUpdateProperties object itself. */ - public NewRelicMonitorResourceUpdateProperties withAccountCreationSource( - AccountCreationSource accountCreationSource) { + public NewRelicMonitorResourceUpdateProperties + withAccountCreationSource(AccountCreationSource accountCreationSource) { this.accountCreationSource = accountCreationSource; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OperationInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OperationInner.java index ea0884c17c93c..fcb6e352326f2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OperationInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OperationInner.java @@ -12,8 +12,8 @@ /** * REST API Operation - * - *

Details of a REST API operation, returned from the Resource Provider Operations API. + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent public final class OperationInner { @@ -50,14 +50,16 @@ public final class OperationInner { @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; - /** Creates an instance of OperationInner class. */ + /** + * Creates an instance of OperationInner class. + */ public OperationInner() { } /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ public String name() { @@ -67,7 +69,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -76,7 +78,7 @@ public Boolean isDataAction() { /** * Get the display property: Localized display information for this particular operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -85,7 +87,7 @@ public OperationDisplay display() { /** * Set the display property: Localized display information for this particular operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -97,7 +99,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ public Origin origin() { @@ -107,7 +109,7 @@ public Origin origin() { /** * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ public ActionType actionType() { @@ -116,7 +118,7 @@ public ActionType actionType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationProperties.java index 3aac3269f2783..687ebeed98901 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationProperties.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.newrelicobservability.models.BillingSource; import com.fasterxml.jackson.annotation.JsonProperty; -/** Details of Organizations. */ +/** + * Details of Organizations. + */ @Fluent public final class OrganizationProperties { /* @@ -29,13 +31,15 @@ public final class OrganizationProperties { @JsonProperty(value = "billingSource") private BillingSource billingSource; - /** Creates an instance of OrganizationProperties class. */ + /** + * Creates an instance of OrganizationProperties class. + */ public OrganizationProperties() { } /** * Get the organizationId property: organization id. - * + * * @return the organizationId value. */ public String organizationId() { @@ -44,7 +48,7 @@ public String organizationId() { /** * Set the organizationId property: organization id. - * + * * @param organizationId the organizationId value to set. * @return the OrganizationProperties object itself. */ @@ -55,7 +59,7 @@ public OrganizationProperties withOrganizationId(String organizationId) { /** * Get the organizationName property: organization name. - * + * * @return the organizationName value. */ public String organizationName() { @@ -64,7 +68,7 @@ public String organizationName() { /** * Set the organizationName property: organization name. - * + * * @param organizationName the organizationName value to set. * @return the OrganizationProperties object itself. */ @@ -75,7 +79,7 @@ public OrganizationProperties withOrganizationName(String organizationName) { /** * Get the billingSource property: Billing source. - * + * * @return the billingSource value. */ public BillingSource billingSource() { @@ -84,7 +88,7 @@ public BillingSource billingSource() { /** * Set the billingSource property: Billing source. - * + * * @param billingSource the billingSource value to set. * @return the OrganizationProperties object itself. */ @@ -95,7 +99,7 @@ public OrganizationProperties withBillingSource(BillingSource billingSource) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationResourceInner.java index e4c77069e6c21..49728479de56a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationResourceInner.java @@ -10,7 +10,9 @@ import com.azure.resourcemanager.newrelicobservability.models.BillingSource; import com.fasterxml.jackson.annotation.JsonProperty; -/** The details of a Organization resource. */ +/** + * The details of a Organization resource. + */ @Fluent public final class OrganizationResourceInner extends ProxyResource { /* @@ -25,13 +27,15 @@ public final class OrganizationResourceInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of OrganizationResourceInner class. */ + /** + * Creates an instance of OrganizationResourceInner class. + */ public OrganizationResourceInner() { } /** * Get the innerProperties property: The resource-specific properties for this resource. - * + * * @return the innerProperties value. */ private OrganizationProperties innerProperties() { @@ -40,7 +44,7 @@ private OrganizationProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -49,7 +53,7 @@ public SystemData systemData() { /** * Get the organizationId property: organization id. - * + * * @return the organizationId value. */ public String organizationId() { @@ -58,7 +62,7 @@ public String organizationId() { /** * Set the organizationId property: organization id. - * + * * @param organizationId the organizationId value to set. * @return the OrganizationResourceInner object itself. */ @@ -72,7 +76,7 @@ public OrganizationResourceInner withOrganizationId(String organizationId) { /** * Get the organizationName property: organization name. - * + * * @return the organizationName value. */ public String organizationName() { @@ -81,7 +85,7 @@ public String organizationName() { /** * Set the organizationName property: organization name. - * + * * @param organizationName the organizationName value to set. * @return the OrganizationResourceInner object itself. */ @@ -95,7 +99,7 @@ public OrganizationResourceInner withOrganizationName(String organizationName) { /** * Get the billingSource property: Billing source. - * + * * @return the billingSource value. */ public BillingSource billingSource() { @@ -104,7 +108,7 @@ public BillingSource billingSource() { /** * Set the billingSource property: Billing source. - * + * * @param billingSource the billingSource value to set. * @return the OrganizationResourceInner object itself. */ @@ -118,7 +122,7 @@ public OrganizationResourceInner withBillingSource(BillingSource billingSource) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataProperties.java index b4ab5beb338a0..2773e5d2527c1 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataProperties.java @@ -10,7 +10,9 @@ import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.fasterxml.jackson.annotation.JsonProperty; -/** Plan details. */ +/** + * Plan details. + */ @Fluent public final class PlanDataProperties { /* @@ -31,13 +33,15 @@ public final class PlanDataProperties { @JsonProperty(value = "accountCreationSource") private AccountCreationSource accountCreationSource; - /** Creates an instance of PlanDataProperties class. */ + /** + * Creates an instance of PlanDataProperties class. + */ public PlanDataProperties() { } /** * Get the planData property: Plan details. - * + * * @return the planData value. */ public PlanData planData() { @@ -46,7 +50,7 @@ public PlanData planData() { /** * Set the planData property: Plan details. - * + * * @param planData the planData value to set. * @return the PlanDataProperties object itself. */ @@ -57,7 +61,7 @@ public PlanDataProperties withPlanData(PlanData planData) { /** * Get the orgCreationSource property: Source of org creation. - * + * * @return the orgCreationSource value. */ public OrgCreationSource orgCreationSource() { @@ -66,7 +70,7 @@ public OrgCreationSource orgCreationSource() { /** * Set the orgCreationSource property: Source of org creation. - * + * * @param orgCreationSource the orgCreationSource value to set. * @return the PlanDataProperties object itself. */ @@ -77,7 +81,7 @@ public PlanDataProperties withOrgCreationSource(OrgCreationSource orgCreationSou /** * Get the accountCreationSource property: Source of account creation. - * + * * @return the accountCreationSource value. */ public AccountCreationSource accountCreationSource() { @@ -86,7 +90,7 @@ public AccountCreationSource accountCreationSource() { /** * Set the accountCreationSource property: Source of account creation. - * + * * @param accountCreationSource the accountCreationSource value to set. * @return the PlanDataProperties object itself. */ @@ -97,7 +101,7 @@ public PlanDataProperties withAccountCreationSource(AccountCreationSource accoun /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataResourceInner.java index d541fd5140838..000633eb66ce7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataResourceInner.java @@ -12,7 +12,9 @@ import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.fasterxml.jackson.annotation.JsonProperty; -/** The details of a PlanData resource. */ +/** + * The details of a PlanData resource. + */ @Fluent public final class PlanDataResourceInner extends ProxyResource { /* @@ -27,13 +29,15 @@ public final class PlanDataResourceInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of PlanDataResourceInner class. */ + /** + * Creates an instance of PlanDataResourceInner class. + */ public PlanDataResourceInner() { } /** * Get the innerProperties property: The resource-specific properties for this resource. - * + * * @return the innerProperties value. */ private PlanDataProperties innerProperties() { @@ -42,7 +46,7 @@ private PlanDataProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -51,7 +55,7 @@ public SystemData systemData() { /** * Get the planData property: Plan details. - * + * * @return the planData value. */ public PlanData planData() { @@ -60,7 +64,7 @@ public PlanData planData() { /** * Set the planData property: Plan details. - * + * * @param planData the planData value to set. * @return the PlanDataResourceInner object itself. */ @@ -74,7 +78,7 @@ public PlanDataResourceInner withPlanData(PlanData planData) { /** * Get the orgCreationSource property: Source of org creation. - * + * * @return the orgCreationSource value. */ public OrgCreationSource orgCreationSource() { @@ -83,7 +87,7 @@ public OrgCreationSource orgCreationSource() { /** * Set the orgCreationSource property: Source of org creation. - * + * * @param orgCreationSource the orgCreationSource value to set. * @return the PlanDataResourceInner object itself. */ @@ -97,7 +101,7 @@ public PlanDataResourceInner withOrgCreationSource(OrgCreationSource orgCreation /** * Get the accountCreationSource property: Source of account creation. - * + * * @return the accountCreationSource value. */ public AccountCreationSource accountCreationSource() { @@ -106,7 +110,7 @@ public AccountCreationSource accountCreationSource() { /** * Set the accountCreationSource property: Source of account creation. - * + * * @param accountCreationSource the accountCreationSource value to set. * @return the PlanDataResourceInner object itself. */ @@ -120,7 +124,7 @@ public PlanDataResourceInner withAccountCreationSource(AccountCreationSource acc /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleInner.java index 8a237df6055a4..9990f515edcbb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleInner.java @@ -12,7 +12,9 @@ import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; -/** A tag rule belonging to NewRelic account. */ +/** + * A tag rule belonging to NewRelic account. + */ @Fluent public final class TagRuleInner extends ProxyResource { /* @@ -27,13 +29,15 @@ public final class TagRuleInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of TagRuleInner class. */ + /** + * Creates an instance of TagRuleInner class. + */ public TagRuleInner() { } /** * Get the innerProperties property: The resource-specific properties for this resource. - * + * * @return the innerProperties value. */ private MonitoringTagRulesPropertiesInner innerProperties() { @@ -42,7 +46,7 @@ private MonitoringTagRulesPropertiesInner innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -51,7 +55,7 @@ public SystemData systemData() { /** * Get the provisioningState property: Provisioning State of the resource. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -60,7 +64,7 @@ public ProvisioningState provisioningState() { /** * Get the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @return the logRules value. */ public LogRules logRules() { @@ -69,7 +73,7 @@ public LogRules logRules() { /** * Set the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @param logRules the logRules value to set. * @return the TagRuleInner object itself. */ @@ -83,7 +87,7 @@ public TagRuleInner withLogRules(LogRules logRules) { /** * Get the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @return the metricRules value. */ public MetricRulesInner metricRules() { @@ -92,7 +96,7 @@ public MetricRulesInner metricRules() { /** * Set the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @param metricRules the metricRules value to set. * @return the TagRuleInner object itself. */ @@ -106,14 +110,13 @@ public TagRuleInner withMetricRules(MetricRulesInner metricRules) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model TagRuleInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model TagRuleInner")); } else { innerProperties().validate(); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdateInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdateInner.java index dfef473f2a644..20f78dee1a815 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdateInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdateInner.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.newrelicobservability.models.LogRules; import com.fasterxml.jackson.annotation.JsonProperty; -/** The type used for update operations of the TagRule. */ +/** + * The type used for update operations of the TagRule. + */ @Fluent public final class TagRuleUpdateInner { /* @@ -17,13 +19,15 @@ public final class TagRuleUpdateInner { @JsonProperty(value = "properties") private TagRuleUpdatePropertiesInner innerProperties; - /** Creates an instance of TagRuleUpdateInner class. */ + /** + * Creates an instance of TagRuleUpdateInner class. + */ public TagRuleUpdateInner() { } /** * Get the innerProperties property: The updatable properties of the TagRule. - * + * * @return the innerProperties value. */ private TagRuleUpdatePropertiesInner innerProperties() { @@ -32,7 +36,7 @@ private TagRuleUpdatePropertiesInner innerProperties() { /** * Get the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @return the logRules value. */ public LogRules logRules() { @@ -41,7 +45,7 @@ public LogRules logRules() { /** * Set the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @param logRules the logRules value to set. * @return the TagRuleUpdateInner object itself. */ @@ -55,7 +59,7 @@ public TagRuleUpdateInner withLogRules(LogRules logRules) { /** * Get the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @return the metricRules value. */ public MetricRulesInner metricRules() { @@ -64,7 +68,7 @@ public MetricRulesInner metricRules() { /** * Set the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @param metricRules the metricRules value to set. * @return the TagRuleUpdateInner object itself. */ @@ -78,7 +82,7 @@ public TagRuleUpdateInner withMetricRules(MetricRulesInner metricRules) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdatePropertiesInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdatePropertiesInner.java index 687bdad877088..1dc98a2c7f9d6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdatePropertiesInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdatePropertiesInner.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.newrelicobservability.models.LogRules; import com.fasterxml.jackson.annotation.JsonProperty; -/** The updatable properties of the TagRule. */ +/** + * The updatable properties of the TagRule. + */ @Fluent public final class TagRuleUpdatePropertiesInner { /* @@ -23,13 +25,15 @@ public final class TagRuleUpdatePropertiesInner { @JsonProperty(value = "metricRules") private MetricRulesInner metricRules; - /** Creates an instance of TagRuleUpdatePropertiesInner class. */ + /** + * Creates an instance of TagRuleUpdatePropertiesInner class. + */ public TagRuleUpdatePropertiesInner() { } /** * Get the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @return the logRules value. */ public LogRules logRules() { @@ -38,7 +42,7 @@ public LogRules logRules() { /** * Set the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @param logRules the logRules value to set. * @return the TagRuleUpdatePropertiesInner object itself. */ @@ -49,7 +53,7 @@ public TagRuleUpdatePropertiesInner withLogRules(LogRules logRules) { /** * Get the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @return the metricRules value. */ public MetricRulesInner metricRules() { @@ -58,7 +62,7 @@ public MetricRulesInner metricRules() { /** * Set the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @param metricRules the metricRules value to set. * @return the TagRuleUpdatePropertiesInner object itself. */ @@ -69,7 +73,7 @@ public TagRuleUpdatePropertiesInner withMetricRules(MetricRulesInner metricRules /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMExtensionPayloadInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMExtensionPayloadInner.java index c8bd75268003c..6923a21104e71 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMExtensionPayloadInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMExtensionPayloadInner.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Response of payload to be passed while installing VM agent. */ +/** + * Response of payload to be passed while installing VM agent. + */ @Fluent public final class VMExtensionPayloadInner { /* @@ -16,13 +18,15 @@ public final class VMExtensionPayloadInner { @JsonProperty(value = "ingestionKey") private String ingestionKey; - /** Creates an instance of VMExtensionPayloadInner class. */ + /** + * Creates an instance of VMExtensionPayloadInner class. + */ public VMExtensionPayloadInner() { } /** * Get the ingestionKey property: Ingestion key of the account. - * + * * @return the ingestionKey value. */ public String ingestionKey() { @@ -31,7 +35,7 @@ public String ingestionKey() { /** * Set the ingestionKey property: Ingestion key of the account. - * + * * @param ingestionKey the ingestionKey value to set. * @return the VMExtensionPayloadInner object itself. */ @@ -42,7 +46,7 @@ public VMExtensionPayloadInner withIngestionKey(String ingestionKey) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMInfoInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMInfoInner.java index 34029b0c1850d..337f45f108224 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMInfoInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMInfoInner.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Details of VM Resource having NewRelic OneAgent installed. */ +/** + * Details of VM Resource having NewRelic OneAgent installed. + */ @Fluent public final class VMInfoInner { /* @@ -28,13 +30,15 @@ public final class VMInfoInner { @JsonProperty(value = "agentStatus") private String agentStatus; - /** Creates an instance of VMInfoInner class. */ + /** + * Creates an instance of VMInfoInner class. + */ public VMInfoInner() { } /** * Get the vmId property: Azure VM resource ID. - * + * * @return the vmId value. */ public String vmId() { @@ -43,7 +47,7 @@ public String vmId() { /** * Set the vmId property: Azure VM resource ID. - * + * * @param vmId the vmId value to set. * @return the VMInfoInner object itself. */ @@ -54,7 +58,7 @@ public VMInfoInner withVmId(String vmId) { /** * Get the agentVersion property: Version of the NewRelic agent installed on the VM. - * + * * @return the agentVersion value. */ public String agentVersion() { @@ -63,7 +67,7 @@ public String agentVersion() { /** * Set the agentVersion property: Version of the NewRelic agent installed on the VM. - * + * * @param agentVersion the agentVersion value to set. * @return the VMInfoInner object itself. */ @@ -74,7 +78,7 @@ public VMInfoInner withAgentVersion(String agentVersion) { /** * Get the agentStatus property: Status of the NewRelic agent installed on the VM. - * + * * @return the agentStatus value. */ public String agentStatus() { @@ -83,7 +87,7 @@ public String agentStatus() { /** * Set the agentStatus property: Status of the NewRelic agent installed on the VM. - * + * * @param agentStatus the agentStatus value to set. * @return the VMInfoInner object itself. */ @@ -94,7 +98,7 @@ public VMInfoInner withAgentStatus(String agentStatus) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/package-info.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/package-info.java index 92ec93e13d33e..57f83d2067eff 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/package-info.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for NewRelicObservability. null. */ +/** + * Package containing the inner data models for NewRelicObservability. + * null. + */ package com.azure.resourcemanager.newrelicobservability.fluent.models; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/package-info.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/package-info.java index 9639651ea926e..ac6fed96890a7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/package-info.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for NewRelicObservability. null. */ +/** + * Package containing the service clients for NewRelicObservability. + * null. + */ package com.azure.resourcemanager.newrelicobservability.fluent; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountResourceImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountResourceImpl.java index 02212054a6241..ba5eb8ffef8f6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountResourceImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountResourceImpl.java @@ -13,8 +13,7 @@ public final class AccountResourceImpl implements AccountResource { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - AccountResourceImpl( - AccountResourceInner innerObject, + AccountResourceImpl(AccountResourceInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsClientImpl.java index a04acdb1b9fb5..486fe2a102817 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsClientImpl.java @@ -30,17 +30,23 @@ import com.azure.resourcemanager.newrelicobservability.models.AccountsListResponse; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AccountsClient. */ +/** + * An instance of this class provides access to all the operations defined in AccountsClient. + */ public final class AccountsClientImpl implements AccountsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final AccountsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NewRelicObservabilityImpl client; /** * Initializes an instance of AccountsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AccountsClientImpl(NewRelicObservabilityImpl client) { @@ -55,54 +61,43 @@ public final class AccountsClientImpl implements AccountsClient { @Host("{$host}") @ServiceInterface(name = "NewRelicObservabilit") public interface AccountsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/accounts") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("userEmail") String userEmail, - @QueryParam("location") String location, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("userEmail") String userEmail, @QueryParam("location") String location, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String userEmail, String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (userEmail == null) { return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); @@ -112,32 +107,16 @@ private Mono> listSinglePageAsync(String use } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - userEmail, - location, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), userEmail, location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. @@ -145,22 +124,18 @@ private Mono> listSinglePageAsync(String use * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String userEmail, String location, Context context) { + private Mono> listSinglePageAsync(String userEmail, String location, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (userEmail == null) { return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); @@ -171,28 +146,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - userEmail, - location, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), userEmail, + location, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -202,13 +164,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String userEmail, String location) { - return new PagedFlux<>( - () -> listSinglePageAsync(userEmail, location), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. @@ -219,14 +181,13 @@ private PagedFlux listAsync(String userEmail, String locat */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String userEmail, String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(userEmail, location, context), + return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -241,7 +202,7 @@ public PagedIterable list(String userEmail, String locatio /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. @@ -257,14 +218,15 @@ public PagedIterable list(String userEmail, String locatio /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -272,37 +234,28 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -310,23 +263,13 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsImpl.java index c886051fb1ba0..989d43f5cd39c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsImpl.java @@ -19,8 +19,7 @@ public final class AccountsImpl implements Accounts { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - public AccountsImpl( - AccountsClient innerClient, + public AccountsImpl(AccountsClient innerClient, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public AccountsImpl( public PagedIterable list(String userEmail, String location) { PagedIterable inner = this.serviceClient().list(userEmail, location); - return Utils.mapPage(inner, inner1 -> new AccountResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountResourceImpl(inner1, this.manager())); } public PagedIterable list(String userEmail, String location, Context context) { PagedIterable inner = this.serviceClient().list(userEmail, location, context); - return Utils.mapPage(inner, inner1 -> new AccountResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountResourceImpl(inner1, this.manager())); } private AccountsClient serviceClient() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AppServiceInfoImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AppServiceInfoImpl.java index d23cb2edb8530..8839036a43f06 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AppServiceInfoImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AppServiceInfoImpl.java @@ -12,8 +12,7 @@ public final class AppServiceInfoImpl implements AppServiceInfo { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - AppServiceInfoImpl( - AppServiceInfoInner innerObject, + AppServiceInfoImpl(AppServiceInfoInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoResponseImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoResponseImpl.java new file mode 100644 index 0000000000000..d0c650d1d86b2 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoResponseImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner; +import com.azure.resourcemanager.newrelicobservability.models.BillingInfoResponse; +import com.azure.resourcemanager.newrelicobservability.models.MarketplaceSaaSInfo; +import com.azure.resourcemanager.newrelicobservability.models.PartnerBillingEntity; + +public final class BillingInfoResponseImpl implements BillingInfoResponse { + private BillingInfoResponseInner innerObject; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + BillingInfoResponseImpl(BillingInfoResponseInner innerObject, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public MarketplaceSaaSInfo marketplaceSaasInfo() { + return this.innerModel().marketplaceSaasInfo(); + } + + public PartnerBillingEntity partnerBillingEntity() { + return this.innerModel().partnerBillingEntity(); + } + + public BillingInfoResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesClientImpl.java new file mode 100644 index 0000000000000..421d8cd8c863b --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesClientImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.newrelicobservability.fluent.BillingInfoesClient; +import com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BillingInfoesClient. + */ +public final class BillingInfoesClientImpl implements BillingInfoesClient { + /** + * The proxy service used to perform REST calls. + */ + private final BillingInfoesService service; + + /** + * The service client containing this operation class. + */ + private final NewRelicObservabilityImpl client; + + /** + * Initializes an instance of BillingInfoesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BillingInfoesClientImpl(NewRelicObservabilityImpl client) { + this.service + = RestProxy.create(BillingInfoesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NewRelicObservabilityBillingInfoes to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NewRelicObservabilit") + public interface BillingInfoesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getBillingInfo") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get marketplace info mapped to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace info mapped to the given monitor along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get marketplace info mapped to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace info mapped to the given monitor along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String monitorName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, accept, context); + } + + /** + * Get marketplace info mapped to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace info mapped to the given monitor on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String monitorName) { + return getWithResponseAsync(resourceGroupName, monitorName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get marketplace info mapped to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace info mapped to the given monitor along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String monitorName, + Context context) { + return getWithResponseAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * Get marketplace info mapped to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace info mapped to the given monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingInfoResponseInner get(String resourceGroupName, String monitorName) { + return getWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesImpl.java new file mode 100644 index 0000000000000..6e3272bc8b5ed --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.newrelicobservability.fluent.BillingInfoesClient; +import com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner; +import com.azure.resourcemanager.newrelicobservability.models.BillingInfoResponse; +import com.azure.resourcemanager.newrelicobservability.models.BillingInfoes; + +public final class BillingInfoesImpl implements BillingInfoes { + private static final ClientLogger LOGGER = new ClientLogger(BillingInfoesImpl.class); + + private final BillingInfoesClient innerClient; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + public BillingInfoesImpl(BillingInfoesClient innerClient, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String monitorName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, monitorName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BillingInfoResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BillingInfoResponse get(String resourceGroupName, String monitorName) { + BillingInfoResponseInner inner = this.serviceClient().get(resourceGroupName, monitorName); + if (inner != null) { + return new BillingInfoResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private BillingInfoesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesClientImpl.java new file mode 100644 index 0000000000000..122d706635971 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesClientImpl.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.newrelicobservability.fluent.ConnectedPartnerResourcesClient; +import com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListResponse; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ConnectedPartnerResourcesClient. + */ +public final class ConnectedPartnerResourcesClientImpl implements ConnectedPartnerResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ConnectedPartnerResourcesService service; + + /** + * The service client containing this operation class. + */ + private final NewRelicObservabilityImpl client; + + /** + * Initializes an instance of ConnectedPartnerResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectedPartnerResourcesClientImpl(NewRelicObservabilityImpl client) { + this.service = RestProxy.create(ConnectedPartnerResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NewRelicObservabilityConnectedPartnerResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NewRelicObservabilit") + public interface ConnectedPartnerResourcesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listConnectedPartnerResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") String body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Email Id of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String monitorName, String body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, body, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Email Id of the user. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String monitorName, String body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, body, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Email Id of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName, + String body) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, body), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String monitorName) { + final String body = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, body), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Email Id of the user. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName, + String body, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, body, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName) { + final String body = null; + return new PagedIterable<>(listAsync(resourceGroupName, monitorName, body)); + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Email Id of the user. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName, + String body, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName, body, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesImpl.java new file mode 100644 index 0000000000000..cf5e56d9ca933 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.newrelicobservability.fluent.ConnectedPartnerResourcesClient; +import com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResources; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListFormat; + +public final class ConnectedPartnerResourcesImpl implements ConnectedPartnerResources { + private static final ClientLogger LOGGER = new ClientLogger(ConnectedPartnerResourcesImpl.class); + + private final ConnectedPartnerResourcesClient innerClient; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + public ConnectedPartnerResourcesImpl(ConnectedPartnerResourcesClient innerClient, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String monitorName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, monitorName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConnectedPartnerResourcesListFormatImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String monitorName, + String body, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, monitorName, body, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConnectedPartnerResourcesListFormatImpl(inner1, this.manager())); + } + + private ConnectedPartnerResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesListFormatImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesListFormatImpl.java new file mode 100644 index 0000000000000..ead42119d6e2f --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesListFormatImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourceProperties; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListFormat; + +public final class ConnectedPartnerResourcesListFormatImpl implements ConnectedPartnerResourcesListFormat { + private ConnectedPartnerResourcesListFormatInner innerObject; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + ConnectedPartnerResourcesListFormatImpl(ConnectedPartnerResourcesListFormatInner innerObject, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ConnectedPartnerResourceProperties properties() { + return this.innerModel().properties(); + } + + public ConnectedPartnerResourcesListFormatInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/LinkedResourceImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/LinkedResourceImpl.java new file mode 100644 index 0000000000000..81804fb1e6098 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/LinkedResourceImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; +import com.azure.resourcemanager.newrelicobservability.models.LinkedResource; + +public final class LinkedResourceImpl implements LinkedResource { + private LinkedResourceInner innerObject; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + LinkedResourceImpl(LinkedResourceInner innerObject, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public LinkedResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MetricRulesImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MetricRulesImpl.java index 5f217ce0d08c3..29a6752b64185 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MetricRulesImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MetricRulesImpl.java @@ -16,8 +16,7 @@ public final class MetricRulesImpl implements MetricRules { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - MetricRulesImpl( - MetricRulesInner innerObject, + MetricRulesImpl(MetricRulesInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MetricsStatusResponseImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MetricsStatusResponseImpl.java index a3550a8900319..35926b05312a9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MetricsStatusResponseImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MetricsStatusResponseImpl.java @@ -14,8 +14,7 @@ public final class MetricsStatusResponseImpl implements MetricsStatusResponse { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - MetricsStatusResponseImpl( - MetricsStatusResponseInner innerObject, + MetricsStatusResponseImpl(MetricsStatusResponseInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredResourceImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredResourceImpl.java index dbf820dee7c53..cad9c336284a8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredResourceImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredResourceImpl.java @@ -14,8 +14,7 @@ public final class MonitoredResourceImpl implements MonitoredResource { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - MonitoredResourceImpl( - MonitoredResourceInner innerObject, + MonitoredResourceImpl(MonitoredResourceInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionImpl.java new file mode 100644 index 0000000000000..5c1e56a7a5ab8 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscription; +import com.azure.resourcemanager.newrelicobservability.models.MonitoringTagRulesProperties; +import com.azure.resourcemanager.newrelicobservability.models.Status; + +public final class MonitoredSubscriptionImpl implements MonitoredSubscription { + private MonitoredSubscriptionInner innerObject; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + MonitoredSubscriptionImpl(MonitoredSubscriptionInner innerObject, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public Status status() { + return this.innerModel().status(); + } + + public String error() { + return this.innerModel().error(); + } + + public MonitoringTagRulesProperties tagRules() { + MonitoringTagRulesPropertiesInner inner = this.innerModel().tagRules(); + if (inner != null) { + return new MonitoringTagRulesPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public MonitoredSubscriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionPropertiesImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionPropertiesImpl.java new file mode 100644 index 0000000000000..8876220a39cb5 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionPropertiesImpl.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; +import com.azure.resourcemanager.newrelicobservability.models.SubscriptionList; + +public final class MonitoredSubscriptionPropertiesImpl implements MonitoredSubscriptionProperties, + MonitoredSubscriptionProperties.Definition, MonitoredSubscriptionProperties.Update { + private MonitoredSubscriptionPropertiesInner innerObject; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubscriptionList properties() { + return this.innerModel().properties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MonitoredSubscriptionPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String monitorName; + + private ConfigurationName configurationName; + + public MonitoredSubscriptionPropertiesImpl withExistingMonitor(String resourceGroupName, String monitorName) { + this.resourceGroupName = resourceGroupName; + this.monitorName = monitorName; + return this; + } + + public MonitoredSubscriptionProperties create() { + this.innerObject = serviceManager.serviceClient().getMonitoredSubscriptions().createorUpdate(resourceGroupName, + monitorName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public MonitoredSubscriptionProperties create(Context context) { + this.innerObject = serviceManager.serviceClient().getMonitoredSubscriptions().createorUpdate(resourceGroupName, + monitorName, configurationName, this.innerModel(), context); + return this; + } + + MonitoredSubscriptionPropertiesImpl(ConfigurationName name, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerObject = new MonitoredSubscriptionPropertiesInner(); + this.serviceManager = serviceManager; + this.configurationName = name; + } + + public MonitoredSubscriptionPropertiesImpl update() { + return this; + } + + public MonitoredSubscriptionProperties apply() { + this.innerObject = serviceManager.serviceClient().getMonitoredSubscriptions().update(resourceGroupName, + monitorName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public MonitoredSubscriptionProperties apply(Context context) { + this.innerObject = serviceManager.serviceClient().getMonitoredSubscriptions().update(resourceGroupName, + monitorName, configurationName, this.innerModel(), context); + return this; + } + + MonitoredSubscriptionPropertiesImpl(MonitoredSubscriptionPropertiesInner innerObject, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.monitorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "monitors"); + this.configurationName = ConfigurationName + .fromString(ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "monitoredSubscriptions")); + } + + public MonitoredSubscriptionProperties refresh() { + this.innerObject = serviceManager.serviceClient().getMonitoredSubscriptions() + .getWithResponse(resourceGroupName, monitorName, configurationName, Context.NONE).getValue(); + return this; + } + + public MonitoredSubscriptionProperties refresh(Context context) { + this.innerObject = serviceManager.serviceClient().getMonitoredSubscriptions() + .getWithResponse(resourceGroupName, monitorName, configurationName, context).getValue(); + return this; + } + + public MonitoredSubscriptionPropertiesImpl withProperties(SubscriptionList properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..ff12c8a207b3a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsClientImpl.java @@ -0,0 +1,1299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.newrelicobservability.fluent.MonitoredSubscriptionsClient; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionPropertiesList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MonitoredSubscriptionsClient. + */ +public final class MonitoredSubscriptionsClientImpl implements MonitoredSubscriptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MonitoredSubscriptionsService service; + + /** + * The service client containing this operation class. + */ + private final NewRelicObservabilityImpl client; + + /** + * Initializes an instance of MonitoredSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MonitoredSubscriptionsClientImpl(NewRelicObservabilityImpl client) { + this.service = RestProxy.create(MonitoredSubscriptionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NewRelicObservabilityMonitoredSubscriptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NewRelicObservabilit") + public interface MonitoredSubscriptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("configurationName") ConfigurationName configurationName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createorUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("configurationName") ConfigurationName configurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MonitoredSubscriptionPropertiesInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("configurationName") ConfigurationName configurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MonitoredSubscriptionPropertiesInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("configurationName") ConfigurationName configurationName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, monitorName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName)); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName, context)); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String monitorName, ConfigurationName configurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, configurationName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String monitorName, ConfigurationName configurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, monitorName, + configurationName, this.client.getApiVersion(), accept, context); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + return getWithResponseAsync(resourceGroupName, monitorName, configurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String monitorName, + ConfigurationName configurationName, Context context) { + return getWithResponseAsync(resourceGroupName, monitorName, configurationName, context).block(); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + return getWithResponse(resourceGroupName, monitorName, configurationName, Context.NONE).getValue(); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createorUpdateWithResponseAsync(String resourceGroupName, + String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createorUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, configurationName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createorUpdateWithResponseAsync(String resourceGroupName, + String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createorUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + monitorName, configurationName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body) { + Mono>> mono + = createorUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, this.client.getContext()); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + Mono>> mono + = createorUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, this.client.getContext()); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createorUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, context); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return this.beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body).getSyncPoller(); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body, Context context) { + return this.beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body, context) + .getSyncPoller(); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createorUpdateAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body) { + return beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createorUpdateAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createorUpdateAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { + return beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return createorUpdateAsync(resourceGroupName, monitorName, configurationName, body).block(); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { + return createorUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).block(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, configurationName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + monitorName, configurationName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, this.client.getContext()); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + Mono>> mono + = updateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, this.client.getContext()); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, monitorName, configurationName, body, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, context); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return this.beginUpdateAsync(resourceGroupName, monitorName, configurationName, body).getSyncPoller(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body, Context context) { + return this.beginUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).getSyncPoller(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body) { + return beginUpdateAsync(resourceGroupName, monitorName, configurationName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return beginUpdateAsync(resourceGroupName, monitorName, configurationName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { + return beginUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return updateAsync(resourceGroupName, monitorName, configurationName, body).block(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { + return updateAsync(resourceGroupName, monitorName, configurationName, body, context).block(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, configurationName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + monitorName, configurationName, this.client.getApiVersion(), accept, context); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, monitorName, configurationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName, + ConfigurationName configurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, monitorName, configurationName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + return this.beginDeleteAsync(resourceGroupName, monitorName, configurationName).getSyncPoller(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + ConfigurationName configurationName, Context context) { + return this.beginDeleteAsync(resourceGroupName, monitorName, configurationName, context).getSyncPoller(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName) { + return beginDeleteAsync(resourceGroupName, monitorName, configurationName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, + Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, configurationName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName) { + deleteAsync(resourceGroupName, monitorName, configurationName).block(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName, + Context context) { + deleteAsync(resourceGroupName, monitorName, configurationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsImpl.java new file mode 100644 index 0000000000000..02c95f088a1dd --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.newrelicobservability.fluent.MonitoredSubscriptionsClient; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptions; + +public final class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { + private static final ClientLogger LOGGER = new ClientLogger(MonitoredSubscriptionsImpl.class); + + private final MonitoredSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + public MonitoredSubscriptionsImpl(MonitoredSubscriptionsClient innerClient, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String monitorName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, monitorName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MonitoredSubscriptionPropertiesImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String monitorName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, monitorName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MonitoredSubscriptionPropertiesImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String monitorName, + ConfigurationName configurationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, monitorName, configurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MonitoredSubscriptionPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MonitoredSubscriptionProperties get(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { + MonitoredSubscriptionPropertiesInner inner + = this.serviceClient().get(resourceGroupName, monitorName, configurationName); + if (inner != null) { + return new MonitoredSubscriptionPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName) { + this.serviceClient().delete(resourceGroupName, monitorName, configurationName); + } + + public void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName, + Context context) { + this.serviceClient().delete(resourceGroupName, monitorName, configurationName, context); + } + + public MonitoredSubscriptionProperties getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "monitoredSubscriptions"); + if (configurationNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'monitoredSubscriptions'.", id))); + } + ConfigurationName configurationName = ConfigurationName.fromString(configurationNameLocal); + return this.getWithResponse(resourceGroupName, monitorName, configurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "monitoredSubscriptions"); + if (configurationNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'monitoredSubscriptions'.", id))); + } + ConfigurationName configurationName = ConfigurationName.fromString(configurationNameLocal); + return this.getWithResponse(resourceGroupName, monitorName, configurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "monitoredSubscriptions"); + if (configurationNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'monitoredSubscriptions'.", id))); + } + ConfigurationName configurationName = ConfigurationName.fromString(configurationNameLocal); + this.delete(resourceGroupName, monitorName, configurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "monitoredSubscriptions"); + if (configurationNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'monitoredSubscriptions'.", id))); + } + ConfigurationName configurationName = ConfigurationName.fromString(configurationNameLocal); + this.delete(resourceGroupName, monitorName, configurationName, context); + } + + private MonitoredSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } + + public MonitoredSubscriptionPropertiesImpl define(ConfigurationName name) { + return new MonitoredSubscriptionPropertiesImpl(name, this.manager()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoringTagRulesPropertiesImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoringTagRulesPropertiesImpl.java index 316db538be5a3..49f3b352aadd7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoringTagRulesPropertiesImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoringTagRulesPropertiesImpl.java @@ -16,8 +16,7 @@ public final class MonitoringTagRulesPropertiesImpl implements MonitoringTagRule private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - MonitoringTagRulesPropertiesImpl( - MonitoringTagRulesPropertiesInner innerObject, + MonitoringTagRulesPropertiesImpl(MonitoringTagRulesPropertiesInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java index 5bd0c27357ca0..bc95b7a057d3e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java @@ -35,6 +35,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.newrelicobservability.fluent.MonitorsClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner; @@ -44,6 +45,7 @@ import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; import com.azure.resourcemanager.newrelicobservability.models.AppServicesListResponse; import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; +import com.azure.resourcemanager.newrelicobservability.models.LinkedResourceListResponse; import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; import com.azure.resourcemanager.newrelicobservability.models.MonitoredResourceListResponse; @@ -56,17 +58,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MonitorsClient. */ +/** + * An instance of this class provides access to all the operations defined in MonitorsClient. + */ public final class MonitorsClientImpl implements MonitorsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final MonitorsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NewRelicObservabilityImpl client; /** * Initializes an instance of MonitorsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MonitorsClientImpl(NewRelicObservabilityImpl client) { @@ -81,348 +89,259 @@ public final class MonitorsClientImpl implements MonitorsClient { @Host("{$host}") @ServiceInterface(name = "NewRelicObservabilit") public interface MonitorsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/monitors") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") - @ExpectedResponses({200, 201}) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @BodyParam("application/json") NewRelicMonitorResourceInner resource, - @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") NewRelicMonitorResourceInner resource, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @BodyParam("application/json") NewRelicMonitorResourceUpdate properties, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("userEmail") String userEmail, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getMetricRules") - @ExpectedResponses({200}) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("userEmail") String userEmail, + @PathParam("monitorName") String monitorName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getMetricRules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMetricRules( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @BodyParam("application/json") MetricsRequest request, - @HeaderParam("Accept") String accept, + Mono> getMetricRules(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") MetricsRequest request, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getMetricStatus") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getMetricStatus") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMetricStatus( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @BodyParam("application/json") MetricsStatusRequest request, - @HeaderParam("Accept") String accept, + Mono> getMetricStatus(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") MetricsStatusRequest request, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listAppServices") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listAppServices") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAppServices( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @BodyParam("application/json") AppServicesGetRequest request, - @HeaderParam("Accept") String accept, + Mono> listAppServices(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") AppServicesGetRequest request, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/switchBilling") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/switchBilling") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono switchBilling( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @BodyParam("application/json") SwitchBillingRequest request, - @HeaderParam("Accept") String accept, + Mono switchBilling(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") SwitchBillingRequest request, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listHosts") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listHosts") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listHosts( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @BodyParam("application/json") HostsGetRequest request, - @HeaderParam("Accept") String accept, + Mono> listHosts(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") HostsGetRequest request, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredResources") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredResources") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMonitoredResources( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> listMonitoredResources(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listLinkedResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLinkedResources(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/vmHostPayloads") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/vmHostPayloads") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> vmHostPayload( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); + Mono> vmHostPayload(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAppServicesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listHostsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listMonitoredResourcesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLinkedResourcesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -431,17 +350,17 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -450,13 +369,13 @@ public PagedIterable list() { /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -465,28 +384,24 @@ public PagedIterable list(Context context) { /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -494,53 +409,34 @@ private Mono> listByResourceGroupSin } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -549,27 +445,15 @@ private Mono> listByResourceGroupSin final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -578,14 +462,13 @@ private Mono> listByResourceGroupSin */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -594,22 +477,21 @@ private PagedFlux listByResourceGroupAsync(String * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -618,14 +500,14 @@ public PagedIterable listByResourceGroup(String re /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -634,7 +516,7 @@ public PagedIterable listByResourceGroup(String re /** * Get a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -643,19 +525,15 @@ public PagedIterable listByResourceGroup(String re * @return a NewRelicMonitorResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String monitorName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -666,23 +544,14 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -692,19 +561,15 @@ private Mono> getByResourceGroupWithRespo * @return a NewRelicMonitorResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String monitorName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -715,20 +580,13 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); } /** * Get a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -744,7 +602,7 @@ private Mono getByResourceGroupAsync(String resour /** * Get a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -754,14 +612,14 @@ private Mono getByResourceGroupAsync(String resour * @return a NewRelicMonitorResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String monitorName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, + String monitorName, Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, monitorName, context).block(); } /** * Get a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -776,7 +634,7 @@ public NewRelicMonitorResourceInner getByResourceGroup(String resourceGroupName, /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -786,19 +644,15 @@ public NewRelicMonitorResourceInner getByResourceGroup(String resourceGroupName, * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String monitorName, NewRelicMonitorResourceInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -814,24 +668,14 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - resource, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -842,19 +686,15 @@ private Mono>> createOrUpdateWithResponseAsync( * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String monitorName, NewRelicMonitorResourceInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -870,21 +710,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - resource, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, resource, accept, context); } /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -894,23 +726,18 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, NewRelicMonitorResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NewRelicMonitorResourceInner.class, - NewRelicMonitorResourceInner.class, - this.client.getContext()); + private PollerFlux, NewRelicMonitorResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, + this.client.getContext()); } /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -924,21 +751,16 @@ private PollerFlux, NewRelicMonitorReso private PollerFlux, NewRelicMonitorResourceInner> beginCreateOrUpdateAsync( String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NewRelicMonitorResourceInner.class, - NewRelicMonitorResourceInner.class, - context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, + context); } /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -948,14 +770,14 @@ private PollerFlux, NewRelicMonitorReso * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, NewRelicMonitorResourceInner> beginCreateOrUpdate( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { + public SyncPoller, NewRelicMonitorResourceInner> + beginCreateOrUpdate(String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { return this.beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource).getSyncPoller(); } /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -973,7 +795,7 @@ public SyncPoller, NewRelicMonitorResou /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -983,16 +805,15 @@ public SyncPoller, NewRelicMonitorResou * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String monitorName, + NewRelicMonitorResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -1003,16 +824,15 @@ private Mono createOrUpdateAsync( * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String monitorName, + NewRelicMonitorResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -1022,14 +842,14 @@ private Mono createOrUpdateAsync( * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NewRelicMonitorResourceInner createOrUpdate( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { + public NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, String monitorName, + NewRelicMonitorResourceInner resource) { return createOrUpdateAsync(resourceGroupName, monitorName, resource).block(); } /** * Create a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. @@ -1040,14 +860,14 @@ public NewRelicMonitorResourceInner createOrUpdate( * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NewRelicMonitorResourceInner createOrUpdate( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) { + public NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, String monitorName, + NewRelicMonitorResourceInner resource, Context context) { return createOrUpdateAsync(resourceGroupName, monitorName, resource, context).block(); } /** * Update a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be updated. @@ -1057,19 +877,15 @@ public NewRelicMonitorResourceInner createOrUpdate( * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String monitorName, NewRelicMonitorResourceUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1085,24 +901,14 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - properties, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be updated. @@ -1113,19 +919,15 @@ private Mono> updateWithResponseAsync( * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String monitorName, NewRelicMonitorResourceUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1141,21 +943,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - properties, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, properties, accept, context); } /** * Update a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be updated. @@ -1165,15 +959,15 @@ private Mono> updateWithResponseAsync( * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties) { + private Mono updateAsync(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties) { return updateWithResponseAsync(resourceGroupName, monitorName, properties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Update a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be updated. @@ -1184,14 +978,14 @@ private Mono updateAsync( * @return a Monitor Resource by NewRelic along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties, Context context) { + public Response updateWithResponse(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties, Context context) { return updateWithResponseAsync(resourceGroupName, monitorName, properties, context).block(); } /** * Update a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be updated. @@ -1201,14 +995,14 @@ public Response updateWithResponse( * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NewRelicMonitorResourceInner update( - String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties) { + public NewRelicMonitorResourceInner update(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties) { return updateWithResponse(resourceGroupName, monitorName, properties, Context.NONE).getValue(); } /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1218,19 +1012,15 @@ public NewRelicMonitorResourceInner update( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String userEmail, String monitorName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String userEmail, + String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1244,24 +1034,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - userEmail, - monitorName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, userEmail, monitorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1272,19 +1052,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String userEmail, String monitorName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String userEmail, + String monitorName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1298,21 +1074,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - userEmail, - monitorName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, userEmail, monitorName, accept, context); } /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1322,18 +1090,16 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String userEmail, String monitorName) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String userEmail, + String monitorName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, userEmail, monitorName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1344,19 +1110,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String userEmail, String monitorName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String userEmail, + String monitorName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, userEmail, monitorName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, userEmail, monitorName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1366,14 +1131,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String userEmail, String monitorName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String userEmail, + String monitorName) { return this.beginDeleteAsync(resourceGroupName, userEmail, monitorName).getSyncPoller(); } /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1384,14 +1149,14 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String userEmail, String monitorName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String userEmail, + String monitorName, Context context) { return this.beginDeleteAsync(resourceGroupName, userEmail, monitorName, context).getSyncPoller(); } /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1402,14 +1167,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String userEmail, String monitorName) { - return beginDeleteAsync(resourceGroupName, userEmail, monitorName) - .last() + return beginDeleteAsync(resourceGroupName, userEmail, monitorName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1421,14 +1185,13 @@ private Mono deleteAsync(String resourceGroupName, String userEmail, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String userEmail, String monitorName, Context context) { - return beginDeleteAsync(resourceGroupName, userEmail, monitorName, context) - .last() + return beginDeleteAsync(resourceGroupName, userEmail, monitorName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1443,7 +1206,7 @@ public void delete(String resourceGroupName, String userEmail, String monitorNam /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -1459,7 +1222,7 @@ public void delete(String resourceGroupName, String userEmail, String monitorNam /** * Get metric rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1469,19 +1232,15 @@ public void delete(String resourceGroupName, String userEmail, String monitorNam * @return metric rules along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMetricRulesWithResponseAsync( - String resourceGroupName, String monitorName, MetricsRequest request) { + private Mono> getMetricRulesWithResponseAsync(String resourceGroupName, + String monitorName, MetricsRequest request) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1497,24 +1256,14 @@ private Mono> getMetricRulesWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getMetricRules( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context)) + .withContext(context -> service.getMetricRules(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get metric rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1525,19 +1274,15 @@ private Mono> getMetricRulesWithResponseAsync( * @return metric rules along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMetricRulesWithResponseAsync( - String resourceGroupName, String monitorName, MetricsRequest request, Context context) { + private Mono> getMetricRulesWithResponseAsync(String resourceGroupName, + String monitorName, MetricsRequest request, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1553,21 +1298,13 @@ private Mono> getMetricRulesWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getMetricRules( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context); + return service.getMetricRules(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); } /** * Get metric rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1577,15 +1314,15 @@ private Mono> getMetricRulesWithResponseAsync( * @return metric rules on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getMetricRulesAsync( - String resourceGroupName, String monitorName, MetricsRequest request) { + private Mono getMetricRulesAsync(String resourceGroupName, String monitorName, + MetricsRequest request) { return getMetricRulesWithResponseAsync(resourceGroupName, monitorName, request) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get metric rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1596,14 +1333,14 @@ private Mono getMetricRulesAsync( * @return metric rules along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMetricRulesWithResponse( - String resourceGroupName, String monitorName, MetricsRequest request, Context context) { + public Response getMetricRulesWithResponse(String resourceGroupName, String monitorName, + MetricsRequest request, Context context) { return getMetricRulesWithResponseAsync(resourceGroupName, monitorName, request, context).block(); } /** * Get metric rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1619,7 +1356,7 @@ public MetricRulesInner getMetricRules(String resourceGroupName, String monitorN /** * Get metric status. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1629,19 +1366,15 @@ public MetricRulesInner getMetricRules(String resourceGroupName, String monitorN * @return metric status along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMetricStatusWithResponseAsync( - String resourceGroupName, String monitorName, MetricsStatusRequest request) { + private Mono> getMetricStatusWithResponseAsync(String resourceGroupName, + String monitorName, MetricsStatusRequest request) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1657,24 +1390,14 @@ private Mono> getMetricStatusWithResponseAs } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getMetricStatus( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context)) + .withContext(context -> service.getMetricStatus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get metric status. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1685,19 +1408,15 @@ private Mono> getMetricStatusWithResponseAs * @return metric status along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMetricStatusWithResponseAsync( - String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context) { + private Mono> getMetricStatusWithResponseAsync(String resourceGroupName, + String monitorName, MetricsStatusRequest request, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1713,21 +1432,13 @@ private Mono> getMetricStatusWithResponseAs } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getMetricStatus( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context); + return service.getMetricStatus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); } /** * Get metric status. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1737,15 +1448,15 @@ private Mono> getMetricStatusWithResponseAs * @return metric status on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getMetricStatusAsync( - String resourceGroupName, String monitorName, MetricsStatusRequest request) { + private Mono getMetricStatusAsync(String resourceGroupName, String monitorName, + MetricsStatusRequest request) { return getMetricStatusWithResponseAsync(resourceGroupName, monitorName, request) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get metric status. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1756,14 +1467,14 @@ private Mono getMetricStatusAsync( * @return metric status along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMetricStatusWithResponse( - String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context) { + public Response getMetricStatusWithResponse(String resourceGroupName, + String monitorName, MetricsStatusRequest request, Context context) { return getMetricStatusWithResponseAsync(resourceGroupName, monitorName, request, context).block(); } /** * Get metric status. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -1773,14 +1484,14 @@ public Response getMetricStatusWithResponse( * @return metric status. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MetricsStatusResponseInner getMetricStatus( - String resourceGroupName, String monitorName, MetricsStatusRequest request) { + public MetricsStatusResponseInner getMetricStatus(String resourceGroupName, String monitorName, + MetricsStatusRequest request) { return getMetricStatusWithResponse(resourceGroupName, monitorName, request, Context.NONE).getValue(); } /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -1788,22 +1499,18 @@ public MetricsStatusResponseInner getMetricStatus( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicesSinglePageAsync( - String resourceGroupName, String monitorName, AppServicesGetRequest request) { + private Mono> listAppServicesSinglePageAsync(String resourceGroupName, + String monitorName, AppServicesGetRequest request) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1819,33 +1526,16 @@ private Mono> listAppServicesSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listAppServices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listAppServices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -1854,22 +1544,18 @@ private Mono> listAppServicesSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicesSinglePageAsync( - String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context) { + private Mono> listAppServicesSinglePageAsync(String resourceGroupName, + String monitorName, AppServicesGetRequest request, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1886,29 +1572,15 @@ private Mono> listAppServicesSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAppServices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listAppServices(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, request, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -1918,16 +1590,15 @@ private Mono> listAppServicesSinglePageAsync( * @return response of a list app services Operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAppServicesAsync( - String resourceGroupName, String monitorName, AppServicesGetRequest request) { - return new PagedFlux<>( - () -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, request), + private PagedFlux listAppServicesAsync(String resourceGroupName, String monitorName, + AppServicesGetRequest request) { + return new PagedFlux<>(() -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, request), nextLink -> listAppServicesNextSinglePageAsync(nextLink)); } /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -1938,16 +1609,15 @@ private PagedFlux listAppServicesAsync( * @return response of a list app services Operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAppServicesAsync( - String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context) { - return new PagedFlux<>( - () -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, request, context), + private PagedFlux listAppServicesAsync(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context) { + return new PagedFlux<>(() -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, request, context), nextLink -> listAppServicesNextSinglePageAsync(nextLink, context)); } /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -1957,14 +1627,14 @@ private PagedFlux listAppServicesAsync( * @return response of a list app services Operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppServices( - String resourceGroupName, String monitorName, AppServicesGetRequest request) { + public PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request) { return new PagedIterable<>(listAppServicesAsync(resourceGroupName, monitorName, request)); } /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -1975,14 +1645,14 @@ public PagedIterable listAppServices( * @return response of a list app services Operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppServices( - String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context) { + public PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context) { return new PagedIterable<>(listAppServicesAsync(resourceGroupName, monitorName, request, context)); } /** * Switches the billing for NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the switch billing request. @@ -1992,19 +1662,15 @@ public PagedIterable listAppServices( * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono switchBillingWithResponseAsync( - String resourceGroupName, String monitorName, SwitchBillingRequest request) { + private Mono switchBillingWithResponseAsync(String resourceGroupName, + String monitorName, SwitchBillingRequest request) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2020,24 +1686,14 @@ private Mono switchBillingWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .switchBilling( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context)) + .withContext(context -> service.switchBilling(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Switches the billing for NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the switch billing request. @@ -2048,19 +1704,15 @@ private Mono switchBillingWithResponseAsync( * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono switchBillingWithResponseAsync( - String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) { + private Mono switchBillingWithResponseAsync(String resourceGroupName, + String monitorName, SwitchBillingRequest request, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2076,21 +1728,13 @@ private Mono switchBillingWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .switchBilling( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context); + return service.switchBilling(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); } /** * Switches the billing for NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the switch billing request. @@ -2100,15 +1744,15 @@ private Mono switchBillingWithResponseAsync( * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono switchBillingAsync( - String resourceGroupName, String monitorName, SwitchBillingRequest request) { + private Mono switchBillingAsync(String resourceGroupName, String monitorName, + SwitchBillingRequest request) { return switchBillingWithResponseAsync(resourceGroupName, monitorName, request) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Switches the billing for NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the switch billing request. @@ -2119,14 +1763,14 @@ private Mono switchBillingAsync( * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MonitorsSwitchBillingResponse switchBillingWithResponse( - String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) { + public MonitorsSwitchBillingResponse switchBillingWithResponse(String resourceGroupName, String monitorName, + SwitchBillingRequest request, Context context) { return switchBillingWithResponseAsync(resourceGroupName, monitorName, request, context).block(); } /** * Switches the billing for NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the switch billing request. @@ -2136,37 +1780,33 @@ public MonitorsSwitchBillingResponse switchBillingWithResponse( * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NewRelicMonitorResourceInner switchBilling( - String resourceGroupName, String monitorName, SwitchBillingRequest request) { + public NewRelicMonitorResourceInner switchBilling(String resourceGroupName, String monitorName, + SwitchBillingRequest request) { return switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE).getValue(); } /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostsSinglePageAsync( - String resourceGroupName, String monitorName, HostsGetRequest request) { + private Mono> listHostsSinglePageAsync(String resourceGroupName, String monitorName, + HostsGetRequest request) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2182,33 +1822,16 @@ private Mono> listHostsSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listHosts( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listHosts(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. @@ -2216,23 +1839,19 @@ private Mono> listHostsSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostsSinglePageAsync( - String resourceGroupName, String monitorName, HostsGetRequest request, Context context) { + private Mono> listHostsSinglePageAsync(String resourceGroupName, String monitorName, + HostsGetRequest request, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2249,29 +1868,15 @@ private Mono> listHostsSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listHosts( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - request, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listHosts(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, request, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. @@ -2281,16 +1886,15 @@ private Mono> listHostsSinglePageAsync( * @return response of a list VM Host Operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHostsAsync( - String resourceGroupName, String monitorName, HostsGetRequest request) { - return new PagedFlux<>( - () -> listHostsSinglePageAsync(resourceGroupName, monitorName, request), + private PagedFlux listHostsAsync(String resourceGroupName, String monitorName, + HostsGetRequest request) { + return new PagedFlux<>(() -> listHostsSinglePageAsync(resourceGroupName, monitorName, request), nextLink -> listHostsNextSinglePageAsync(nextLink)); } /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. @@ -2301,16 +1905,15 @@ private PagedFlux listHostsAsync( * @return response of a list VM Host Operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHostsAsync( - String resourceGroupName, String monitorName, HostsGetRequest request, Context context) { - return new PagedFlux<>( - () -> listHostsSinglePageAsync(resourceGroupName, monitorName, request, context), + private PagedFlux listHostsAsync(String resourceGroupName, String monitorName, HostsGetRequest request, + Context context) { + return new PagedFlux<>(() -> listHostsSinglePageAsync(resourceGroupName, monitorName, request, context), nextLink -> listHostsNextSinglePageAsync(nextLink, context)); } /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. @@ -2326,7 +1929,7 @@ public PagedIterable listHosts(String resourceGroupName, String mon /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. @@ -2337,36 +1940,32 @@ public PagedIterable listHosts(String resourceGroupName, String mon * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHosts( - String resourceGroupName, String monitorName, HostsGetRequest request, Context context) { + public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request, + Context context) { return new PagedIterable<>(listHostsAsync(resourceGroupName, monitorName, request, context)); } /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMonitoredResourcesSinglePageAsync( - String resourceGroupName, String monitorName) { + private Mono> listMonitoredResourcesSinglePageAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2378,31 +1977,16 @@ private Mono> listMonitoredResourcesSingle final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listMonitoredResources( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listMonitoredResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -2410,22 +1994,18 @@ private Mono> listMonitoredResourcesSingle * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMonitoredResourcesSinglePageAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono> listMonitoredResourcesSinglePageAsync(String resourceGroupName, + String monitorName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2437,74 +2017,59 @@ private Mono> listMonitoredResourcesSingle final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMonitoredResources( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listMonitoredResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedFlux}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMonitoredResourcesAsync( - String resourceGroupName, String monitorName) { - return new PagedFlux<>( - () -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName), + private PagedFlux listMonitoredResourcesAsync(String resourceGroupName, + String monitorName) { + return new PagedFlux<>(() -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName), nextLink -> listMonitoredResourcesNextSinglePageAsync(nextLink)); } /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedFlux}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMonitoredResourcesAsync( - String resourceGroupName, String monitorName, Context context) { - return new PagedFlux<>( - () -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName, context), + private PagedFlux listMonitoredResourcesAsync(String resourceGroupName, String monitorName, + Context context) { + return new PagedFlux<>(() -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName, context), nextLink -> listMonitoredResourcesNextSinglePageAsync(nextLink, context)); } /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedIterable}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName) { @@ -2513,47 +2078,185 @@ public PagedIterable listMonitoredResources(String resou /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedIterable}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMonitoredResources( - String resourceGroupName, String monitorName, Context context) { + public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName, + Context context) { return new PagedIterable<>(listMonitoredResourcesAsync(resourceGroupName, monitorName, context)); } /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of payload to be passed while installing VM agent along with {@link Response} on successful - * completion of {@link Mono}. + * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> vmHostPayloadWithResponseAsync( - String resourceGroupName, String monitorName) { + private Mono> listLinkedResourcesSinglePageAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listLinkedResources(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLinkedResourcesSinglePageAsync(String resourceGroupName, + String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listLinkedResources(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + monitorName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLinkedResourcesAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>(() -> listLinkedResourcesSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listLinkedResourcesNextSinglePageAsync(nextLink)); + } + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLinkedResourcesAsync(String resourceGroupName, String monitorName, + Context context) { + return new PagedFlux<>(() -> listLinkedResourcesSinglePageAsync(resourceGroupName, monitorName, context), + nextLink -> listLinkedResourcesNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLinkedResources(String resourceGroupName, String monitorName) { + return new PagedIterable<>(listLinkedResourcesAsync(resourceGroupName, monitorName)); + } + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLinkedResources(String resourceGroupName, String monitorName, + Context context) { + return new PagedIterable<>(listLinkedResourcesAsync(resourceGroupName, monitorName, context)); + } + + /** + * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> vmHostPayloadWithResponseAsync(String resourceGroupName, + String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2564,23 +2267,14 @@ private Mono> vmHostPayloadWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .vmHostPayload( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) + .withContext(context -> service.vmHostPayload(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -2588,22 +2282,18 @@ private Mono> vmHostPayloadWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of payload to be passed while installing VM agent along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> vmHostPayloadWithResponseAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono> vmHostPayloadWithResponseAsync(String resourceGroupName, + String monitorName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2614,20 +2304,13 @@ private Mono> vmHostPayloadWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .vmHostPayload( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context); + return service.vmHostPayload(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); } /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2643,7 +2326,7 @@ private Mono vmHostPayloadAsync(String resourceGroupNam /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -2653,14 +2336,14 @@ private Mono vmHostPayloadAsync(String resourceGroupNam * @return response of payload to be passed while installing VM agent along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response vmHostPayloadWithResponse( - String resourceGroupName, String monitorName, Context context) { + public Response vmHostPayloadWithResponse(String resourceGroupName, String monitorName, + Context context) { return vmHostPayloadWithResponseAsync(resourceGroupName, monitorName, context).block(); } /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2675,14 +2358,15 @@ public VMExtensionPayloadInner vmHostPayload(String resourceGroupName, String mo /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -2690,76 +2374,59 @@ private Mono> listBySubscriptionNext return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -2767,76 +2434,59 @@ private Mono> listByResourceGroupNex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAppServicesNextSinglePageAsync(String nextLink) { @@ -2844,75 +2494,58 @@ private Mono> listAppServicesNextSinglePageAs return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listAppServicesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicesNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listAppServicesNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listAppServicesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listAppServicesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listHostsNextSinglePageAsync(String nextLink) { @@ -2920,37 +2553,29 @@ private Mono> listHostsNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listHostsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listHostsNextSinglePageAsync(String nextLink, Context context) { @@ -2958,36 +2583,27 @@ private Mono> listHostsNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listHostsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listHostsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listMonitoredResourcesNextSinglePageAsync(String nextLink) { @@ -2995,63 +2611,103 @@ private Mono> listMonitoredResourcesNextSi return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMonitoredResourcesNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listMonitoredResourcesNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLinkedResourcesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listLinkedResourcesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLinkedResourcesNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listLinkedResourcesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java index 6d8880b1276ba..6b5c40a49849f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java @@ -11,6 +11,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.MonitorsClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner; @@ -20,6 +21,7 @@ import com.azure.resourcemanager.newrelicobservability.models.AppServiceInfo; import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; +import com.azure.resourcemanager.newrelicobservability.models.LinkedResource; import com.azure.resourcemanager.newrelicobservability.models.MetricRules; import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; @@ -39,8 +41,7 @@ public final class MonitorsImpl implements Monitors { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - public MonitorsImpl( - MonitorsClient innerClient, + public MonitorsImpl(MonitorsClient innerClient, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -48,34 +49,31 @@ public MonitorsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager())); } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String monitorName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, monitorName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String monitorName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, monitorName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new NewRelicMonitorResourceImpl(inner.getValue(), this.manager())); } else { return null; @@ -99,15 +97,12 @@ public void delete(String resourceGroupName, String userEmail, String monitorNam this.serviceClient().delete(resourceGroupName, userEmail, monitorName, context); } - public Response getMetricRulesWithResponse( - String resourceGroupName, String monitorName, MetricsRequest request, Context context) { - Response inner = - this.serviceClient().getMetricRulesWithResponse(resourceGroupName, monitorName, request, context); + public Response getMetricRulesWithResponse(String resourceGroupName, String monitorName, + MetricsRequest request, Context context) { + Response inner + = this.serviceClient().getMetricRulesWithResponse(resourceGroupName, monitorName, request, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new MetricRulesImpl(inner.getValue(), this.manager())); } else { return null; @@ -123,25 +118,22 @@ public MetricRules getMetricRules(String resourceGroupName, String monitorName, } } - public Response getMetricStatusWithResponse( - String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context) { - Response inner = - this.serviceClient().getMetricStatusWithResponse(resourceGroupName, monitorName, request, context); + public Response getMetricStatusWithResponse(String resourceGroupName, String monitorName, + MetricsStatusRequest request, Context context) { + Response inner + = this.serviceClient().getMetricStatusWithResponse(resourceGroupName, monitorName, request, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new MetricsStatusResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public MetricsStatusResponse getMetricStatus( - String resourceGroupName, String monitorName, MetricsStatusRequest request) { - MetricsStatusResponseInner inner = - this.serviceClient().getMetricStatus(resourceGroupName, monitorName, request); + public MetricsStatusResponse getMetricStatus(String resourceGroupName, String monitorName, + MetricsStatusRequest request) { + MetricsStatusResponseInner inner + = this.serviceClient().getMetricStatus(resourceGroupName, monitorName, request); if (inner != null) { return new MetricsStatusResponseImpl(inner, this.manager()); } else { @@ -149,39 +141,36 @@ public MetricsStatusResponse getMetricStatus( } } - public PagedIterable listAppServices( - String resourceGroupName, String monitorName, AppServicesGetRequest request) { - PagedIterable inner = - this.serviceClient().listAppServices(resourceGroupName, monitorName, request); - return Utils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); + public PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request) { + PagedIterable inner + = this.serviceClient().listAppServices(resourceGroupName, monitorName, request); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); } - public PagedIterable listAppServices( - String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context) { - PagedIterable inner = - this.serviceClient().listAppServices(resourceGroupName, monitorName, request, context); - return Utils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); + public PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context) { + PagedIterable inner + = this.serviceClient().listAppServices(resourceGroupName, monitorName, request, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); } - public Response switchBillingWithResponse( - String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) { - MonitorsSwitchBillingResponse inner = - this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context); + public Response switchBillingWithResponse(String resourceGroupName, String monitorName, + SwitchBillingRequest request, Context context) { + MonitorsSwitchBillingResponse inner + = this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new NewRelicMonitorResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public NewRelicMonitorResource switchBilling( - String resourceGroupName, String monitorName, SwitchBillingRequest request) { - NewRelicMonitorResourceInner inner = - this.serviceClient().switchBilling(resourceGroupName, monitorName, request); + public NewRelicMonitorResource switchBilling(String resourceGroupName, String monitorName, + SwitchBillingRequest request) { + NewRelicMonitorResourceInner inner + = this.serviceClient().switchBilling(resourceGroupName, monitorName, request); if (inner != null) { return new NewRelicMonitorResourceImpl(inner, this.manager()); } else { @@ -191,38 +180,48 @@ public NewRelicMonitorResource switchBilling( public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request) { PagedIterable inner = this.serviceClient().listHosts(resourceGroupName, monitorName, request); - return Utils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager())); } - public PagedIterable listHosts( - String resourceGroupName, String monitorName, HostsGetRequest request, Context context) { - PagedIterable inner = - this.serviceClient().listHosts(resourceGroupName, monitorName, request, context); - return Utils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager())); + public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request, + Context context) { + PagedIterable inner + = this.serviceClient().listHosts(resourceGroupName, monitorName, request, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager())); } public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName) { - PagedIterable inner = - this.serviceClient().listMonitoredResources(resourceGroupName, monitorName); - return Utils.mapPage(inner, inner1 -> new MonitoredResourceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listMonitoredResources(resourceGroupName, monitorName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MonitoredResourceImpl(inner1, this.manager())); } - public PagedIterable listMonitoredResources( - String resourceGroupName, String monitorName, Context context) { - PagedIterable inner = - this.serviceClient().listMonitoredResources(resourceGroupName, monitorName, context); - return Utils.mapPage(inner, inner1 -> new MonitoredResourceImpl(inner1, this.manager())); + public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName, + Context context) { + PagedIterable inner + = this.serviceClient().listMonitoredResources(resourceGroupName, monitorName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MonitoredResourceImpl(inner1, this.manager())); } - public Response vmHostPayloadWithResponse( - String resourceGroupName, String monitorName, Context context) { - Response inner = - this.serviceClient().vmHostPayloadWithResponse(resourceGroupName, monitorName, context); + public PagedIterable listLinkedResources(String resourceGroupName, String monitorName) { + PagedIterable inner + = this.serviceClient().listLinkedResources(resourceGroupName, monitorName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LinkedResourceImpl(inner1, this.manager())); + } + + public PagedIterable listLinkedResources(String resourceGroupName, String monitorName, + Context context) { + PagedIterable inner + = this.serviceClient().listLinkedResources(resourceGroupName, monitorName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LinkedResourceImpl(inner1, this.manager())); + } + + public Response vmHostPayloadWithResponse(String resourceGroupName, String monitorName, + Context context) { + Response inner + = this.serviceClient().vmHostPayloadWithResponse(resourceGroupName, monitorName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new VMExtensionPayloadImpl(inner.getValue(), this.manager())); } else { return null; @@ -239,39 +238,29 @@ public VMExtensionPayload vmHostPayload(String resourceGroupName, String monitor } public NewRelicMonitorResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, context); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java index fbf595fb3c19c..8ca7c2d051021 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; import com.azure.resourcemanager.newrelicobservability.models.LiftrResourceCategories; +import com.azure.resourcemanager.newrelicobservability.models.LinkedResource; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; import com.azure.resourcemanager.newrelicobservability.models.MarketplaceSubscriptionStatus; import com.azure.resourcemanager.newrelicobservability.models.MetricRules; @@ -119,6 +120,14 @@ public AccountCreationSource accountCreationSource() { return this.innerModel().accountCreationSource(); } + public String subscriptionState() { + return this.innerModel().subscriptionState(); + } + + public String saaSAzureSubscriptionStatus() { + return this.innerModel().saaSAzureSubscriptionStatus(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -151,25 +160,19 @@ public NewRelicMonitorResourceImpl withExistingResourceGroup(String resourceGrou } public NewRelicMonitorResource create() { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .createOrUpdate(resourceGroupName, monitorName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getMonitors().createOrUpdate(resourceGroupName, monitorName, + this.innerModel(), Context.NONE); return this; } public NewRelicMonitorResource create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .createOrUpdate(resourceGroupName, monitorName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getMonitors().createOrUpdate(resourceGroupName, monitorName, + this.innerModel(), context); return this; } - NewRelicMonitorResourceImpl( - String name, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + NewRelicMonitorResourceImpl(String name, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = new NewRelicMonitorResourceInner(); this.serviceManager = serviceManager; this.monitorName = name; @@ -181,51 +184,34 @@ public NewRelicMonitorResourceImpl update() { } public NewRelicMonitorResource apply() { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .updateWithResponse(resourceGroupName, monitorName, updateProperties, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getMonitors() + .updateWithResponse(resourceGroupName, monitorName, updateProperties, Context.NONE).getValue(); return this; } public NewRelicMonitorResource apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .updateWithResponse(resourceGroupName, monitorName, updateProperties, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getMonitors() + .updateWithResponse(resourceGroupName, monitorName, updateProperties, context).getValue(); return this; } - NewRelicMonitorResourceImpl( - NewRelicMonitorResourceInner innerObject, + NewRelicMonitorResourceImpl(NewRelicMonitorResourceInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.monitorName = Utils.getValueFromIdByName(innerObject.id(), "monitors"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.monitorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "monitors"); } public NewRelicMonitorResource refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getMonitors() + .getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); return this; } public NewRelicMonitorResource refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .getByResourceGroupWithResponse(resourceGroupName, monitorName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getMonitors() + .getByResourceGroupWithResponse(resourceGroupName, monitorName, context).getValue(); return this; } @@ -277,6 +263,14 @@ public PagedIterable listMonitoredResources(Context context) return serviceManager.monitors().listMonitoredResources(resourceGroupName, monitorName, context); } + public PagedIterable listLinkedResources() { + return serviceManager.monitors().listLinkedResources(resourceGroupName, monitorName); + } + + public PagedIterable listLinkedResources(Context context) { + return serviceManager.monitors().listLinkedResources(resourceGroupName, monitorName, context); + } + public Response vmHostPayloadWithResponse(Context context) { return serviceManager.monitors().vmHostPayloadWithResponse(resourceGroupName, monitorName, context); } @@ -315,8 +309,8 @@ public NewRelicMonitorResourceImpl withIdentity(ManagedServiceIdentity identity) } } - public NewRelicMonitorResourceImpl withNewRelicAccountProperties( - NewRelicAccountProperties newRelicAccountProperties) { + public NewRelicMonitorResourceImpl + withNewRelicAccountProperties(NewRelicAccountProperties newRelicAccountProperties) { if (isInCreateMode()) { this.innerModel().withNewRelicAccountProperties(newRelicAccountProperties); return this; @@ -366,6 +360,16 @@ public NewRelicMonitorResourceImpl withAccountCreationSource(AccountCreationSour } } + public NewRelicMonitorResourceImpl withSubscriptionState(String subscriptionState) { + this.innerModel().withSubscriptionState(subscriptionState); + return this; + } + + public NewRelicMonitorResourceImpl withSaaSAzureSubscriptionStatus(String saaSAzureSubscriptionStatus) { + this.innerModel().withSaaSAzureSubscriptionStatus(saaSAzureSubscriptionStatus); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityBuilder.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityBuilder.java index 67751d8138dc1..948fbec97902c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityBuilder.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityBuilder.java @@ -14,8 +14,10 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the NewRelicObservabilityImpl type. */ -@ServiceClientBuilder(serviceClients = {NewRelicObservabilityImpl.class}) +/** + * A builder for creating a new instance of the NewRelicObservabilityImpl type. + */ +@ServiceClientBuilder(serviceClients = { NewRelicObservabilityImpl.class }) public final class NewRelicObservabilityBuilder { /* * The ID of the target subscription. @@ -24,7 +26,7 @@ public final class NewRelicObservabilityBuilder { /** * Sets The ID of the target subscription. - * + * * @param subscriptionId the subscriptionId value. * @return the NewRelicObservabilityBuilder. */ @@ -40,7 +42,7 @@ public NewRelicObservabilityBuilder subscriptionId(String subscriptionId) { /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the NewRelicObservabilityBuilder. */ @@ -56,7 +58,7 @@ public NewRelicObservabilityBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the NewRelicObservabilityBuilder. */ @@ -72,7 +74,7 @@ public NewRelicObservabilityBuilder environment(AzureEnvironment environment) { /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the NewRelicObservabilityBuilder. */ @@ -88,7 +90,7 @@ public NewRelicObservabilityBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the NewRelicObservabilityBuilder. */ @@ -104,7 +106,7 @@ public NewRelicObservabilityBuilder defaultPollInterval(Duration defaultPollInte /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the NewRelicObservabilityBuilder. */ @@ -115,30 +117,20 @@ public NewRelicObservabilityBuilder serializerAdapter(SerializerAdapter serializ /** * Builds an instance of NewRelicObservabilityImpl with the provided parameters. - * + * * @return an instance of NewRelicObservabilityImpl. */ public NewRelicObservabilityImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - NewRelicObservabilityImpl client = - new NewRelicObservabilityImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + NewRelicObservabilityImpl client = new NewRelicObservabilityImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java index e771fe627b1ac..860f9503958ab 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java @@ -23,6 +23,9 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.newrelicobservability.fluent.AccountsClient; +import com.azure.resourcemanager.newrelicobservability.fluent.BillingInfoesClient; +import com.azure.resourcemanager.newrelicobservability.fluent.ConnectedPartnerResourcesClient; +import com.azure.resourcemanager.newrelicobservability.fluent.MonitoredSubscriptionsClient; import com.azure.resourcemanager.newrelicobservability.fluent.MonitorsClient; import com.azure.resourcemanager.newrelicobservability.fluent.NewRelicObservability; import com.azure.resourcemanager.newrelicobservability.fluent.OperationsClient; @@ -38,156 +41,224 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the NewRelicObservabilityImpl type. */ +/** + * Initializes a new instance of the NewRelicObservabilityImpl type. + */ @ServiceClient(builder = NewRelicObservabilityBuilder.class) public final class NewRelicObservabilityImpl implements NewRelicObservability { - /** The ID of the target subscription. */ + /** + * The ID of the target subscription. + */ private final String subscriptionId; /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { return this.operations; } - /** The AccountsClient object to access its operations. */ + /** + * The AccountsClient object to access its operations. + */ private final AccountsClient accounts; /** * Gets the AccountsClient object to access its operations. - * + * * @return the AccountsClient object. */ public AccountsClient getAccounts() { return this.accounts; } - /** The MonitorsClient object to access its operations. */ + /** + * The MonitorsClient object to access its operations. + */ private final MonitorsClient monitors; /** * Gets the MonitorsClient object to access its operations. - * + * * @return the MonitorsClient object. */ public MonitorsClient getMonitors() { return this.monitors; } - /** The OrganizationsClient object to access its operations. */ + /** + * The OrganizationsClient object to access its operations. + */ private final OrganizationsClient organizations; /** * Gets the OrganizationsClient object to access its operations. - * + * * @return the OrganizationsClient object. */ public OrganizationsClient getOrganizations() { return this.organizations; } - /** The PlansClient object to access its operations. */ + /** + * The PlansClient object to access its operations. + */ private final PlansClient plans; /** * Gets the PlansClient object to access its operations. - * + * * @return the PlansClient object. */ public PlansClient getPlans() { return this.plans; } - /** The TagRulesClient object to access its operations. */ + /** + * The BillingInfoesClient object to access its operations. + */ + private final BillingInfoesClient billingInfoes; + + /** + * Gets the BillingInfoesClient object to access its operations. + * + * @return the BillingInfoesClient object. + */ + public BillingInfoesClient getBillingInfoes() { + return this.billingInfoes; + } + + /** + * The ConnectedPartnerResourcesClient object to access its operations. + */ + private final ConnectedPartnerResourcesClient connectedPartnerResources; + + /** + * Gets the ConnectedPartnerResourcesClient object to access its operations. + * + * @return the ConnectedPartnerResourcesClient object. + */ + public ConnectedPartnerResourcesClient getConnectedPartnerResources() { + return this.connectedPartnerResources; + } + + /** + * The TagRulesClient object to access its operations. + */ private final TagRulesClient tagRules; /** * Gets the TagRulesClient object to access its operations. - * + * * @return the TagRulesClient object. */ public TagRulesClient getTagRules() { return this.tagRules; } + /** + * The MonitoredSubscriptionsClient object to access its operations. + */ + private final MonitoredSubscriptionsClient monitoredSubscriptions; + + /** + * Gets the MonitoredSubscriptionsClient object to access its operations. + * + * @return the MonitoredSubscriptionsClient object. + */ + public MonitoredSubscriptionsClient getMonitoredSubscriptions() { + return this.monitoredSubscriptions; + } + /** * Initializes an instance of NewRelicObservability client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. @@ -195,30 +266,28 @@ public TagRulesClient getTagRules() { * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - NewRelicObservabilityImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + NewRelicObservabilityImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-07-01"; + this.apiVersion = "2024-01-01"; this.operations = new OperationsClientImpl(this); this.accounts = new AccountsClientImpl(this); this.monitors = new MonitorsClientImpl(this); this.organizations = new OrganizationsClientImpl(this); this.plans = new PlansClientImpl(this); + this.billingInfoes = new BillingInfoesClientImpl(this); + this.connectedPartnerResources = new ConnectedPartnerResourcesClientImpl(this); this.tagRules = new TagRulesClientImpl(this); + this.monitoredSubscriptions = new MonitoredSubscriptionsClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -227,7 +296,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -237,7 +306,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -247,26 +316,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -279,19 +337,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, + SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationImpl.java index 6339a7b4a6b17..3dc462e32b66d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationImpl.java @@ -15,8 +15,7 @@ public final class OperationImpl implements Operation { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - OperationImpl( - OperationInner innerObject, + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsClientImpl.java index aee3a4abf759b..1494f38ad4276 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.newrelicobservability.models.OperationListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NewRelicObservabilityImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(NewRelicObservabilityImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,99 +62,74 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "NewRelicObservabilit") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/NewRelic.Observability/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List the operations for the provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List the operations for the provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -157,27 +138,27 @@ private PagedFlux listAsync() { /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List the operations for the provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -186,13 +167,13 @@ public PagedIterable list() { /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -201,14 +182,15 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -216,37 +198,28 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -254,23 +227,13 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsImpl.java index 222e5521841f9..b38c24bb37bd9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsImpl.java @@ -19,8 +19,7 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public OperationsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationResourceImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationResourceImpl.java index 13feaea00a58b..d419d080a09a7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationResourceImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationResourceImpl.java @@ -14,8 +14,7 @@ public final class OrganizationResourceImpl implements OrganizationResource { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - OrganizationResourceImpl( - OrganizationResourceInner innerObject, + OrganizationResourceImpl(OrganizationResourceInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsClientImpl.java index ce6b533efc2de..2ab8c0aea7e41 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsClientImpl.java @@ -30,80 +30,76 @@ import com.azure.resourcemanager.newrelicobservability.models.OrganizationsListResponse; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OrganizationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OrganizationsClient. + */ public final class OrganizationsClientImpl implements OrganizationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OrganizationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NewRelicObservabilityImpl client; /** * Initializes an instance of OrganizationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OrganizationsClientImpl(NewRelicObservabilityImpl client) { - this.service = - RestProxy.create(OrganizationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OrganizationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for NewRelicObservabilityOrganizations to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for NewRelicObservabilityOrganizations to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "NewRelicObservabilit") public interface OrganizationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/organizations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("userEmail") String userEmail, - @QueryParam("location") String location, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("userEmail") String userEmail, @QueryParam("location") String location, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all organizations Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String userEmail, String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (userEmail == null) { return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); @@ -113,32 +109,16 @@ private Mono> listSinglePageAsync(Strin } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - userEmail, - location, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), userEmail, location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. @@ -146,22 +126,18 @@ private Mono> listSinglePageAsync(Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all organizations Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String userEmail, String location, Context context) { + private Mono> listSinglePageAsync(String userEmail, String location, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (userEmail == null) { return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); @@ -172,28 +148,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - userEmail, - location, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), userEmail, + location, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -203,13 +166,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String userEmail, String location) { - return new PagedFlux<>( - () -> listSinglePageAsync(userEmail, location), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. @@ -220,14 +183,13 @@ private PagedFlux listAsync(String userEmail, String */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String userEmail, String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(userEmail, location, context), + return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -242,7 +204,7 @@ public PagedIterable list(String userEmail, String lo /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. @@ -258,14 +220,15 @@ public PagedIterable list(String userEmail, String lo /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all organizations Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -273,37 +236,28 @@ private Mono> listNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all organizations Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -311,23 +265,13 @@ private Mono> listNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsImpl.java index 29964833116f3..426898ff2c529 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsImpl.java @@ -19,8 +19,7 @@ public final class OrganizationsImpl implements Organizations { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - public OrganizationsImpl( - OrganizationsClient innerClient, + public OrganizationsImpl(OrganizationsClient innerClient, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public OrganizationsImpl( public PagedIterable list(String userEmail, String location) { PagedIterable inner = this.serviceClient().list(userEmail, location); - return Utils.mapPage(inner, inner1 -> new OrganizationResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationResourceImpl(inner1, this.manager())); } public PagedIterable list(String userEmail, String location, Context context) { PagedIterable inner = this.serviceClient().list(userEmail, location, context); - return Utils.mapPage(inner, inner1 -> new OrganizationResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationResourceImpl(inner1, this.manager())); } private OrganizationsClient serviceClient() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlanDataResourceImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlanDataResourceImpl.java index 8417a3ff9c564..8c37bf733a208 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlanDataResourceImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlanDataResourceImpl.java @@ -16,8 +16,7 @@ public final class PlanDataResourceImpl implements PlanDataResource { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - PlanDataResourceImpl( - PlanDataResourceInner innerObject, + PlanDataResourceImpl(PlanDataResourceInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansClientImpl.java index eb4549b896813..1f99e5b5c0675 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansClientImpl.java @@ -30,17 +30,23 @@ import com.azure.resourcemanager.newrelicobservability.models.PlanDataListResponse; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PlansClient. */ +/** + * An instance of this class provides access to all the operations defined in PlansClient. + */ public final class PlansClientImpl implements PlansClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PlansService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NewRelicObservabilityImpl client; /** * Initializes an instance of PlansClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PlansClientImpl(NewRelicObservabilityImpl client) { @@ -49,89 +55,62 @@ public final class PlansClientImpl implements PlansClient { } /** - * The interface defining all the services for NewRelicObservabilityPlans to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for NewRelicObservabilityPlans to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "NewRelicObservabilit") public interface PlansService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/plans") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("accountId") String accountId, - @QueryParam("organizationId") String organizationId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("accountId") String accountId, @QueryParam("organizationId") String organizationId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List plans data. - * + * * @param accountId Account Id. * @param organizationId Organization Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all plan data Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String accountId, String organizationId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accountId, - organizationId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accountId, organizationId, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List plans data. - * + * * @param accountId Account Id. * @param organizationId Organization Id. * @param context The context to associate with this operation. @@ -139,48 +118,31 @@ private Mono> listSinglePageAsync(String ac * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all plan data Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String accountId, String organizationId, Context context) { + private Mono> listSinglePageAsync(String accountId, String organizationId, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accountId, - organizationId, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accountId, + organizationId, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List plans data. - * + * * @param accountId Account Id. * @param organizationId Organization Id. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -190,13 +152,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String accountId, String organizationId) { - return new PagedFlux<>( - () -> listSinglePageAsync(accountId, organizationId), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(accountId, organizationId), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List plans data. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all plan data Operation as paginated response with {@link PagedFlux}. @@ -205,13 +167,13 @@ private PagedFlux listAsync(String accountId, String orga private PagedFlux listAsync() { final String accountId = null; final String organizationId = null; - return new PagedFlux<>( - () -> listSinglePageAsync(accountId, organizationId), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(accountId, organizationId), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List plans data. - * + * * @param accountId Account Id. * @param organizationId Organization Id. * @param context The context to associate with this operation. @@ -222,14 +184,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String accountId, String organizationId, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(accountId, organizationId, context), + return new PagedFlux<>(() -> listSinglePageAsync(accountId, organizationId, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List plans data. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all plan data Operation as paginated response with {@link PagedIterable}. @@ -243,7 +204,7 @@ public PagedIterable list() { /** * List plans data. - * + * * @param accountId Account Id. * @param organizationId Organization Id. * @param context The context to associate with this operation. @@ -259,14 +220,15 @@ public PagedIterable list(String accountId, String organi /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all plan data Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -274,37 +236,28 @@ private Mono> listNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all plan data Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -312,23 +265,13 @@ private Mono> listNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansImpl.java index 90f4e3a0f3ca5..b48a97b5aad87 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansImpl.java @@ -19,8 +19,7 @@ public final class PlansImpl implements Plans { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - public PlansImpl( - PlansClient innerClient, + public PlansImpl(PlansClient innerClient, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public PlansImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new PlanDataResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PlanDataResourceImpl(inner1, this.manager())); } public PagedIterable list(String accountId, String organizationId, Context context) { PagedIterable inner = this.serviceClient().list(accountId, organizationId, context); - return Utils.mapPage(inner, inner1 -> new PlanDataResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PlanDataResourceImpl(inner1, this.manager())); } private PlansClient serviceClient() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/Utils.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ResourceManagerUtils.java similarity index 80% rename from sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/Utils.java rename to sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ResourceManagerUtils.java index ebc02c51a68de..3590ef2e387a9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/Utils.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -38,6 +41,7 @@ static String getValueFromIdByName(String id, String name) { } } return null; + } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -60,7 +64,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -71,10 +75,11 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; + } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +89,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +129,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +191,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleImpl.java index a83030e577bef..ddf28afca2a4c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleImpl.java @@ -79,25 +79,19 @@ public TagRuleImpl withExistingMonitor(String resourceGroupName, String monitorN } public TagRule create() { - this.innerObject = - serviceManager - .serviceClient() - .getTagRules() - .createOrUpdate(resourceGroupName, monitorName, ruleSetName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getTagRules().createOrUpdate(resourceGroupName, monitorName, + ruleSetName, this.innerModel(), Context.NONE); return this; } public TagRule create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getTagRules() - .createOrUpdate(resourceGroupName, monitorName, ruleSetName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getTagRules().createOrUpdate(resourceGroupName, monitorName, + ruleSetName, this.innerModel(), context); return this; } - TagRuleImpl( - String name, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + TagRuleImpl(String name, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = new TagRuleInner(); this.serviceManager = serviceManager; this.ruleSetName = name; @@ -109,52 +103,35 @@ public TagRuleImpl update() { } public TagRule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getTagRules() - .updateWithResponse(resourceGroupName, monitorName, ruleSetName, updateProperties, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getTagRules() + .updateWithResponse(resourceGroupName, monitorName, ruleSetName, updateProperties, Context.NONE).getValue(); return this; } public TagRule apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getTagRules() - .updateWithResponse(resourceGroupName, monitorName, ruleSetName, updateProperties, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getTagRules() + .updateWithResponse(resourceGroupName, monitorName, ruleSetName, updateProperties, context).getValue(); return this; } - TagRuleImpl( - TagRuleInner innerObject, + TagRuleImpl(TagRuleInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.monitorName = Utils.getValueFromIdByName(innerObject.id(), "monitors"); - this.ruleSetName = Utils.getValueFromIdByName(innerObject.id(), "tagRules"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.monitorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "monitors"); + this.ruleSetName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "tagRules"); } public TagRule refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getTagRules() - .getWithResponse(resourceGroupName, monitorName, ruleSetName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getTagRules() + .getWithResponse(resourceGroupName, monitorName, ruleSetName, Context.NONE).getValue(); return this; } public TagRule refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getTagRules() - .getWithResponse(resourceGroupName, monitorName, ruleSetName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getTagRules() + .getWithResponse(resourceGroupName, monitorName, ruleSetName, context).getValue(); return this; } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleUpdateImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleUpdateImpl.java index 0cf157890469b..394d9d937626a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleUpdateImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleUpdateImpl.java @@ -15,8 +15,7 @@ public final class TagRuleUpdateImpl implements TagRuleUpdate { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - TagRuleUpdateImpl( - TagRuleUpdateInner innerObject, + TagRuleUpdateImpl(TagRuleUpdateInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleUpdatePropertiesImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleUpdatePropertiesImpl.java index 28601f6977eac..906864e3b94a5 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleUpdatePropertiesImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleUpdatePropertiesImpl.java @@ -15,8 +15,7 @@ public final class TagRuleUpdatePropertiesImpl implements TagRuleUpdatePropertie private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - TagRuleUpdatePropertiesImpl( - TagRuleUpdatePropertiesInner innerObject, + TagRuleUpdatePropertiesImpl(TagRuleUpdatePropertiesInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesClientImpl.java index d08c7fda411ad..c6a36f438f50c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesClientImpl.java @@ -40,17 +40,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in TagRulesClient. */ +/** + * An instance of this class provides access to all the operations defined in TagRulesClient. + */ public final class TagRulesClientImpl implements TagRulesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final TagRulesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NewRelicObservabilityImpl client; /** * Initializes an instance of TagRulesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ TagRulesClientImpl(NewRelicObservabilityImpl client) { @@ -65,118 +71,83 @@ public final class TagRulesClientImpl implements TagRulesClient { @Host("{$host}") @ServiceInterface(name = "NewRelicObservabilit") public interface TagRulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNewRelicMonitorResource( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByNewRelicMonitorResource(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @PathParam("ruleSetName") String ruleSetName, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @PathParam("ruleSetName") String ruleSetName, - @BodyParam("application/json") TagRuleInner resource, - @HeaderParam("Accept") String accept, - Context context); + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, @BodyParam("application/json") TagRuleInner resource, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @PathParam("ruleSetName") String ruleSetName, - @HeaderParam("Accept") String accept, - Context context); + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @PathParam("ruleSetName") String ruleSetName, - @BodyParam("application/json") TagRuleUpdateInner properties, - @HeaderParam("Accept") String accept, - Context context); + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, @BodyParam("application/json") TagRuleUpdateInner properties, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByNewRelicMonitorResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNewRelicMonitorResourceSinglePageAsync( - String resourceGroupName, String monitorName) { + private Mono> listByNewRelicMonitorResourceSinglePageAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -188,31 +159,16 @@ private Mono> listByNewRelicMonitorResourceSinglePag final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listByNewRelicMonitorResource( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByNewRelicMonitorResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -220,22 +176,18 @@ private Mono> listByNewRelicMonitorResourceSinglePag * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNewRelicMonitorResourceSinglePageAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono> listByNewRelicMonitorResourceSinglePageAsync(String resourceGroupName, + String monitorName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -247,28 +199,15 @@ private Mono> listByNewRelicMonitorResourceSinglePag final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByNewRelicMonitorResource( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByNewRelicMonitorResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -278,14 +217,13 @@ private Mono> listByNewRelicMonitorResourceSinglePag */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByNewRelicMonitorResourceAsync(String resourceGroupName, String monitorName) { - return new PagedFlux<>( - () -> listByNewRelicMonitorResourceSinglePageAsync(resourceGroupName, monitorName), + return new PagedFlux<>(() -> listByNewRelicMonitorResourceSinglePageAsync(resourceGroupName, monitorName), nextLink -> listByNewRelicMonitorResourceNextSinglePageAsync(nextLink)); } /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -295,8 +233,8 @@ private PagedFlux listByNewRelicMonitorResourceAsync(String resour * @return the response of a TagRule list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNewRelicMonitorResourceAsync( - String resourceGroupName, String monitorName, Context context) { + private PagedFlux listByNewRelicMonitorResourceAsync(String resourceGroupName, String monitorName, + Context context) { return new PagedFlux<>( () -> listByNewRelicMonitorResourceSinglePageAsync(resourceGroupName, monitorName, context), nextLink -> listByNewRelicMonitorResourceNextSinglePageAsync(nextLink, context)); @@ -304,7 +242,7 @@ private PagedFlux listByNewRelicMonitorResourceAsync( /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -319,7 +257,7 @@ public PagedIterable listByNewRelicMonitorResource(String resource /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -329,14 +267,14 @@ public PagedIterable listByNewRelicMonitorResource(String resource * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByNewRelicMonitorResource( - String resourceGroupName, String monitorName, Context context) { + public PagedIterable listByNewRelicMonitorResource(String resourceGroupName, String monitorName, + Context context) { return new PagedIterable<>(listByNewRelicMonitorResourceAsync(resourceGroupName, monitorName, context)); } /** * Get a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -346,19 +284,15 @@ public PagedIterable listByNewRelicMonitorResource( * @return a TagRule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String monitorName, String ruleSetName) { + private Mono> getWithResponseAsync(String resourceGroupName, String monitorName, + String ruleSetName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -372,24 +306,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - ruleSetName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -400,19 +324,15 @@ private Mono> getWithResponseAsync( * @return a TagRule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String monitorName, String ruleSetName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String monitorName, + String ruleSetName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -426,21 +346,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - ruleSetName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, ruleSetName, accept, context); } /** * Get a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -457,7 +369,7 @@ private Mono getAsync(String resourceGroupName, String monitorName /** * Get a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -468,14 +380,14 @@ private Mono getAsync(String resourceGroupName, String monitorName * @return a TagRule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String monitorName, String ruleSetName, Context context) { + public Response getWithResponse(String resourceGroupName, String monitorName, String ruleSetName, + Context context) { return getWithResponseAsync(resourceGroupName, monitorName, ruleSetName, context).block(); } /** * Get a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -491,7 +403,7 @@ public TagRuleInner get(String resourceGroupName, String monitorName, String rul /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -499,23 +411,19 @@ public TagRuleInner get(String resourceGroupName, String monitorName, String rul * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of {@link - * Mono}. + * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String monitorName, String ruleSetName, TagRuleInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -534,25 +442,15 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - ruleSetName, - resource, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, resource, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -561,23 +459,19 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of {@link - * Mono}. + * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String monitorName, String ruleSetName, TagRuleInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -596,22 +490,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - ruleSetName, - resource, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, resource, accept, context); } /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -622,19 +507,17 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TagRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), TagRuleInner.class, TagRuleInner.class, this.client.getContext()); + private PollerFlux, TagRuleInner> beginCreateOrUpdateAsync(String resourceGroupName, + String monitorName, String ruleSetName, TagRuleInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TagRuleInner.class, TagRuleInner.class, this.client.getContext()); } /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -646,20 +529,18 @@ private PollerFlux, TagRuleInner> beginCreateOrUpdateAs * @return the {@link PollerFlux} for polling of a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TagRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + private PollerFlux, TagRuleInner> beginCreateOrUpdateAsync(String resourceGroupName, + String monitorName, String ruleSetName, TagRuleInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), TagRuleInner.class, TagRuleInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TagRuleInner.class, TagRuleInner.class, context); } /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -670,14 +551,14 @@ private PollerFlux, TagRuleInner> beginCreateOrUpdateAs * @return the {@link SyncPoller} for polling of a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TagRuleInner> beginCreateOrUpdate( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { + public SyncPoller, TagRuleInner> beginCreateOrUpdate(String resourceGroupName, + String monitorName, String ruleSetName, TagRuleInner resource) { return this.beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource).getSyncPoller(); } /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -689,16 +570,15 @@ public SyncPoller, TagRuleInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TagRuleInner> beginCreateOrUpdate( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context) + public SyncPoller, TagRuleInner> beginCreateOrUpdate(String resourceGroupName, + String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context) .getSyncPoller(); } /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -709,16 +589,15 @@ public SyncPoller, TagRuleInner> beginCreateOrUpdate( * @return a tag rule belonging to NewRelic account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -730,16 +609,15 @@ private Mono createOrUpdateAsync( * @return a tag rule belonging to NewRelic account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -750,14 +628,14 @@ private Mono createOrUpdateAsync( * @return a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagRuleInner createOrUpdate( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { + public TagRuleInner createOrUpdate(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleInner resource) { return createOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource).block(); } /** * Create a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -769,14 +647,14 @@ public TagRuleInner createOrUpdate( * @return a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagRuleInner createOrUpdate( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + public TagRuleInner createOrUpdate(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleInner resource, Context context) { return createOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context).block(); } /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -786,19 +664,15 @@ public TagRuleInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String monitorName, String ruleSetName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, + String ruleSetName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -812,24 +686,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - ruleSetName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -840,19 +704,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String monitorName, String ruleSetName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, + String ruleSetName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -866,21 +726,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - ruleSetName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, ruleSetName, accept, context); } /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -890,18 +742,16 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String monitorName, String ruleSetName) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName, + String ruleSetName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName, ruleSetName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -912,19 +762,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String monitorName, String ruleSetName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName, + String ruleSetName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, monitorName, ruleSetName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, monitorName, ruleSetName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -934,14 +783,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String monitorName, String ruleSetName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + String ruleSetName) { return this.beginDeleteAsync(resourceGroupName, monitorName, ruleSetName).getSyncPoller(); } /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -952,14 +801,14 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String monitorName, String ruleSetName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + String ruleSetName, Context context) { return this.beginDeleteAsync(resourceGroupName, monitorName, ruleSetName, context).getSyncPoller(); } /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -970,14 +819,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String monitorName, String ruleSetName) { - return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName) - .last() + return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -989,14 +837,13 @@ private Mono deleteAsync(String resourceGroupName, String monitorName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String monitorName, String ruleSetName, Context context) { - return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName, context) - .last() + return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -1011,7 +858,7 @@ public void delete(String resourceGroupName, String monitorName, String ruleSetN /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -1027,7 +874,7 @@ public void delete(String resourceGroupName, String monitorName, String ruleSetN /** * Update a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -1035,23 +882,19 @@ public void delete(String resourceGroupName, String monitorName, String ruleSetN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of {@link - * Mono}. + * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdateInner properties) { + private Mono> updateWithResponseAsync(String resourceGroupName, String monitorName, + String ruleSetName, TagRuleUpdateInner properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1069,26 +912,14 @@ private Mono> updateWithResponseAsync( properties.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - ruleSetName, - properties, - accept, - context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -1097,27 +928,19 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of {@link - * Mono}. + * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String monitorName, - String ruleSetName, - TagRuleUpdateInner properties, - Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String monitorName, + String ruleSetName, TagRuleUpdateInner properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1136,22 +959,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - ruleSetName, - properties, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, ruleSetName, properties, accept, context); } /** * Update a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -1162,15 +976,15 @@ private Mono> updateWithResponseAsync( * @return a tag rule belonging to NewRelic account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdateInner properties) { + private Mono updateAsync(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties) { return updateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, properties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Update a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -1182,18 +996,14 @@ private Mono updateAsync( * @return a tag rule belonging to NewRelic account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String monitorName, - String ruleSetName, - TagRuleUpdateInner properties, - Context context) { + public Response updateWithResponse(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties, Context context) { return updateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, properties, context).block(); } /** * Update a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -1204,21 +1014,22 @@ public Response updateWithResponse( * @return a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagRuleInner update( - String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdateInner properties) { + public TagRuleInner update(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties) { return updateWithResponse(resourceGroupName, monitorName, ruleSetName, properties, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByNewRelicMonitorResourceNextSinglePageAsync(String nextLink) { @@ -1226,64 +1037,44 @@ private Mono> listByNewRelicMonitorResourceNextSingl return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listByNewRelicMonitorResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext( + context -> service.listByNewRelicMonitorResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNewRelicMonitorResourceNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByNewRelicMonitorResourceNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByNewRelicMonitorResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByNewRelicMonitorResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesImpl.java index 72b45190028d9..9ddf1405da7cb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesImpl.java @@ -21,35 +21,31 @@ public final class TagRulesImpl implements TagRules { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - public TagRulesImpl( - TagRulesClient innerClient, + public TagRulesImpl(TagRulesClient innerClient, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByNewRelicMonitorResource(String resourceGroupName, String monitorName) { - PagedIterable inner = - this.serviceClient().listByNewRelicMonitorResource(resourceGroupName, monitorName); - return Utils.mapPage(inner, inner1 -> new TagRuleImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByNewRelicMonitorResource(resourceGroupName, monitorName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TagRuleImpl(inner1, this.manager())); } - public PagedIterable listByNewRelicMonitorResource( - String resourceGroupName, String monitorName, Context context) { - PagedIterable inner = - this.serviceClient().listByNewRelicMonitorResource(resourceGroupName, monitorName, context); - return Utils.mapPage(inner, inner1 -> new TagRuleImpl(inner1, this.manager())); + public PagedIterable listByNewRelicMonitorResource(String resourceGroupName, String monitorName, + Context context) { + PagedIterable inner + = this.serviceClient().listByNewRelicMonitorResource(resourceGroupName, monitorName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TagRuleImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String monitorName, String ruleSetName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, monitorName, ruleSetName, context); + public Response getWithResponse(String resourceGroupName, String monitorName, String ruleSetName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, monitorName, ruleSetName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new TagRuleImpl(inner.getValue(), this.manager())); } else { return null; @@ -74,105 +70,77 @@ public void delete(String resourceGroupName, String monitorName, String ruleSetN } public TagRule getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } - String ruleSetName = Utils.getValueFromIdByName(id, "tagRules"); + String ruleSetName = ResourceManagerUtils.getValueFromIdByName(id, "tagRules"); if (ruleSetName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); } return this.getWithResponse(resourceGroupName, monitorName, ruleSetName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } - String ruleSetName = Utils.getValueFromIdByName(id, "tagRules"); + String ruleSetName = ResourceManagerUtils.getValueFromIdByName(id, "tagRules"); if (ruleSetName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); } return this.getWithResponse(resourceGroupName, monitorName, ruleSetName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } - String ruleSetName = Utils.getValueFromIdByName(id, "tagRules"); + String ruleSetName = ResourceManagerUtils.getValueFromIdByName(id, "tagRules"); if (ruleSetName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); } this.delete(resourceGroupName, monitorName, ruleSetName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } - String ruleSetName = Utils.getValueFromIdByName(id, "tagRules"); + String ruleSetName = ResourceManagerUtils.getValueFromIdByName(id, "tagRules"); if (ruleSetName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); } this.delete(resourceGroupName, monitorName, ruleSetName, context); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/VMExtensionPayloadImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/VMExtensionPayloadImpl.java index b39677fa0d3bd..9e75c32537b14 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/VMExtensionPayloadImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/VMExtensionPayloadImpl.java @@ -12,8 +12,7 @@ public final class VMExtensionPayloadImpl implements VMExtensionPayload { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - VMExtensionPayloadImpl( - VMExtensionPayloadInner innerObject, + VMExtensionPayloadImpl(VMExtensionPayloadInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/VMInfoImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/VMInfoImpl.java index 894cef3b2b8c2..cc20960b980b4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/VMInfoImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/VMInfoImpl.java @@ -12,8 +12,7 @@ public final class VMInfoImpl implements VMInfo { private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; - VMInfoImpl( - VMInfoInner innerObject, + VMInfoImpl(VMInfoInner innerObject, com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/package-info.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/package-info.java index 2b3418cf1786a..6e9e5fb4037de 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/package-info.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for NewRelicObservability. null. */ +/** + * Package containing the implementations for NewRelicObservability. + * null. + */ package com.azure.resourcemanager.newrelicobservability.implementation; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountCreationSource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountCreationSource.java index 95f7f6dbfca44..4c2909c34574d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountCreationSource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountCreationSource.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Source of Account creation. */ +/** + * Source of Account creation. + */ public final class AccountCreationSource extends ExpandableStringEnum { - /** Static value LIFTR for AccountCreationSource. */ + /** + * Static value LIFTR for AccountCreationSource. + */ public static final AccountCreationSource LIFTR = fromString("LIFTR"); - /** Static value NEWRELIC for AccountCreationSource. */ + /** + * Static value NEWRELIC for AccountCreationSource. + */ public static final AccountCreationSource NEWRELIC = fromString("NEWRELIC"); /** * Creates a new instance of AccountCreationSource value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public AccountCreationSource() { /** * Creates or finds a AccountCreationSource from its string representation. - * + * * @param name a name to look for. * @return the corresponding AccountCreationSource. */ @@ -38,7 +44,7 @@ public static AccountCreationSource fromString(String name) { /** * Gets known AccountCreationSource values. - * + * * @return known AccountCreationSource values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountInfo.java index a8b864c2ad146..bcf9544d539ba 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountInfo.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountInfo.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Account Info of the NewRelic account. */ +/** + * Account Info of the NewRelic account. + */ @Fluent public final class AccountInfo { /* @@ -23,18 +25,20 @@ public final class AccountInfo { private String ingestionKey; /* - * NewRelic account region + * Region where New Relic account is present */ @JsonProperty(value = "region") private String region; - /** Creates an instance of AccountInfo class. */ + /** + * Creates an instance of AccountInfo class. + */ public AccountInfo() { } /** * Get the accountId property: Account id. - * + * * @return the accountId value. */ public String accountId() { @@ -43,7 +47,7 @@ public String accountId() { /** * Set the accountId property: Account id. - * + * * @param accountId the accountId value to set. * @return the AccountInfo object itself. */ @@ -54,7 +58,7 @@ public AccountInfo withAccountId(String accountId) { /** * Get the ingestionKey property: ingestion key of account. - * + * * @return the ingestionKey value. */ public String ingestionKey() { @@ -63,7 +67,7 @@ public String ingestionKey() { /** * Set the ingestionKey property: ingestion key of account. - * + * * @param ingestionKey the ingestionKey value to set. * @return the AccountInfo object itself. */ @@ -73,8 +77,8 @@ public AccountInfo withIngestionKey(String ingestionKey) { } /** - * Get the region property: NewRelic account region. - * + * Get the region property: Region where New Relic account is present. + * * @return the region value. */ public String region() { @@ -82,8 +86,8 @@ public String region() { } /** - * Set the region property: NewRelic account region. - * + * Set the region property: Region where New Relic account is present. + * * @param region the region value to set. * @return the AccountInfo object itself. */ @@ -94,7 +98,7 @@ public AccountInfo withRegion(String region) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountResource.java index 14d8cad0caa08..3d7bab29e2369 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountResource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountResource.java @@ -7,67 +7,69 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner; -/** An immutable client-side representation of AccountResource. */ +/** + * An immutable client-side representation of AccountResource. + */ public interface AccountResource { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the organizationId property: organization id. - * + * * @return the organizationId value. */ String organizationId(); /** * Gets the accountId property: account id. - * + * * @return the accountId value. */ String accountId(); /** * Gets the accountName property: account name. - * + * * @return the accountName value. */ String accountName(); /** - * Gets the region property: region. - * + * Gets the region property: Region where New Relic account is present. + * * @return the region value. */ String region(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner object. - * + * * @return the inner object. */ AccountResourceInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Accounts.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Accounts.java index d12ca442f7dcd..ded2222f68a83 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Accounts.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Accounts.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Accounts. */ +/** + * Resource collection API of Accounts. + */ public interface Accounts { /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -23,7 +25,7 @@ public interface Accounts { /** * List all the existing accounts. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountsListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountsListResponse.java index ee3097140c64f..3320e801be2e9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountsListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountsListResponse.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response of get all accounts Operation. */ +/** + * Response of get all accounts Operation. + */ @Fluent public final class AccountsListResponse { /* @@ -25,13 +27,15 @@ public final class AccountsListResponse { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of AccountsListResponse class. */ + /** + * Creates an instance of AccountsListResponse class. + */ public AccountsListResponse() { } /** * Get the value property: The AccountResource items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The AccountResource items on this page. - * + * * @param value the value value to set. * @return the AccountsListResponse object itself. */ @@ -51,7 +55,7 @@ public AccountsListResponse withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +64,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of items. - * + * * @param nextLink the nextLink value to set. * @return the AccountsListResponse object itself. */ @@ -71,14 +75,13 @@ public AccountsListResponse withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AccountsListResponse")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AccountsListResponse")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActionType.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActionType.java index 4886ca885a69d..865448613306d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActionType.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActionType.java @@ -8,14 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ + /** + * Static value Internal for ActionType. + */ public static final ActionType INTERNAL = fromString("Internal"); /** * Creates a new instance of ActionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,7 +28,7 @@ public ActionType() { /** * Creates or finds a ActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionType. */ @@ -35,7 +39,7 @@ public static ActionType fromString(String name) { /** * Gets known ActionType values. - * + * * @return known ActionType values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServiceInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServiceInfo.java index 0469ff65c3a32..7e7e5475267a6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServiceInfo.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServiceInfo.java @@ -6,32 +6,34 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; -/** An immutable client-side representation of AppServiceInfo. */ +/** + * An immutable client-side representation of AppServiceInfo. + */ public interface AppServiceInfo { /** * Gets the azureResourceId property: Azure App service resource ID. - * + * * @return the azureResourceId value. */ String azureResourceId(); /** * Gets the agentVersion property: Version of the NewRelic agent installed on the App service. - * + * * @return the agentVersion value. */ String agentVersion(); /** * Gets the agentStatus property: Status of the NewRelic agent installed on the App service. - * + * * @return the agentStatus value. */ String agentStatus(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner object. - * + * * @return the inner object. */ AppServiceInfoInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesGetRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesGetRequest.java index 9b7135546362d..2a6ce76478765 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesGetRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesGetRequest.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Request of a app services get Operation. */ +/** + * Request of a app services get Operation. + */ @Fluent public final class AppServicesGetRequest { /* @@ -24,13 +26,15 @@ public final class AppServicesGetRequest { @JsonProperty(value = "userEmail", required = true) private String userEmail; - /** Creates an instance of AppServicesGetRequest class. */ + /** + * Creates an instance of AppServicesGetRequest class. + */ public AppServicesGetRequest() { } /** * Get the azureResourceIds property: Azure resource IDs. - * + * * @return the azureResourceIds value. */ public List azureResourceIds() { @@ -39,7 +43,7 @@ public List azureResourceIds() { /** * Set the azureResourceIds property: Azure resource IDs. - * + * * @param azureResourceIds the azureResourceIds value to set. * @return the AppServicesGetRequest object itself. */ @@ -50,7 +54,7 @@ public AppServicesGetRequest withAzureResourceIds(List azureResourceIds) /** * Get the userEmail property: User Email. - * + * * @return the userEmail value. */ public String userEmail() { @@ -59,7 +63,7 @@ public String userEmail() { /** * Set the userEmail property: User Email. - * + * * @param userEmail the userEmail value to set. * @return the AppServicesGetRequest object itself. */ @@ -70,14 +74,13 @@ public AppServicesGetRequest withUserEmail(String userEmail) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (userEmail() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model AppServicesGetRequest")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property userEmail in model AppServicesGetRequest")); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesListResponse.java index aeba394ecf674..da1f6ef3913c5 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesListResponse.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response of a list app services Operation. */ +/** + * Response of a list app services Operation. + */ @Fluent public final class AppServicesListResponse { /* @@ -25,13 +27,15 @@ public final class AppServicesListResponse { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of AppServicesListResponse class. */ + /** + * Creates an instance of AppServicesListResponse class. + */ public AppServicesListResponse() { } /** * Get the value property: The AppServiceInfo items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The AppServiceInfo items on this page. - * + * * @param value the value value to set. * @return the AppServicesListResponse object itself. */ @@ -51,7 +55,7 @@ public AppServicesListResponse withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +64,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of items. - * + * * @param nextLink the nextLink value to set. * @return the AppServicesListResponse object itself. */ @@ -71,14 +75,13 @@ public AppServicesListResponse withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AppServicesListResponse")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AppServicesListResponse")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingCycle.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingCycle.java index 4f150e76b4ee7..6846b132b23c7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingCycle.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingCycle.java @@ -8,20 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Different usage type like YEARLY/MONTHLY. */ +/** + * Different usage type like YEARLY/MONTHLY. + */ public final class BillingCycle extends ExpandableStringEnum { - /** Static value YEARLY for BillingCycle. */ + /** + * Static value YEARLY for BillingCycle. + */ public static final BillingCycle YEARLY = fromString("YEARLY"); - /** Static value MONTHLY for BillingCycle. */ + /** + * Static value MONTHLY for BillingCycle. + */ public static final BillingCycle MONTHLY = fromString("MONTHLY"); - /** Static value WEEKLY for BillingCycle. */ + /** + * Static value WEEKLY for BillingCycle. + */ public static final BillingCycle WEEKLY = fromString("WEEKLY"); /** * Creates a new instance of BillingCycle value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +38,7 @@ public BillingCycle() { /** * Creates or finds a BillingCycle from its string representation. - * + * * @param name a name to look for. * @return the corresponding BillingCycle. */ @@ -41,7 +49,7 @@ public static BillingCycle fromString(String name) { /** * Gets known BillingCycle values. - * + * * @return known BillingCycle values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoResponse.java new file mode 100644 index 0000000000000..6db10e3cf32af --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoResponse.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner; + +/** + * An immutable client-side representation of BillingInfoResponse. + */ +public interface BillingInfoResponse { + /** + * Gets the marketplaceSaasInfo property: Marketplace Subscription details. + * + * @return the marketplaceSaasInfo value. + */ + MarketplaceSaaSInfo marketplaceSaasInfo(); + + /** + * Gets the partnerBillingEntity property: Partner Billing Entity details: Organization Info. + * + * @return the partnerBillingEntity value. + */ + PartnerBillingEntity partnerBillingEntity(); + + /** + * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner object. + * + * @return the inner object. + */ + BillingInfoResponseInner innerModel(); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoes.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoes.java new file mode 100644 index 0000000000000..16ae0506b26ff --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoes.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BillingInfoes. + */ +public interface BillingInfoes { + /** + * Get marketplace info mapped to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace info mapped to the given monitor along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String monitorName, Context context); + + /** + * Get marketplace info mapped to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace info mapped to the given monitor. + */ + BillingInfoResponse get(String resourceGroupName, String monitorName); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingSource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingSource.java index fb8c2d44ed3cb..1ce36932b649d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingSource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingSource.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Billing source. */ +/** + * Billing source. + */ public final class BillingSource extends ExpandableStringEnum { - /** Static value AZURE for BillingSource. */ + /** + * Static value AZURE for BillingSource. + */ public static final BillingSource AZURE = fromString("AZURE"); - /** Static value NEWRELIC for BillingSource. */ + /** + * Static value NEWRELIC for BillingSource. + */ public static final BillingSource NEWRELIC = fromString("NEWRELIC"); /** * Creates a new instance of BillingSource value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public BillingSource() { /** * Creates or finds a BillingSource from its string representation. - * + * * @param name a name to look for. * @return the corresponding BillingSource. */ @@ -38,7 +44,7 @@ public static BillingSource fromString(String name) { /** * Gets known BillingSource values. - * + * * @return known BillingSource values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConfigurationName.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConfigurationName.java new file mode 100644 index 0000000000000..e3f0b963decaa --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConfigurationName.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for ConfigurationName. + */ +public final class ConfigurationName extends ExpandableStringEnum { + /** + * Static value default for ConfigurationName. + */ + public static final ConfigurationName DEFAULT = fromString("default"); + + /** + * Creates a new instance of ConfigurationName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigurationName() { + } + + /** + * Creates or finds a ConfigurationName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationName. + */ + @JsonCreator + public static ConfigurationName fromString(String name) { + return fromString(name, ConfigurationName.class); + } + + /** + * Gets known ConfigurationName values. + * + * @return known ConfigurationName values. + */ + public static Collection values() { + return values(ConfigurationName.class); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourceProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourceProperties.java new file mode 100644 index 0000000000000..9ca3d700c1e5f --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourceProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connected Partner Resource Properties. + */ +@Fluent +public final class ConnectedPartnerResourceProperties { + /* + * NewRelic account name + */ + @JsonProperty(value = "accountName") + private String accountName; + + /* + * NewRelic Account Id + */ + @JsonProperty(value = "accountId") + private String accountId; + + /* + * The azure resource Id of the deployment. + */ + @JsonProperty(value = "azureResourceId") + private String azureResourceId; + + /* + * The location of the deployment. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Creates an instance of ConnectedPartnerResourceProperties class. + */ + public ConnectedPartnerResourceProperties() { + } + + /** + * Get the accountName property: NewRelic account name. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: NewRelic account name. + * + * @param accountName the accountName value to set. + * @return the ConnectedPartnerResourceProperties object itself. + */ + public ConnectedPartnerResourceProperties withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the accountId property: NewRelic Account Id. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId property: NewRelic Account Id. + * + * @param accountId the accountId value to set. + * @return the ConnectedPartnerResourceProperties object itself. + */ + public ConnectedPartnerResourceProperties withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get the azureResourceId property: The azure resource Id of the deployment. + * + * @return the azureResourceId value. + */ + public String azureResourceId() { + return this.azureResourceId; + } + + /** + * Set the azureResourceId property: The azure resource Id of the deployment. + * + * @param azureResourceId the azureResourceId value to set. + * @return the ConnectedPartnerResourceProperties object itself. + */ + public ConnectedPartnerResourceProperties withAzureResourceId(String azureResourceId) { + this.azureResourceId = azureResourceId; + return this; + } + + /** + * Get the location property: The location of the deployment. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the deployment. + * + * @param location the location value to set. + * @return the ConnectedPartnerResourceProperties object itself. + */ + public ConnectedPartnerResourceProperties withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResources.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResources.java new file mode 100644 index 0000000000000..43e14ff91e511 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResources.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ConnectedPartnerResources. + */ +public interface ConnectedPartnerResources { + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Email Id of the user. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName, String body, + Context context); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListFormat.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListFormat.java new file mode 100644 index 0000000000000..4ffc29ae0f15d --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListFormat.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; + +/** + * An immutable client-side representation of ConnectedPartnerResourcesListFormat. + */ +public interface ConnectedPartnerResourcesListFormat { + /** + * Gets the properties property: Connected Partner Resource Properties. + * + * @return the properties value. + */ + ConnectedPartnerResourceProperties properties(); + + /** + * Gets the inner + * com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner object. + * + * @return the inner object. + */ + ConnectedPartnerResourcesListFormatInner innerModel(); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListResponse.java new file mode 100644 index 0000000000000..f154a03ca3c7a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListResponse.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of all active newrelic deployments. + */ +@Fluent +public final class ConnectedPartnerResourcesListResponse { + /* + * Results of a list operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results, if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of ConnectedPartnerResourcesListResponse class. + */ + public ConnectedPartnerResourcesListResponse() { + } + + /** + * Get the value property: Results of a list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Results of a list operation. + * + * @param value the value value to set. + * @return the ConnectedPartnerResourcesListResponse object itself. + */ + public ConnectedPartnerResourcesListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results, if any. + * + * @param nextLink the nextLink value to set. + * @return the ConnectedPartnerResourcesListResponse object itself. + */ + public ConnectedPartnerResourcesListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/FilteringTag.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/FilteringTag.java index 9c14652281aa7..8866e5b561cd3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/FilteringTag.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/FilteringTag.java @@ -31,13 +31,15 @@ public final class FilteringTag { @JsonProperty(value = "action") private TagAction action; - /** Creates an instance of FilteringTag class. */ + /** + * Creates an instance of FilteringTag class. + */ public FilteringTag() { } /** * Get the name property: The name (also known as the key) of the tag. - * + * * @return the name value. */ public String name() { @@ -46,7 +48,7 @@ public String name() { /** * Set the name property: The name (also known as the key) of the tag. - * + * * @param name the name value to set. * @return the FilteringTag object itself. */ @@ -57,7 +59,7 @@ public FilteringTag withName(String name) { /** * Get the value property: The value of the tag. - * + * * @return the value value. */ public String value() { @@ -66,7 +68,7 @@ public String value() { /** * Set the value property: The value of the tag. - * + * * @param value the value value to set. * @return the FilteringTag object itself. */ @@ -77,7 +79,7 @@ public FilteringTag withValue(String value) { /** * Get the action property: Valid actions for a filtering tag. Exclusion takes priority over inclusion. - * + * * @return the action value. */ public TagAction action() { @@ -86,7 +88,7 @@ public TagAction action() { /** * Set the action property: Valid actions for a filtering tag. Exclusion takes priority over inclusion. - * + * * @param action the action value to set. * @return the FilteringTag object itself. */ @@ -97,7 +99,7 @@ public FilteringTag withAction(TagAction action) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/HostsGetRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/HostsGetRequest.java index 65832553ea045..5399bc21a498d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/HostsGetRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/HostsGetRequest.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Request of a Hosts get Operation. */ +/** + * Request of a Hosts get Operation. + */ @Fluent public final class HostsGetRequest { /* @@ -24,13 +26,15 @@ public final class HostsGetRequest { @JsonProperty(value = "userEmail", required = true) private String userEmail; - /** Creates an instance of HostsGetRequest class. */ + /** + * Creates an instance of HostsGetRequest class. + */ public HostsGetRequest() { } /** * Get the vmIds property: VM resource IDs. - * + * * @return the vmIds value. */ public List vmIds() { @@ -39,7 +43,7 @@ public List vmIds() { /** * Set the vmIds property: VM resource IDs. - * + * * @param vmIds the vmIds value to set. * @return the HostsGetRequest object itself. */ @@ -50,7 +54,7 @@ public HostsGetRequest withVmIds(List vmIds) { /** * Get the userEmail property: User Email. - * + * * @return the userEmail value. */ public String userEmail() { @@ -59,7 +63,7 @@ public String userEmail() { /** * Set the userEmail property: User Email. - * + * * @param userEmail the userEmail value to set. * @return the HostsGetRequest object itself. */ @@ -70,14 +74,13 @@ public HostsGetRequest withUserEmail(String userEmail) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (userEmail() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model HostsGetRequest")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property userEmail in model HostsGetRequest")); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LiftrResourceCategories.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LiftrResourceCategories.java index c54ff40cd482f..5489faf533647 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LiftrResourceCategories.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LiftrResourceCategories.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Liftr Resource category. */ +/** + * Liftr Resource category. + */ public final class LiftrResourceCategories extends ExpandableStringEnum { - /** Static value Unknown for LiftrResourceCategories. */ + /** + * Static value Unknown for LiftrResourceCategories. + */ public static final LiftrResourceCategories UNKNOWN = fromString("Unknown"); - /** Static value MonitorLogs for LiftrResourceCategories. */ + /** + * Static value MonitorLogs for LiftrResourceCategories. + */ public static final LiftrResourceCategories MONITOR_LOGS = fromString("MonitorLogs"); /** * Creates a new instance of LiftrResourceCategories value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public LiftrResourceCategories() { /** * Creates or finds a LiftrResourceCategories from its string representation. - * + * * @param name a name to look for. * @return the corresponding LiftrResourceCategories. */ @@ -38,7 +44,7 @@ public static LiftrResourceCategories fromString(String name) { /** * Gets known LiftrResourceCategories values. - * + * * @return known LiftrResourceCategories values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResource.java new file mode 100644 index 0000000000000..6f39db758dc60 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResource.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; + +/** + * An immutable client-side representation of LinkedResource. + */ +public interface LinkedResource { + /** + * Gets the id property: The ARM id of the linked resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner object. + * + * @return the inner object. + */ + LinkedResourceInner innerModel(); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResourceListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResourceListResponse.java new file mode 100644 index 0000000000000..77d6d8b301efe --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResourceListResponse.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response of a list operation. + */ +@Fluent +public final class LinkedResourceListResponse { + /* + * Results of a list operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results, if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of LinkedResourceListResponse class. + */ + public LinkedResourceListResponse() { + } + + /** + * Get the value property: Results of a list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Results of a list operation. + * + * @param value the value value to set. + * @return the LinkedResourceListResponse object itself. + */ + public LinkedResourceListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results, if any. + * + * @param nextLink the nextLink value to set. + * @return the LinkedResourceListResponse object itself. + */ + public LinkedResourceListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LogRules.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LogRules.java index 0a0528d2ea1e1..aac1473d13a25 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LogRules.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LogRules.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Set of rules for sending logs for the Monitor resource. */ +/** + * Set of rules for sending logs for the Monitor resource. + */ @Fluent public final class LogRules { /* @@ -38,13 +40,15 @@ public final class LogRules { @JsonProperty(value = "filteringTags") private List filteringTags; - /** Creates an instance of LogRules class. */ + /** + * Creates an instance of LogRules class. + */ public LogRules() { } /** * Get the sendAadLogs property: Flag specifying if AAD logs should be sent for the Monitor resource. - * + * * @return the sendAadLogs value. */ public SendAadLogsStatus sendAadLogs() { @@ -53,7 +57,7 @@ public SendAadLogsStatus sendAadLogs() { /** * Set the sendAadLogs property: Flag specifying if AAD logs should be sent for the Monitor resource. - * + * * @param sendAadLogs the sendAadLogs value to set. * @return the LogRules object itself. */ @@ -65,7 +69,7 @@ public LogRules withSendAadLogs(SendAadLogsStatus sendAadLogs) { /** * Get the sendSubscriptionLogs property: Flag specifying if subscription logs should be sent for the Monitor * resource. - * + * * @return the sendSubscriptionLogs value. */ public SendSubscriptionLogsStatus sendSubscriptionLogs() { @@ -75,7 +79,7 @@ public SendSubscriptionLogsStatus sendSubscriptionLogs() { /** * Set the sendSubscriptionLogs property: Flag specifying if subscription logs should be sent for the Monitor * resource. - * + * * @param sendSubscriptionLogs the sendSubscriptionLogs value to set. * @return the LogRules object itself. */ @@ -87,7 +91,7 @@ public LogRules withSendSubscriptionLogs(SendSubscriptionLogsStatus sendSubscrip /** * Get the sendActivityLogs property: Flag specifying if activity logs from Azure resources should be sent for the * Monitor resource. - * + * * @return the sendActivityLogs value. */ public SendActivityLogsStatus sendActivityLogs() { @@ -97,7 +101,7 @@ public SendActivityLogsStatus sendActivityLogs() { /** * Set the sendActivityLogs property: Flag specifying if activity logs from Azure resources should be sent for the * Monitor resource. - * + * * @param sendActivityLogs the sendActivityLogs value to set. * @return the LogRules object itself. */ @@ -108,10 +112,10 @@ public LogRules withSendActivityLogs(SendActivityLogsStatus sendActivityLogs) { /** * Get the filteringTags property: List of filtering tags to be used for capturing logs. This only takes effect if - * SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, - * the rules will apply to the list of all available resources. If Include actions are specified, the rules will - * only include resources with the associated tags. - * + * SendActivityLogs flag is enabled. If empty, all resources will be captured. + * If only Exclude action is specified, the rules will apply to the list of all available resources. If Include + * actions are specified, the rules will only include resources with the associated tags. + * * @return the filteringTags value. */ public List filteringTags() { @@ -120,10 +124,10 @@ public List filteringTags() { /** * Set the filteringTags property: List of filtering tags to be used for capturing logs. This only takes effect if - * SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, - * the rules will apply to the list of all available resources. If Include actions are specified, the rules will - * only include resources with the associated tags. - * + * SendActivityLogs flag is enabled. If empty, all resources will be captured. + * If only Exclude action is specified, the rules will apply to the list of all available resources. If Include + * actions are specified, the rules will only include resources with the associated tags. + * * @param filteringTags the filteringTags value to set. * @return the LogRules object itself. */ @@ -134,7 +138,7 @@ public LogRules withFilteringTags(List filteringTags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentity.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentity.java index b3167c58a3b23..12609b227f0fa 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentity.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentity.java @@ -11,7 +11,9 @@ import java.util.Map; import java.util.UUID; -/** Managed service identity (system assigned and/or user assigned identities). */ +/** + * Managed service identity (system assigned and/or user assigned identities). + */ @Fluent public final class ManagedServiceIdentity { /* @@ -37,21 +39,24 @@ public final class ManagedServiceIdentity { /* * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. * The dictionary values can be empty objects ({}) in requests. */ @JsonProperty(value = "userAssignedIdentities") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; - /** Creates an instance of ManagedServiceIdentity class. */ + /** + * Creates an instance of ManagedServiceIdentity class. + */ public ManagedServiceIdentity() { } /** * Get the principalId property: The service principal ID of the system assigned identity. This property will only * be provided for a system assigned identity. - * + * * @return the principalId value. */ public UUID principalId() { @@ -59,9 +64,9 @@ public UUID principalId() { } /** - * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for - * a system assigned identity. - * + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided + * for a system assigned identity. + * * @return the tenantId value. */ public UUID tenantId() { @@ -71,7 +76,7 @@ public UUID tenantId() { /** * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are * allowed). - * + * * @return the type value. */ public ManagedServiceIdentityType type() { @@ -81,7 +86,7 @@ public ManagedServiceIdentityType type() { /** * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are * allowed). - * + * * @param type the type value to set. * @return the ManagedServiceIdentity object itself. */ @@ -95,7 +100,7 @@ public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { * userAssignedIdentities dictionary keys will be ARM resource ids in the form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. * The dictionary values can be empty objects ({}) in requests. - * + * * @return the userAssignedIdentities value. */ public Map userAssignedIdentities() { @@ -107,7 +112,7 @@ public Map userAssignedIdentities() { * userAssignedIdentities dictionary keys will be ARM resource ids in the form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. * The dictionary values can be empty objects ({}) in requests. - * + * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the ManagedServiceIdentity object itself. */ @@ -118,24 +123,20 @@ public ManagedServiceIdentity withUserAssignedIdentities(Map { - if (e != null) { - e.validate(); - } - }); + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentityType.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentityType.java index 02760709a0322..c0964b0a0531a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentityType.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentityType.java @@ -8,24 +8,34 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ public final class ManagedServiceIdentityType extends ExpandableStringEnum { - /** Static value None for ManagedServiceIdentityType. */ + /** + * Static value None for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType NONE = fromString("None"); - /** Static value SystemAssigned for ManagedServiceIdentityType. */ + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - /** Static value UserAssigned for ManagedServiceIdentityType. */ + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); - /** Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. */ - public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = - fromString("SystemAssigned, UserAssigned"); + /** + * Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned, UserAssigned"); /** * Creates a new instance of ManagedServiceIdentityType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,7 +44,7 @@ public ManagedServiceIdentityType() { /** * Creates or finds a ManagedServiceIdentityType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ManagedServiceIdentityType. */ @@ -45,7 +55,7 @@ public static ManagedServiceIdentityType fromString(String name) { /** * Gets known ManagedServiceIdentityType values. - * + * * @return known ManagedServiceIdentityType values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSaaSInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSaaSInfo.java new file mode 100644 index 0000000000000..b391698ecb792 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSaaSInfo.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Marketplace SAAS Info of the resource. + */ +@Fluent +public final class MarketplaceSaaSInfo { + /* + * Marketplace Subscription Id. This is a GUID-formatted string. + */ + @JsonProperty(value = "marketplaceSubscriptionId") + private String marketplaceSubscriptionId; + + /* + * Marketplace Subscription Details: SAAS Name + */ + @JsonProperty(value = "marketplaceSubscriptionName") + private String marketplaceSubscriptionName; + + /* + * Marketplace Subscription Details: Resource URI + */ + @JsonProperty(value = "marketplaceResourceId") + private String marketplaceResourceId; + + /* + * Marketplace Subscription Details: SaaS Subscription Status + */ + @JsonProperty(value = "marketplaceStatus") + private String marketplaceStatus; + + /* + * The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. + */ + @JsonProperty(value = "billedAzureSubscriptionId") + private String billedAzureSubscriptionId; + + /** + * Creates an instance of MarketplaceSaaSInfo class. + */ + public MarketplaceSaaSInfo() { + } + + /** + * Get the marketplaceSubscriptionId property: Marketplace Subscription Id. This is a GUID-formatted string. + * + * @return the marketplaceSubscriptionId value. + */ + public String marketplaceSubscriptionId() { + return this.marketplaceSubscriptionId; + } + + /** + * Set the marketplaceSubscriptionId property: Marketplace Subscription Id. This is a GUID-formatted string. + * + * @param marketplaceSubscriptionId the marketplaceSubscriptionId value to set. + * @return the MarketplaceSaaSInfo object itself. + */ + public MarketplaceSaaSInfo withMarketplaceSubscriptionId(String marketplaceSubscriptionId) { + this.marketplaceSubscriptionId = marketplaceSubscriptionId; + return this; + } + + /** + * Get the marketplaceSubscriptionName property: Marketplace Subscription Details: SAAS Name. + * + * @return the marketplaceSubscriptionName value. + */ + public String marketplaceSubscriptionName() { + return this.marketplaceSubscriptionName; + } + + /** + * Set the marketplaceSubscriptionName property: Marketplace Subscription Details: SAAS Name. + * + * @param marketplaceSubscriptionName the marketplaceSubscriptionName value to set. + * @return the MarketplaceSaaSInfo object itself. + */ + public MarketplaceSaaSInfo withMarketplaceSubscriptionName(String marketplaceSubscriptionName) { + this.marketplaceSubscriptionName = marketplaceSubscriptionName; + return this; + } + + /** + * Get the marketplaceResourceId property: Marketplace Subscription Details: Resource URI. + * + * @return the marketplaceResourceId value. + */ + public String marketplaceResourceId() { + return this.marketplaceResourceId; + } + + /** + * Set the marketplaceResourceId property: Marketplace Subscription Details: Resource URI. + * + * @param marketplaceResourceId the marketplaceResourceId value to set. + * @return the MarketplaceSaaSInfo object itself. + */ + public MarketplaceSaaSInfo withMarketplaceResourceId(String marketplaceResourceId) { + this.marketplaceResourceId = marketplaceResourceId; + return this; + } + + /** + * Get the marketplaceStatus property: Marketplace Subscription Details: SaaS Subscription Status. + * + * @return the marketplaceStatus value. + */ + public String marketplaceStatus() { + return this.marketplaceStatus; + } + + /** + * Set the marketplaceStatus property: Marketplace Subscription Details: SaaS Subscription Status. + * + * @param marketplaceStatus the marketplaceStatus value to set. + * @return the MarketplaceSaaSInfo object itself. + */ + public MarketplaceSaaSInfo withMarketplaceStatus(String marketplaceStatus) { + this.marketplaceStatus = marketplaceStatus; + return this; + } + + /** + * Get the billedAzureSubscriptionId property: The Azure Subscription ID to which the Marketplace Subscription + * belongs and gets billed into. + * + * @return the billedAzureSubscriptionId value. + */ + public String billedAzureSubscriptionId() { + return this.billedAzureSubscriptionId; + } + + /** + * Set the billedAzureSubscriptionId property: The Azure Subscription ID to which the Marketplace Subscription + * belongs and gets billed into. + * + * @param billedAzureSubscriptionId the billedAzureSubscriptionId value to set. + * @return the MarketplaceSaaSInfo object itself. + */ + public MarketplaceSaaSInfo withBilledAzureSubscriptionId(String billedAzureSubscriptionId) { + this.billedAzureSubscriptionId = billedAzureSubscriptionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSubscriptionStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSubscriptionStatus.java index 4582223ce86b0..6c0036fd3d574 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSubscriptionStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSubscriptionStatus.java @@ -13,15 +13,19 @@ * will go in Suspended state. */ public final class MarketplaceSubscriptionStatus extends ExpandableStringEnum { - /** Static value Active for MarketplaceSubscriptionStatus. */ + /** + * Static value Active for MarketplaceSubscriptionStatus. + */ public static final MarketplaceSubscriptionStatus ACTIVE = fromString("Active"); - /** Static value Suspended for MarketplaceSubscriptionStatus. */ + /** + * Static value Suspended for MarketplaceSubscriptionStatus. + */ public static final MarketplaceSubscriptionStatus SUSPENDED = fromString("Suspended"); /** * Creates a new instance of MarketplaceSubscriptionStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +34,7 @@ public MarketplaceSubscriptionStatus() { /** * Creates or finds a MarketplaceSubscriptionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding MarketplaceSubscriptionStatus. */ @@ -41,7 +45,7 @@ public static MarketplaceSubscriptionStatus fromString(String name) { /** * Gets known MarketplaceSubscriptionStatus values. - * + * * @return known MarketplaceSubscriptionStatus values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricRules.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricRules.java index 0c465db5300af..78b2d63945578 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricRules.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricRules.java @@ -7,32 +7,34 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import java.util.List; -/** An immutable client-side representation of MetricRules. */ +/** + * An immutable client-side representation of MetricRules. + */ public interface MetricRules { /** * Gets the sendMetrics property: Flag specifying if metrics should be sent for the Monitor resource. - * + * * @return the sendMetrics value. */ SendMetricsStatus sendMetrics(); /** * Gets the filteringTags property: List of filtering tags to be used for capturing metrics. - * + * * @return the filteringTags value. */ List filteringTags(); /** * Gets the userEmail property: User Email. - * + * * @return the userEmail value. */ String userEmail(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner object. - * + * * @return the inner object. */ MetricRulesInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsRequest.java index 81635202807bf..4b9c056fb6579 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsRequest.java @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Request of get metrics Operation. */ +/** + * Request of get metrics Operation. + */ @Fluent public final class MetricsRequest { /* @@ -17,13 +19,15 @@ public final class MetricsRequest { @JsonProperty(value = "userEmail", required = true) private String userEmail; - /** Creates an instance of MetricsRequest class. */ + /** + * Creates an instance of MetricsRequest class. + */ public MetricsRequest() { } /** * Get the userEmail property: User Email. - * + * * @return the userEmail value. */ public String userEmail() { @@ -32,7 +36,7 @@ public String userEmail() { /** * Set the userEmail property: User Email. - * + * * @param userEmail the userEmail value to set. * @return the MetricsRequest object itself. */ @@ -43,14 +47,13 @@ public MetricsRequest withUserEmail(String userEmail) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (userEmail() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model MetricsRequest")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property userEmail in model MetricsRequest")); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusRequest.java index 241f3542c93bc..e0855e61c0789 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusRequest.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Request of get metrics status Operation. */ +/** + * Request of get metrics status Operation. + */ @Fluent public final class MetricsStatusRequest { /* @@ -24,13 +26,15 @@ public final class MetricsStatusRequest { @JsonProperty(value = "userEmail", required = true) private String userEmail; - /** Creates an instance of MetricsStatusRequest class. */ + /** + * Creates an instance of MetricsStatusRequest class. + */ public MetricsStatusRequest() { } /** * Get the azureResourceIds property: Azure resource IDs. - * + * * @return the azureResourceIds value. */ public List azureResourceIds() { @@ -39,7 +43,7 @@ public List azureResourceIds() { /** * Set the azureResourceIds property: Azure resource IDs. - * + * * @param azureResourceIds the azureResourceIds value to set. * @return the MetricsStatusRequest object itself. */ @@ -50,7 +54,7 @@ public MetricsStatusRequest withAzureResourceIds(List azureResourceIds) /** * Get the userEmail property: User Email. - * + * * @return the userEmail value. */ public String userEmail() { @@ -59,7 +63,7 @@ public String userEmail() { /** * Set the userEmail property: User Email. - * + * * @param userEmail the userEmail value to set. * @return the MetricsStatusRequest object itself. */ @@ -70,14 +74,13 @@ public MetricsStatusRequest withUserEmail(String userEmail) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (userEmail() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model MetricsStatusRequest")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property userEmail in model MetricsStatusRequest")); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusResponse.java index d23ba424f7b83..e0f1fe8a18d8c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusResponse.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner; import java.util.List; -/** An immutable client-side representation of MetricsStatusResponse. */ +/** + * An immutable client-side representation of MetricsStatusResponse. + */ public interface MetricsStatusResponse { /** * Gets the azureResourceIds property: Azure resource IDs. - * + * * @return the azureResourceIds value. */ List azureResourceIds(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner object. - * + * * @return the inner object. */ MetricsStatusResponseInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResource.java index c442d07991839..eb22e9411aac2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResource.java @@ -6,18 +6,20 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner; -/** An immutable client-side representation of MonitoredResource. */ +/** + * An immutable client-side representation of MonitoredResource. + */ public interface MonitoredResource { /** * Gets the id property: The ARM id of the resource. - * + * * @return the id value. */ String id(); /** * Gets the sendingMetrics property: Flag indicating if resource is sending metrics to NewRelic. - * + * * @return the sendingMetrics value. */ SendingMetricsStatus sendingMetrics(); @@ -25,28 +27,28 @@ public interface MonitoredResource { /** * Gets the reasonForMetricsStatus property: Reason for why the resource is sending metrics (or why it is not * sending). - * + * * @return the reasonForMetricsStatus value. */ String reasonForMetricsStatus(); /** * Gets the sendingLogs property: Flag indicating if resource is sending logs to NewRelic. - * + * * @return the sendingLogs value. */ SendingLogsStatus sendingLogs(); /** * Gets the reasonForLogsStatus property: Reason for why the resource is sending logs (or why it is not sending). - * + * * @return the reasonForLogsStatus value. */ String reasonForLogsStatus(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner object. - * + * * @return the inner object. */ MonitoredResourceInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResourceListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResourceListResponse.java index 2f44447c2b0b7..f11afb5054c51 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResourceListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResourceListResponse.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the resources being monitored by NewRelic monitor resource. */ +/** + * List of all the resources being monitored by NewRelic monitor resource. + */ @Fluent public final class MonitoredResourceListResponse { /* @@ -25,13 +27,15 @@ public final class MonitoredResourceListResponse { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of MonitoredResourceListResponse class. */ + /** + * Creates an instance of MonitoredResourceListResponse class. + */ public MonitoredResourceListResponse() { } /** * Get the value property: The MonitoredResource items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The MonitoredResource items on this page. - * + * * @param value the value value to set. * @return the MonitoredResourceListResponse object itself. */ @@ -51,7 +55,7 @@ public MonitoredResourceListResponse withValue(List valu /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +64,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of items. - * + * * @param nextLink the nextLink value to set. * @return the MonitoredResourceListResponse object itself. */ @@ -71,15 +75,13 @@ public MonitoredResourceListResponse withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model MonitoredResourceListResponse")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model MonitoredResourceListResponse")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscription.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscription.java new file mode 100644 index 0000000000000..3d96a8f57e09a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscription.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; + +/** + * An immutable client-side representation of MonitoredSubscription. + */ +public interface MonitoredSubscription { + /** + * Gets the subscriptionId property: The subscriptionId to be monitored. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Gets the status property: The state of monitoring. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the error property: The reason of not monitoring the subscription. + * + * @return the error value. + */ + String error(); + + /** + * Gets the tagRules property: The resource-specific properties for this resource. + * + * @return the tagRules value. + */ + MonitoringTagRulesProperties tagRules(); + + /** + * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner object. + * + * @return the inner object. + */ + MonitoredSubscriptionInner innerModel(); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionProperties.java new file mode 100644 index 0000000000000..45a7565b4328d --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionProperties.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; + +/** + * An immutable client-side representation of MonitoredSubscriptionProperties. + */ +public interface MonitoredSubscriptionProperties { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The request to update subscriptions needed to be monitored by the NewRelic monitor + * resource. + * + * @return the properties value. + */ + SubscriptionList properties(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner + * object. + * + * @return the inner object. + */ + MonitoredSubscriptionPropertiesInner innerModel(); + + /** + * The entirety of the MonitoredSubscriptionProperties definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The MonitoredSubscriptionProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the MonitoredSubscriptionProperties definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the MonitoredSubscriptionProperties definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @return the next definition stage. + */ + WithCreate withExistingMonitor(String resourceGroupName, String monitorName); + } + + /** + * The stage of the MonitoredSubscriptionProperties definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + MonitoredSubscriptionProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MonitoredSubscriptionProperties create(Context context); + } + + /** + * The stage of the MonitoredSubscriptionProperties definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The request to update subscriptions needed to be monitored by the + * NewRelic monitor resource.. + * + * @param properties The request to update subscriptions needed to be monitored by the NewRelic monitor + * resource. + * @return the next definition stage. + */ + WithCreate withProperties(SubscriptionList properties); + } + } + + /** + * Begins update for the MonitoredSubscriptionProperties resource. + * + * @return the stage of resource update. + */ + MonitoredSubscriptionProperties.Update update(); + + /** + * The template for MonitoredSubscriptionProperties update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MonitoredSubscriptionProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MonitoredSubscriptionProperties apply(Context context); + } + + /** + * The MonitoredSubscriptionProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the MonitoredSubscriptionProperties update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The request to update subscriptions needed to be monitored by the + * NewRelic monitor resource.. + * + * @param properties The request to update subscriptions needed to be monitored by the NewRelic monitor + * resource. + * @return the next definition stage. + */ + Update withProperties(SubscriptionList properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MonitoredSubscriptionProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MonitoredSubscriptionProperties refresh(Context context); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionPropertiesList.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionPropertiesList.java new file mode 100644 index 0000000000000..b6aba0334b58f --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionPropertiesList.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The MonitoredSubscriptionPropertiesList model. + */ +@Fluent +public final class MonitoredSubscriptionPropertiesList { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of MonitoredSubscriptionPropertiesList class. + */ + public MonitoredSubscriptionPropertiesList() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the MonitoredSubscriptionPropertiesList object itself. + */ + public MonitoredSubscriptionPropertiesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the MonitoredSubscriptionPropertiesList object itself. + */ + public MonitoredSubscriptionPropertiesList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptions.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptions.java new file mode 100644 index 0000000000000..ca59ee5b8b01a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptions.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of MonitoredSubscriptions. + */ +public interface MonitoredSubscriptions { + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName, Context context); + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String monitorName, + ConfigurationName configurationName, Context context); + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ + MonitoredSubscriptionProperties get(String resourceGroupName, String monitorName, + ConfigurationName configurationName); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName, Context context); + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response}. + */ + MonitoredSubscriptionProperties getById(String id); + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MonitoredSubscriptionProperties resource. + * + * @param name resource name. + * @return the first stage of the new MonitoredSubscriptionProperties definition. + */ + MonitoredSubscriptionProperties.DefinitionStages.Blank define(ConfigurationName name); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringStatus.java index 84043394b5be7..fa8ae17da2ddb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringStatus.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Flag specifying if the resource monitoring is enabled or disabled. */ +/** + * Flag specifying if the resource monitoring is enabled or disabled. + */ public final class MonitoringStatus extends ExpandableStringEnum { - /** Static value Enabled for MonitoringStatus. */ + /** + * Static value Enabled for MonitoringStatus. + */ public static final MonitoringStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for MonitoringStatus. */ + /** + * Static value Disabled for MonitoringStatus. + */ public static final MonitoringStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of MonitoringStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public MonitoringStatus() { /** * Creates or finds a MonitoringStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding MonitoringStatus. */ @@ -38,7 +44,7 @@ public static MonitoringStatus fromString(String name) { /** * Gets known MonitoringStatus values. - * + * * @return known MonitoringStatus values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringTagRulesProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringTagRulesProperties.java index 7ce41d44e85c7..594d1455f396e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringTagRulesProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringTagRulesProperties.java @@ -6,25 +6,27 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner; -/** An immutable client-side representation of MonitoringTagRulesProperties. */ +/** + * An immutable client-side representation of MonitoringTagRulesProperties. + */ public interface MonitoringTagRulesProperties { /** * Gets the provisioningState property: Provisioning State of the resource. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @return the logRules value. */ LogRules logRules(); /** * Gets the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @return the metricRules value. */ MetricRules metricRules(); @@ -32,7 +34,7 @@ public interface MonitoringTagRulesProperties { /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner * object. - * + * * @return the inner object. */ MonitoringTagRulesPropertiesInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java index 003c100c04312..726947bd0e70b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java @@ -8,58 +8,60 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Monitors. */ +/** + * Resource collection API of Monitors. + */ public interface Monitors { /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List NewRelicMonitorResource resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List NewRelicMonitorResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link - * PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Get a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -68,12 +70,12 @@ public interface Monitors { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a NewRelicMonitorResource along with {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String monitorName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, + Context context); /** * Get a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -85,7 +87,7 @@ Response getByResourceGroupWithResponse( /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -97,7 +99,7 @@ Response getByResourceGroupWithResponse( /** * Delete a NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param userEmail User Email. * @param monitorName Name of the Monitors resource. @@ -110,7 +112,7 @@ Response getByResourceGroupWithResponse( /** * Get metric rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -120,12 +122,12 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metric rules along with {@link Response}. */ - Response getMetricRulesWithResponse( - String resourceGroupName, String monitorName, MetricsRequest request, Context context); + Response getMetricRulesWithResponse(String resourceGroupName, String monitorName, + MetricsRequest request, Context context); /** * Get metric rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -138,7 +140,7 @@ Response getMetricRulesWithResponse( /** * Get metric status. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -148,12 +150,12 @@ Response getMetricRulesWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metric status along with {@link Response}. */ - Response getMetricStatusWithResponse( - String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context); + Response getMetricStatusWithResponse(String resourceGroupName, String monitorName, + MetricsStatusRequest request, Context context); /** * Get metric status. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the get metrics status request. @@ -166,7 +168,7 @@ Response getMetricStatusWithResponse( /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -175,12 +177,12 @@ Response getMetricStatusWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of a list app services Operation as paginated response with {@link PagedIterable}. */ - PagedIterable listAppServices( - String resourceGroupName, String monitorName, AppServicesGetRequest request); + PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request); /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the app services get request. @@ -190,12 +192,12 @@ PagedIterable listAppServices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of a list app services Operation as paginated response with {@link PagedIterable}. */ - PagedIterable listAppServices( - String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context); + PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context); /** * Switches the billing for NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the switch billing request. @@ -205,12 +207,12 @@ PagedIterable listAppServices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Monitor Resource by NewRelic. */ - Response switchBillingWithResponse( - String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context); + Response switchBillingWithResponse(String resourceGroupName, String monitorName, + SwitchBillingRequest request, Context context); /** * Switches the billing for NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the switch billing request. @@ -223,7 +225,7 @@ Response switchBillingWithResponse( /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. @@ -236,7 +238,7 @@ Response switchBillingWithResponse( /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param request The details of the Hosts get request. @@ -246,40 +248,65 @@ Response switchBillingWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. */ - PagedIterable listHosts( - String resourceGroupName, String monitorName, HostsGetRequest request, Context context); + PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request, + Context context); /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedIterable}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. */ PagedIterable listMonitoredResources(String resourceGroupName, String monitorName); /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedIterable}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. */ - PagedIterable listMonitoredResources( - String resourceGroupName, String monitorName, Context context); + PagedIterable listMonitoredResources(String resourceGroupName, String monitorName, + Context context); + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listLinkedResources(String resourceGroupName, String monitorName); + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listLinkedResources(String resourceGroupName, String monitorName, Context context); /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -288,12 +315,12 @@ PagedIterable listMonitoredResources( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of payload to be passed while installing VM agent along with {@link Response}. */ - Response vmHostPayloadWithResponse( - String resourceGroupName, String monitorName, Context context); + Response vmHostPayloadWithResponse(String resourceGroupName, String monitorName, + Context context); /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -305,7 +332,7 @@ Response vmHostPayloadWithResponse( /** * Get a NewRelicMonitorResource. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -316,7 +343,7 @@ Response vmHostPayloadWithResponse( /** * Get a NewRelicMonitorResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -328,7 +355,7 @@ Response vmHostPayloadWithResponse( /** * Begins definition for a new NewRelicMonitorResource resource. - * + * * @param name resource name. * @return the first stage of the new NewRelicMonitorResource definition. */ diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java index 10dcd94faf923..7f8019b708048 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java @@ -9,7 +9,9 @@ import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; -/** The MonitorsSwitchBillingHeaders model. */ +/** + * The MonitorsSwitchBillingHeaders model. + */ @Fluent public final class MonitorsSwitchBillingHeaders { /* @@ -21,7 +23,7 @@ public final class MonitorsSwitchBillingHeaders { // HttpHeaders containing the raw property values. /** * Creates an instance of MonitorsSwitchBillingHeaders class. - * + * * @param rawHeaders The raw HttpHeaders that will be used to create the property values. */ public MonitorsSwitchBillingHeaders(HttpHeaders rawHeaders) { @@ -33,7 +35,7 @@ public MonitorsSwitchBillingHeaders(HttpHeaders rawHeaders) { /** * Get the retryAfter property: The Retry-After property. - * + * * @return the retryAfter value. */ public Integer retryAfter() { @@ -42,7 +44,7 @@ public Integer retryAfter() { /** * Set the retryAfter property: The Retry-After property. - * + * * @param retryAfter the retryAfter value to set. * @return the MonitorsSwitchBillingHeaders object itself. */ @@ -53,7 +55,7 @@ public MonitorsSwitchBillingHeaders withRetryAfter(Integer retryAfter) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java index cf0db79e8f5f7..90308e08d62ff 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java @@ -9,30 +9,28 @@ import com.azure.core.http.rest.ResponseBase; import com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner; -/** Contains all response data for the switchBilling operation. */ +/** + * Contains all response data for the switchBilling operation. + */ public final class MonitorsSwitchBillingResponse extends ResponseBase { /** * Creates an instance of MonitorsSwitchBillingResponse. - * + * * @param request the request which resulted in this MonitorsSwitchBillingResponse. * @param statusCode the status code of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param value the deserialized value of the HTTP response. * @param headers the deserialized headers of the HTTP response. */ - public MonitorsSwitchBillingResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - NewRelicMonitorResourceInner value, - MonitorsSwitchBillingHeaders headers) { + public MonitorsSwitchBillingResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + NewRelicMonitorResourceInner value, MonitorsSwitchBillingHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } /** * Gets the deserialized response body. - * + * * @return the deserialized response body. */ @Override diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicAccountProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicAccountProperties.java index 9957e06e3b0d8..d8fcad01865bf 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicAccountProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicAccountProperties.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Properties of the NewRelic account. */ +/** + * Properties of the NewRelic account. + */ @Fluent public final class NewRelicAccountProperties { /* @@ -34,13 +36,15 @@ public final class NewRelicAccountProperties { @JsonProperty(value = "singleSignOnProperties") private NewRelicSingleSignOnProperties singleSignOnProperties; - /** Creates an instance of NewRelicAccountProperties class. */ + /** + * Creates an instance of NewRelicAccountProperties class. + */ public NewRelicAccountProperties() { } /** * Get the userId property: User id. - * + * * @return the userId value. */ public String userId() { @@ -49,7 +53,7 @@ public String userId() { /** * Set the userId property: User id. - * + * * @param userId the userId value to set. * @return the NewRelicAccountProperties object itself. */ @@ -60,7 +64,7 @@ public NewRelicAccountProperties withUserId(String userId) { /** * Get the accountInfo property: NewRelic Account Information. - * + * * @return the accountInfo value. */ public AccountInfo accountInfo() { @@ -69,7 +73,7 @@ public AccountInfo accountInfo() { /** * Set the accountInfo property: NewRelic Account Information. - * + * * @param accountInfo the accountInfo value to set. * @return the NewRelicAccountProperties object itself. */ @@ -80,7 +84,7 @@ public NewRelicAccountProperties withAccountInfo(AccountInfo accountInfo) { /** * Get the organizationInfo property: NewRelic Organization Information. - * + * * @return the organizationInfo value. */ public OrganizationInfo organizationInfo() { @@ -89,7 +93,7 @@ public OrganizationInfo organizationInfo() { /** * Set the organizationInfo property: NewRelic Organization Information. - * + * * @param organizationInfo the organizationInfo value to set. * @return the NewRelicAccountProperties object itself. */ @@ -100,7 +104,7 @@ public NewRelicAccountProperties withOrganizationInfo(OrganizationInfo organizat /** * Get the singleSignOnProperties property: date when plan was applied. - * + * * @return the singleSignOnProperties value. */ public NewRelicSingleSignOnProperties singleSignOnProperties() { @@ -109,7 +113,7 @@ public NewRelicSingleSignOnProperties singleSignOnProperties() { /** * Set the singleSignOnProperties property: date when plan was applied. - * + * * @param singleSignOnProperties the singleSignOnProperties value to set. * @return the NewRelicAccountProperties object itself. */ @@ -120,7 +124,7 @@ public NewRelicAccountProperties withSingleSignOnProperties(NewRelicSingleSignOn /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java index 3359f02510db4..2ee32c6ed8c67 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java @@ -12,179 +12,202 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner; import java.util.Map; -/** An immutable client-side representation of NewRelicMonitorResource. */ +/** + * An immutable client-side representation of NewRelicMonitorResource. + */ public interface NewRelicMonitorResource { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the identity property: The managed service identities assigned to this resource. - * + * * @return the identity value. */ ManagedServiceIdentity identity(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the provisioningState property: Provisioning State of the resource. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the monitoringStatus property: MonitoringStatus of the resource. - * + * * @return the monitoringStatus value. */ MonitoringStatus monitoringStatus(); /** * Gets the marketplaceSubscriptionStatus property: NewRelic Organization properties of the resource. - * + * * @return the marketplaceSubscriptionStatus value. */ MarketplaceSubscriptionStatus marketplaceSubscriptionStatus(); /** * Gets the marketplaceSubscriptionId property: Marketplace Subscription Id. - * + * * @return the marketplaceSubscriptionId value. */ String marketplaceSubscriptionId(); /** * Gets the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @return the newRelicAccountProperties value. */ NewRelicAccountProperties newRelicAccountProperties(); /** * Gets the userInfo property: User Info. - * + * * @return the userInfo value. */ UserInfo userInfo(); /** * Gets the planData property: Plan details. - * + * * @return the planData value. */ PlanData planData(); /** * Gets the liftrResourceCategory property: Liftr resource category. - * + * * @return the liftrResourceCategory value. */ LiftrResourceCategories liftrResourceCategory(); /** * Gets the liftrResourcePreference property: Liftr resource preference. The priority of the resource. - * + * * @return the liftrResourcePreference value. */ Integer liftrResourcePreference(); /** * Gets the orgCreationSource property: Source of org creation. - * + * * @return the orgCreationSource value. */ OrgCreationSource orgCreationSource(); /** * Gets the accountCreationSource property: Source of account creation. - * + * * @return the accountCreationSource value. */ AccountCreationSource accountCreationSource(); + /** + * Gets the subscriptionState property: State of the Azure Subscription containing the monitor resource. + * + * @return the subscriptionState value. + */ + String subscriptionState(); + + /** + * Gets the saaSAzureSubscriptionStatus property: Status of Azure Subscription where Marketplace SaaS is located. + * + * @return the saaSAzureSubscriptionStatus value. + */ + String saaSAzureSubscriptionStatus(); + /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner object. - * + * * @return the inner object. */ NewRelicMonitorResourceInner innerModel(); - /** The entirety of the NewRelicMonitorResource definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + /** + * The entirety of the NewRelicMonitorResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The NewRelicMonitorResource definition stages. */ + + /** + * The NewRelicMonitorResource definition stages. + */ interface DefinitionStages { - /** The first stage of the NewRelicMonitorResource definition. */ + /** + * The first stage of the NewRelicMonitorResource definition. + */ interface Blank extends WithLocation { } - /** The stage of the NewRelicMonitorResource definition allowing to specify location. */ + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -192,234 +215,306 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the NewRelicMonitorResource definition allowing to specify parent resource. */ + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the NewRelicMonitorResource definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithNewRelicAccountProperties, - DefinitionStages.WithUserInfo, - DefinitionStages.WithPlanData, - DefinitionStages.WithOrgCreationSource, - DefinitionStages.WithAccountCreationSource { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithNewRelicAccountProperties, DefinitionStages.WithUserInfo, + DefinitionStages.WithPlanData, DefinitionStages.WithOrgCreationSource, + DefinitionStages.WithAccountCreationSource, DefinitionStages.WithSubscriptionState, + DefinitionStages.WithSaaSAzureSubscriptionStatus { /** * Executes the create request. - * + * * @return the created resource. */ NewRelicMonitorResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ NewRelicMonitorResource create(Context context); } - /** The stage of the NewRelicMonitorResource definition allowing to specify tags. */ + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the NewRelicMonitorResource definition allowing to specify identity. */ + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The managed service identities assigned to this resource.. - * + * * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } - /** The stage of the NewRelicMonitorResource definition allowing to specify newRelicAccountProperties. */ + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify newRelicAccountProperties. + */ interface WithNewRelicAccountProperties { /** * Specifies the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @param newRelicAccountProperties MarketplaceSubscriptionStatus of the resource. * @return the next definition stage. */ WithCreate withNewRelicAccountProperties(NewRelicAccountProperties newRelicAccountProperties); } - /** The stage of the NewRelicMonitorResource definition allowing to specify userInfo. */ + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify userInfo. + */ interface WithUserInfo { /** * Specifies the userInfo property: User Info. - * + * * @param userInfo User Info. * @return the next definition stage. */ WithCreate withUserInfo(UserInfo userInfo); } - /** The stage of the NewRelicMonitorResource definition allowing to specify planData. */ + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify planData. + */ interface WithPlanData { /** * Specifies the planData property: Plan details. - * + * * @param planData Plan details. * @return the next definition stage. */ WithCreate withPlanData(PlanData planData); } - /** The stage of the NewRelicMonitorResource definition allowing to specify orgCreationSource. */ + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify orgCreationSource. + */ interface WithOrgCreationSource { /** * Specifies the orgCreationSource property: Source of org creation. - * + * * @param orgCreationSource Source of org creation. * @return the next definition stage. */ WithCreate withOrgCreationSource(OrgCreationSource orgCreationSource); } - /** The stage of the NewRelicMonitorResource definition allowing to specify accountCreationSource. */ + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify accountCreationSource. + */ interface WithAccountCreationSource { /** * Specifies the accountCreationSource property: Source of account creation. - * + * * @param accountCreationSource Source of account creation. * @return the next definition stage. */ WithCreate withAccountCreationSource(AccountCreationSource accountCreationSource); } + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify subscriptionState. + */ + interface WithSubscriptionState { + /** + * Specifies the subscriptionState property: State of the Azure Subscription containing the monitor + * resource. + * + * @param subscriptionState State of the Azure Subscription containing the monitor resource. + * @return the next definition stage. + */ + WithCreate withSubscriptionState(String subscriptionState); + } + + /** + * The stage of the NewRelicMonitorResource definition allowing to specify saaSAzureSubscriptionStatus. + */ + interface WithSaaSAzureSubscriptionStatus { + /** + * Specifies the saaSAzureSubscriptionStatus property: Status of Azure Subscription where Marketplace SaaS + * is located.. + * + * @param saaSAzureSubscriptionStatus Status of Azure Subscription where Marketplace SaaS is located. + * @return the next definition stage. + */ + WithCreate withSaaSAzureSubscriptionStatus(String saaSAzureSubscriptionStatus); + } } + /** * Begins update for the NewRelicMonitorResource resource. - * + * * @return the stage of resource update. */ NewRelicMonitorResource.Update update(); - /** The template for NewRelicMonitorResource update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithIdentity, - UpdateStages.WithNewRelicAccountProperties, - UpdateStages.WithUserInfo, - UpdateStages.WithPlanData, - UpdateStages.WithOrgCreationSource, - UpdateStages.WithAccountCreationSource { + /** + * The template for NewRelicMonitorResource update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, + UpdateStages.WithNewRelicAccountProperties, UpdateStages.WithUserInfo, UpdateStages.WithPlanData, + UpdateStages.WithOrgCreationSource, UpdateStages.WithAccountCreationSource { /** * Executes the update request. - * + * * @return the updated resource. */ NewRelicMonitorResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ NewRelicMonitorResource apply(Context context); } - /** The NewRelicMonitorResource update stages. */ + + /** + * The NewRelicMonitorResource update stages. + */ interface UpdateStages { - /** The stage of the NewRelicMonitorResource update allowing to specify tags. */ + /** + * The stage of the NewRelicMonitorResource update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the NewRelicMonitorResource update allowing to specify identity. */ + + /** + * The stage of the NewRelicMonitorResource update allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The managed service identities assigned to this resource.. - * + * * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ Update withIdentity(ManagedServiceIdentity identity); } - /** The stage of the NewRelicMonitorResource update allowing to specify newRelicAccountProperties. */ + + /** + * The stage of the NewRelicMonitorResource update allowing to specify newRelicAccountProperties. + */ interface WithNewRelicAccountProperties { /** * Specifies the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @param newRelicAccountProperties MarketplaceSubscriptionStatus of the resource. * @return the next definition stage. */ Update withNewRelicAccountProperties(NewRelicAccountProperties newRelicAccountProperties); } - /** The stage of the NewRelicMonitorResource update allowing to specify userInfo. */ + + /** + * The stage of the NewRelicMonitorResource update allowing to specify userInfo. + */ interface WithUserInfo { /** * Specifies the userInfo property: User Info. - * + * * @param userInfo User Info. * @return the next definition stage. */ Update withUserInfo(UserInfo userInfo); } - /** The stage of the NewRelicMonitorResource update allowing to specify planData. */ + + /** + * The stage of the NewRelicMonitorResource update allowing to specify planData. + */ interface WithPlanData { /** * Specifies the planData property: Plan details. - * + * * @param planData Plan details. * @return the next definition stage. */ Update withPlanData(PlanData planData); } - /** The stage of the NewRelicMonitorResource update allowing to specify orgCreationSource. */ + + /** + * The stage of the NewRelicMonitorResource update allowing to specify orgCreationSource. + */ interface WithOrgCreationSource { /** * Specifies the orgCreationSource property: Source of org creation. - * + * * @param orgCreationSource Source of org creation. * @return the next definition stage. */ Update withOrgCreationSource(OrgCreationSource orgCreationSource); } - /** The stage of the NewRelicMonitorResource update allowing to specify accountCreationSource. */ + + /** + * The stage of the NewRelicMonitorResource update allowing to specify accountCreationSource. + */ interface WithAccountCreationSource { /** * Specifies the accountCreationSource property: Source of account creation. - * + * * @param accountCreationSource Source of account creation. * @return the next definition stage. */ Update withAccountCreationSource(AccountCreationSource accountCreationSource); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ NewRelicMonitorResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -427,7 +522,7 @@ interface WithAccountCreationSource { /** * Get metric rules. - * + * * @param request The details of the get metrics status request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -439,7 +534,7 @@ interface WithAccountCreationSource { /** * Get metric rules. - * + * * @param request The details of the get metrics status request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -450,7 +545,7 @@ interface WithAccountCreationSource { /** * Get metric status. - * + * * @param request The details of the get metrics status request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -462,7 +557,7 @@ interface WithAccountCreationSource { /** * Get metric status. - * + * * @param request The details of the get metrics status request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -473,7 +568,7 @@ interface WithAccountCreationSource { /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param request The details of the app services get request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -484,7 +579,7 @@ interface WithAccountCreationSource { /** * List the app service resources currently being monitored by the NewRelic resource. - * + * * @param request The details of the app services get request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -496,7 +591,7 @@ interface WithAccountCreationSource { /** * Switches the billing for NewRelic monitor resource. - * + * * @param request The details of the switch billing request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -508,7 +603,7 @@ interface WithAccountCreationSource { /** * Switches the billing for NewRelic monitor resource. - * + * * @param request The details of the switch billing request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -519,7 +614,7 @@ interface WithAccountCreationSource { /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param request The details of the Hosts get request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -530,7 +625,7 @@ interface WithAccountCreationSource { /** * List the compute vm resources currently being monitored by the NewRelic resource. - * + * * @param request The details of the Hosts get request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -542,29 +637,49 @@ interface WithAccountCreationSource { /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedIterable}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. */ PagedIterable listMonitoredResources(); /** * List the resources currently being monitored by the NewRelic monitor resource. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link - * PagedIterable}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. */ PagedIterable listMonitoredResources(Context context); + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listLinkedResources(); + + /** + * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listLinkedResources(Context context); + /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -575,7 +690,7 @@ interface WithAccountCreationSource { /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of payload to be passed while installing VM agent. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceListResult.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceListResult.java index 8456cc9e70990..c98892305a9eb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceListResult.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a NewRelicMonitorResource list operation. */ +/** + * The response of a NewRelicMonitorResource list operation. + */ @Fluent public final class NewRelicMonitorResourceListResult { /* @@ -25,13 +27,15 @@ public final class NewRelicMonitorResourceListResult { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of NewRelicMonitorResourceListResult class. */ + /** + * Creates an instance of NewRelicMonitorResourceListResult class. + */ public NewRelicMonitorResourceListResult() { } /** * Get the value property: The NewRelicMonitorResource items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The NewRelicMonitorResource items on this page. - * + * * @param value the value value to set. * @return the NewRelicMonitorResourceListResult object itself. */ @@ -51,7 +55,7 @@ public NewRelicMonitorResourceListResult withValue(List e.validate()); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceUpdate.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceUpdate.java index 7d1a305813433..116d814f188e9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceUpdate.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceUpdate.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The type used for update operations of the NewRelicMonitorResource. */ +/** + * The type used for update operations of the NewRelicMonitorResource. + */ @Fluent public final class NewRelicMonitorResourceUpdate { /* @@ -32,13 +34,15 @@ public final class NewRelicMonitorResourceUpdate { @JsonProperty(value = "properties") private NewRelicMonitorResourceUpdateProperties innerProperties; - /** Creates an instance of NewRelicMonitorResourceUpdate class. */ + /** + * Creates an instance of NewRelicMonitorResourceUpdate class. + */ public NewRelicMonitorResourceUpdate() { } /** * Get the identity property: The managed service identities assigned to this resource. - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -47,7 +51,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: The managed service identities assigned to this resource. - * + * * @param identity the identity value to set. * @return the NewRelicMonitorResourceUpdate object itself. */ @@ -58,7 +62,7 @@ public NewRelicMonitorResourceUpdate withIdentity(ManagedServiceIdentity identit /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -67,7 +71,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the NewRelicMonitorResourceUpdate object itself. */ @@ -78,7 +82,7 @@ public NewRelicMonitorResourceUpdate withTags(Map tags) { /** * Get the innerProperties property: The updatable properties of the NewRelicMonitorResource. - * + * * @return the innerProperties value. */ private NewRelicMonitorResourceUpdateProperties innerProperties() { @@ -87,7 +91,7 @@ private NewRelicMonitorResourceUpdateProperties innerProperties() { /** * Get the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @return the newRelicAccountProperties value. */ public NewRelicAccountProperties newRelicAccountProperties() { @@ -96,12 +100,12 @@ public NewRelicAccountProperties newRelicAccountProperties() { /** * Set the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource. - * + * * @param newRelicAccountProperties the newRelicAccountProperties value to set. * @return the NewRelicMonitorResourceUpdate object itself. */ - public NewRelicMonitorResourceUpdate withNewRelicAccountProperties( - NewRelicAccountProperties newRelicAccountProperties) { + public NewRelicMonitorResourceUpdate + withNewRelicAccountProperties(NewRelicAccountProperties newRelicAccountProperties) { if (this.innerProperties() == null) { this.innerProperties = new NewRelicMonitorResourceUpdateProperties(); } @@ -111,7 +115,7 @@ public NewRelicMonitorResourceUpdate withNewRelicAccountProperties( /** * Get the userInfo property: User Info. - * + * * @return the userInfo value. */ public UserInfo userInfo() { @@ -120,7 +124,7 @@ public UserInfo userInfo() { /** * Set the userInfo property: User Info. - * + * * @param userInfo the userInfo value to set. * @return the NewRelicMonitorResourceUpdate object itself. */ @@ -134,7 +138,7 @@ public NewRelicMonitorResourceUpdate withUserInfo(UserInfo userInfo) { /** * Get the planData property: Plan details. - * + * * @return the planData value. */ public PlanData planData() { @@ -143,7 +147,7 @@ public PlanData planData() { /** * Set the planData property: Plan details. - * + * * @param planData the planData value to set. * @return the NewRelicMonitorResourceUpdate object itself. */ @@ -157,7 +161,7 @@ public NewRelicMonitorResourceUpdate withPlanData(PlanData planData) { /** * Get the orgCreationSource property: Source of org creation. - * + * * @return the orgCreationSource value. */ public OrgCreationSource orgCreationSource() { @@ -166,7 +170,7 @@ public OrgCreationSource orgCreationSource() { /** * Set the orgCreationSource property: Source of org creation. - * + * * @param orgCreationSource the orgCreationSource value to set. * @return the NewRelicMonitorResourceUpdate object itself. */ @@ -180,7 +184,7 @@ public NewRelicMonitorResourceUpdate withOrgCreationSource(OrgCreationSource org /** * Get the accountCreationSource property: Source of account creation. - * + * * @return the accountCreationSource value. */ public AccountCreationSource accountCreationSource() { @@ -189,7 +193,7 @@ public AccountCreationSource accountCreationSource() { /** * Set the accountCreationSource property: Source of account creation. - * + * * @param accountCreationSource the accountCreationSource value to set. * @return the NewRelicMonitorResourceUpdate object itself. */ @@ -203,7 +207,7 @@ public NewRelicMonitorResourceUpdate withAccountCreationSource(AccountCreationSo /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicSingleSignOnProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicSingleSignOnProperties.java index fb76f04353517..9ec3bb2746efe 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicSingleSignOnProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicSingleSignOnProperties.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Single sign on Info of the NewRelic account. */ +/** + * Single sign on Info of the NewRelic account. + */ @Fluent public final class NewRelicSingleSignOnProperties { /* @@ -34,13 +36,15 @@ public final class NewRelicSingleSignOnProperties { @JsonProperty(value = "provisioningState") private ProvisioningState provisioningState; - /** Creates an instance of NewRelicSingleSignOnProperties class. */ + /** + * Creates an instance of NewRelicSingleSignOnProperties class. + */ public NewRelicSingleSignOnProperties() { } /** * Get the singleSignOnState property: Single sign-on state. - * + * * @return the singleSignOnState value. */ public SingleSignOnStates singleSignOnState() { @@ -49,7 +53,7 @@ public SingleSignOnStates singleSignOnState() { /** * Set the singleSignOnState property: Single sign-on state. - * + * * @param singleSignOnState the singleSignOnState value to set. * @return the NewRelicSingleSignOnProperties object itself. */ @@ -60,7 +64,7 @@ public NewRelicSingleSignOnProperties withSingleSignOnState(SingleSignOnStates s /** * Get the enterpriseAppId property: The Id of the Enterprise App used for Single sign-on. - * + * * @return the enterpriseAppId value. */ public String enterpriseAppId() { @@ -69,7 +73,7 @@ public String enterpriseAppId() { /** * Set the enterpriseAppId property: The Id of the Enterprise App used for Single sign-on. - * + * * @param enterpriseAppId the enterpriseAppId value to set. * @return the NewRelicSingleSignOnProperties object itself. */ @@ -80,7 +84,7 @@ public NewRelicSingleSignOnProperties withEnterpriseAppId(String enterpriseAppId /** * Get the singleSignOnUrl property: The login URL specific to this NewRelic Organization. - * + * * @return the singleSignOnUrl value. */ public String singleSignOnUrl() { @@ -89,7 +93,7 @@ public String singleSignOnUrl() { /** * Set the singleSignOnUrl property: The login URL specific to this NewRelic Organization. - * + * * @param singleSignOnUrl the singleSignOnUrl value to set. * @return the NewRelicSingleSignOnProperties object itself. */ @@ -100,7 +104,7 @@ public NewRelicSingleSignOnProperties withSingleSignOnUrl(String singleSignOnUrl /** * Get the provisioningState property: Provisioning state. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -109,7 +113,7 @@ public ProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state. - * + * * @param provisioningState the provisioningState value to set. * @return the NewRelicSingleSignOnProperties object itself. */ @@ -120,7 +124,7 @@ public NewRelicSingleSignOnProperties withProvisioningState(ProvisioningState pr /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Operation.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Operation.java index 4e0bc20729565..cadeca2fca19a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Operation.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Operation.java @@ -6,12 +6,14 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ String name(); @@ -19,14 +21,14 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the display property: Localized display information for this particular operation. - * + * * @return the display value. */ OperationDisplay display(); @@ -34,7 +36,7 @@ public interface Operation { /** * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ Origin origin(); @@ -42,14 +44,14 @@ public interface Operation { /** * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ ActionType actionType(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationDisplay.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationDisplay.java index 1a883f178bdfe..72fab579594c3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationDisplay.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationDisplay.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Localized display information for this particular operation. */ +/** + * Localized display information for this particular operation. + */ @Immutable public final class OperationDisplay { /* @@ -37,14 +39,16 @@ public final class OperationDisplay { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; - /** Creates an instance of OperationDisplay class. */ + /** + * Creates an instance of OperationDisplay class. + */ public OperationDisplay() { } /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". - * + * * @return the provider value. */ public String provider() { @@ -54,7 +58,7 @@ public String provider() { /** * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. * "Virtual Machines" or "Job Schedule Collections". - * + * * @return the resource value. */ public String resource() { @@ -64,7 +68,7 @@ public String resource() { /** * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. * "Create or Update Virtual Machine", "Restart Virtual Machine". - * + * * @return the operation value. */ public String operation() { @@ -74,7 +78,7 @@ public String operation() { /** * Get the description property: The short, localized friendly description of the operation; suitable for tool tips * and detailed views. - * + * * @return the description value. */ public String description() { @@ -83,7 +87,7 @@ public String description() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationListResult.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationListResult.java index 22e5c76da7911..13c7b8937074c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationListResult.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationListResult.java @@ -10,8 +10,8 @@ import java.util.List; /** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set + * of results. */ @Immutable public final class OperationListResult { @@ -27,13 +27,15 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of OperationListResult class. */ + /** + * Creates an instance of OperationListResult class. + */ public OperationListResult() { } /** * Get the value property: List of operations supported by the resource provider. - * + * * @return the value value. */ public List value() { @@ -42,7 +44,7 @@ public List value() { /** * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * + * * @return the nextLink value. */ public String nextLink() { @@ -51,7 +53,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Operations.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Operations.java index d6f787c73e1a0..684a32ff85cb9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Operations.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Operations.java @@ -7,27 +7,29 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * List the operations for the provider. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrgCreationSource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrgCreationSource.java index 7c4a4fa0fc60a..074728fd70d8d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrgCreationSource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrgCreationSource.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Source of Org creation. */ +/** + * Source of Org creation. + */ public final class OrgCreationSource extends ExpandableStringEnum { - /** Static value LIFTR for OrgCreationSource. */ + /** + * Static value LIFTR for OrgCreationSource. + */ public static final OrgCreationSource LIFTR = fromString("LIFTR"); - /** Static value NEWRELIC for OrgCreationSource. */ + /** + * Static value NEWRELIC for OrgCreationSource. + */ public static final OrgCreationSource NEWRELIC = fromString("NEWRELIC"); /** * Creates a new instance of OrgCreationSource value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public OrgCreationSource() { /** * Creates or finds a OrgCreationSource from its string representation. - * + * * @param name a name to look for. * @return the corresponding OrgCreationSource. */ @@ -38,7 +44,7 @@ public static OrgCreationSource fromString(String name) { /** * Gets known OrgCreationSource values. - * + * * @return known OrgCreationSource values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationInfo.java index 4e55b4ebcf9ff..cd90e5b41d964 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationInfo.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationInfo.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Organization Info of the NewRelic account. */ +/** + * Organization Info of the NewRelic account. + */ @Fluent public final class OrganizationInfo { /* @@ -16,13 +18,15 @@ public final class OrganizationInfo { @JsonProperty(value = "organizationId") private String organizationId; - /** Creates an instance of OrganizationInfo class. */ + /** + * Creates an instance of OrganizationInfo class. + */ public OrganizationInfo() { } /** * Get the organizationId property: Organization id. - * + * * @return the organizationId value. */ public String organizationId() { @@ -31,7 +35,7 @@ public String organizationId() { /** * Set the organizationId property: Organization id. - * + * * @param organizationId the organizationId value to set. * @return the OrganizationInfo object itself. */ @@ -42,7 +46,7 @@ public OrganizationInfo withOrganizationId(String organizationId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationResource.java index 05e6bb377c641..404d3bf67a8d9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationResource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationResource.java @@ -7,60 +7,62 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner; -/** An immutable client-side representation of OrganizationResource. */ +/** + * An immutable client-side representation of OrganizationResource. + */ public interface OrganizationResource { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the organizationId property: organization id. - * + * * @return the organizationId value. */ String organizationId(); /** * Gets the organizationName property: organization name. - * + * * @return the organizationName value. */ String organizationName(); /** * Gets the billingSource property: Billing source. - * + * * @return the billingSource value. */ BillingSource billingSource(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner object. - * + * * @return the inner object. */ OrganizationResourceInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Organizations.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Organizations.java index bd2e6d2483f5f..691a8c4b7900d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Organizations.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Organizations.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Organizations. */ +/** + * Resource collection API of Organizations. + */ public interface Organizations { /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -23,7 +25,7 @@ public interface Organizations { /** * List all the existing organizations. - * + * * @param userEmail User Email. * @param location Location for NewRelic. * @param context The context to associate with this operation. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationsListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationsListResponse.java index 489abe9dec3a5..e46061fe6a60d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationsListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationsListResponse.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response of get all organizations Operation. */ +/** + * Response of get all organizations Operation. + */ @Fluent public final class OrganizationsListResponse { /* @@ -25,13 +27,15 @@ public final class OrganizationsListResponse { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of OrganizationsListResponse class. */ + /** + * Creates an instance of OrganizationsListResponse class. + */ public OrganizationsListResponse() { } /** * Get the value property: The OrganizationResource items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The OrganizationResource items on this page. - * + * * @param value the value value to set. * @return the OrganizationsListResponse object itself. */ @@ -51,7 +55,7 @@ public OrganizationsListResponse withValue(List value /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +64,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of items. - * + * * @param nextLink the nextLink value to set. * @return the OrganizationsListResponse object itself. */ @@ -71,14 +75,13 @@ public OrganizationsListResponse withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model OrganizationsListResponse")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model OrganizationsListResponse")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Origin.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Origin.java index fa768b1775524..2d78da40d07b9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Origin.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Origin.java @@ -13,18 +13,24 @@ * is "user,system". */ public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ + /** + * Static value user for Origin. + */ public static final Origin USER = fromString("user"); - /** Static value system for Origin. */ + /** + * Static value system for Origin. + */ public static final Origin SYSTEM = fromString("system"); - /** Static value user,system for Origin. */ + /** + * Static value user,system for Origin. + */ public static final Origin USER_SYSTEM = fromString("user,system"); /** * Creates a new instance of Origin value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,7 +39,7 @@ public Origin() { /** * Creates or finds a Origin from its string representation. - * + * * @param name a name to look for. * @return the corresponding Origin. */ @@ -44,7 +50,7 @@ public static Origin fromString(String name) { /** * Gets known Origin values. - * + * * @return known Origin values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PartnerBillingEntity.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PartnerBillingEntity.java new file mode 100644 index 0000000000000..2c1296363c5a8 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PartnerBillingEntity.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Partner Billing details associated with the resource. + */ +@Fluent +public final class PartnerBillingEntity { + /* + * The New Relic Organization Id. + */ + @JsonProperty(value = "organizationId") + private String organizationId; + + /* + * The New Relic Organization Name. + */ + @JsonProperty(value = "organizationName") + private String organizationName; + + /** + * Creates an instance of PartnerBillingEntity class. + */ + public PartnerBillingEntity() { + } + + /** + * Get the organizationId property: The New Relic Organization Id. + * + * @return the organizationId value. + */ + public String organizationId() { + return this.organizationId; + } + + /** + * Set the organizationId property: The New Relic Organization Id. + * + * @param organizationId the organizationId value to set. + * @return the PartnerBillingEntity object itself. + */ + public PartnerBillingEntity withOrganizationId(String organizationId) { + this.organizationId = organizationId; + return this; + } + + /** + * Get the organizationName property: The New Relic Organization Name. + * + * @return the organizationName value. + */ + public String organizationName() { + return this.organizationName; + } + + /** + * Set the organizationName property: The New Relic Organization Name. + * + * @param organizationName the organizationName value to set. + * @return the PartnerBillingEntity object itself. + */ + public PartnerBillingEntity withOrganizationName(String organizationName) { + this.organizationName = organizationName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PatchOperation.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PatchOperation.java new file mode 100644 index 0000000000000..cae070e9070a1 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PatchOperation.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The operation for the patch on the resource. + */ +public final class PatchOperation extends ExpandableStringEnum { + /** + * Static value AddBegin for PatchOperation. + */ + public static final PatchOperation ADD_BEGIN = fromString("AddBegin"); + + /** + * Static value AddComplete for PatchOperation. + */ + public static final PatchOperation ADD_COMPLETE = fromString("AddComplete"); + + /** + * Static value DeleteBegin for PatchOperation. + */ + public static final PatchOperation DELETE_BEGIN = fromString("DeleteBegin"); + + /** + * Static value DeleteComplete for PatchOperation. + */ + public static final PatchOperation DELETE_COMPLETE = fromString("DeleteComplete"); + + /** + * Static value Active for PatchOperation. + */ + public static final PatchOperation ACTIVE = fromString("Active"); + + /** + * Creates a new instance of PatchOperation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchOperation() { + } + + /** + * Creates or finds a PatchOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchOperation. + */ + @JsonCreator + public static PatchOperation fromString(String name) { + return fromString(name, PatchOperation.class); + } + + /** + * Gets known PatchOperation values. + * + * @return known PatchOperation values. + */ + public static Collection values() { + return values(PatchOperation.class); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanData.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanData.java index 1317958829e1a..4d79b71569478 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanData.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanData.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Plan data of NewRelic Monitor resource. */ +/** + * Plan data of NewRelic Monitor resource. + */ @Fluent public final class PlanData { /* @@ -35,13 +37,15 @@ public final class PlanData { @JsonProperty(value = "effectiveDate") private OffsetDateTime effectiveDate; - /** Creates an instance of PlanData class. */ + /** + * Creates an instance of PlanData class. + */ public PlanData() { } /** * Get the usageType property: Different usage type like PAYG/COMMITTED. this could be enum. - * + * * @return the usageType value. */ public UsageType usageType() { @@ -50,7 +54,7 @@ public UsageType usageType() { /** * Set the usageType property: Different usage type like PAYG/COMMITTED. this could be enum. - * + * * @param usageType the usageType value to set. * @return the PlanData object itself. */ @@ -61,7 +65,7 @@ public PlanData withUsageType(UsageType usageType) { /** * Get the billingCycle property: Different billing cycles like MONTHLY/WEEKLY. this could be enum. - * + * * @return the billingCycle value. */ public BillingCycle billingCycle() { @@ -70,7 +74,7 @@ public BillingCycle billingCycle() { /** * Set the billingCycle property: Different billing cycles like MONTHLY/WEEKLY. this could be enum. - * + * * @param billingCycle the billingCycle value to set. * @return the PlanData object itself. */ @@ -81,7 +85,7 @@ public PlanData withBillingCycle(BillingCycle billingCycle) { /** * Get the planDetails property: plan id as published by NewRelic. - * + * * @return the planDetails value. */ public String planDetails() { @@ -90,7 +94,7 @@ public String planDetails() { /** * Set the planDetails property: plan id as published by NewRelic. - * + * * @param planDetails the planDetails value to set. * @return the PlanData object itself. */ @@ -101,7 +105,7 @@ public PlanData withPlanDetails(String planDetails) { /** * Get the effectiveDate property: date when plan was applied. - * + * * @return the effectiveDate value. */ public OffsetDateTime effectiveDate() { @@ -110,7 +114,7 @@ public OffsetDateTime effectiveDate() { /** * Set the effectiveDate property: date when plan was applied. - * + * * @param effectiveDate the effectiveDate value to set. * @return the PlanData object itself. */ @@ -121,7 +125,7 @@ public PlanData withEffectiveDate(OffsetDateTime effectiveDate) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataListResponse.java index 250d852597fe0..d2dda05c88b09 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataListResponse.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response of get all plan data Operation. */ +/** + * Response of get all plan data Operation. + */ @Fluent public final class PlanDataListResponse { /* @@ -25,13 +27,15 @@ public final class PlanDataListResponse { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of PlanDataListResponse class. */ + /** + * Creates an instance of PlanDataListResponse class. + */ public PlanDataListResponse() { } /** * Get the value property: The PlanDataResource items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The PlanDataResource items on this page. - * + * * @param value the value value to set. * @return the PlanDataListResponse object itself. */ @@ -51,7 +55,7 @@ public PlanDataListResponse withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +64,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of items. - * + * * @param nextLink the nextLink value to set. * @return the PlanDataListResponse object itself. */ @@ -71,14 +75,13 @@ public PlanDataListResponse withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model PlanDataListResponse")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model PlanDataListResponse")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataResource.java index 9082254c41831..6eeb165eb3a9c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataResource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataResource.java @@ -7,60 +7,62 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner; -/** An immutable client-side representation of PlanDataResource. */ +/** + * An immutable client-side representation of PlanDataResource. + */ public interface PlanDataResource { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the planData property: Plan details. - * + * * @return the planData value. */ PlanData planData(); /** * Gets the orgCreationSource property: Source of org creation. - * + * * @return the orgCreationSource value. */ OrgCreationSource orgCreationSource(); /** * Gets the accountCreationSource property: Source of account creation. - * + * * @return the accountCreationSource value. */ AccountCreationSource accountCreationSource(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner object. - * + * * @return the inner object. */ PlanDataResourceInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Plans.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Plans.java index 37ec8e453fc3f..bc1920e6e8c88 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Plans.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Plans.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Plans. */ +/** + * Resource collection API of Plans. + */ public interface Plans { /** * List plans data. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response of get all plan data Operation as paginated response with {@link PagedIterable}. @@ -20,7 +22,7 @@ public interface Plans { /** * List plans data. - * + * * @param accountId Account Id. * @param organizationId Organization Id. * @param context The context to associate with this operation. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ProvisioningState.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ProvisioningState.java index 067bc104a45ca..de7d9b599c2b7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ProvisioningState.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ProvisioningState.java @@ -8,38 +8,58 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Provisioning State of the Monitor resource. */ +/** + * Provisioning State of the Monitor resource. + */ public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Accepted for ProvisioningState. */ + /** + * Static value Accepted for ProvisioningState. + */ public static final ProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value Creating for ProvisioningState. */ + /** + * Static value Creating for ProvisioningState. + */ public static final ProvisioningState CREATING = fromString("Creating"); - /** Static value Updating for ProvisioningState. */ + /** + * Static value Updating for ProvisioningState. + */ public static final ProvisioningState UPDATING = fromString("Updating"); - /** Static value Deleting for ProvisioningState. */ + /** + * Static value Deleting for ProvisioningState. + */ public static final ProvisioningState DELETING = fromString("Deleting"); - /** Static value Succeeded for ProvisioningState. */ + /** + * Static value Succeeded for ProvisioningState. + */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ProvisioningState. */ + /** + * Static value Failed for ProvisioningState. + */ public static final ProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ProvisioningState. */ + /** + * Static value Canceled for ProvisioningState. + */ public static final ProvisioningState CANCELED = fromString("Canceled"); - /** Static value Deleted for ProvisioningState. */ + /** + * Static value Deleted for ProvisioningState. + */ public static final ProvisioningState DELETED = fromString("Deleted"); - /** Static value NotSpecified for ProvisioningState. */ + /** + * Static value NotSpecified for ProvisioningState. + */ public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); /** * Creates a new instance of ProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -48,7 +68,7 @@ public ProvisioningState() { /** * Creates or finds a ProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningState. */ @@ -59,7 +79,7 @@ public static ProvisioningState fromString(String name) { /** * Gets known ProvisioningState values. - * + * * @return known ProvisioningState values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendAadLogsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendAadLogsStatus.java index d5597533b8603..ee4878c00331e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendAadLogsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendAadLogsStatus.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Indicates whether AAD logs are being sent. */ +/** + * Indicates whether AAD logs are being sent. + */ public final class SendAadLogsStatus extends ExpandableStringEnum { - /** Static value Enabled for SendAadLogsStatus. */ + /** + * Static value Enabled for SendAadLogsStatus. + */ public static final SendAadLogsStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for SendAadLogsStatus. */ + /** + * Static value Disabled for SendAadLogsStatus. + */ public static final SendAadLogsStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of SendAadLogsStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public SendAadLogsStatus() { /** * Creates or finds a SendAadLogsStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding SendAadLogsStatus. */ @@ -38,7 +44,7 @@ public static SendAadLogsStatus fromString(String name) { /** * Gets known SendAadLogsStatus values. - * + * * @return known SendAadLogsStatus values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendActivityLogsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendActivityLogsStatus.java index ad2ccd83738b2..3afab4836c366 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendActivityLogsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendActivityLogsStatus.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Indicates whether activity logs are being sent. */ +/** + * Indicates whether activity logs are being sent. + */ public final class SendActivityLogsStatus extends ExpandableStringEnum { - /** Static value Enabled for SendActivityLogsStatus. */ + /** + * Static value Enabled for SendActivityLogsStatus. + */ public static final SendActivityLogsStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for SendActivityLogsStatus. */ + /** + * Static value Disabled for SendActivityLogsStatus. + */ public static final SendActivityLogsStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of SendActivityLogsStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public SendActivityLogsStatus() { /** * Creates or finds a SendActivityLogsStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding SendActivityLogsStatus. */ @@ -38,7 +44,7 @@ public static SendActivityLogsStatus fromString(String name) { /** * Gets known SendActivityLogsStatus values. - * + * * @return known SendActivityLogsStatus values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendMetricsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendMetricsStatus.java index 86316bd5643ac..93995df8d6bb7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendMetricsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendMetricsStatus.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Indicates whether metrics are being sent. */ +/** + * Indicates whether metrics are being sent. + */ public final class SendMetricsStatus extends ExpandableStringEnum { - /** Static value Enabled for SendMetricsStatus. */ + /** + * Static value Enabled for SendMetricsStatus. + */ public static final SendMetricsStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for SendMetricsStatus. */ + /** + * Static value Disabled for SendMetricsStatus. + */ public static final SendMetricsStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of SendMetricsStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public SendMetricsStatus() { /** * Creates or finds a SendMetricsStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding SendMetricsStatus. */ @@ -38,7 +44,7 @@ public static SendMetricsStatus fromString(String name) { /** * Gets known SendMetricsStatus values. - * + * * @return known SendMetricsStatus values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendSubscriptionLogsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendSubscriptionLogsStatus.java index 23b5400c6ce58..be80411e148b4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendSubscriptionLogsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendSubscriptionLogsStatus.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Indicates whether subscription logs are being sent. */ +/** + * Indicates whether subscription logs are being sent. + */ public final class SendSubscriptionLogsStatus extends ExpandableStringEnum { - /** Static value Enabled for SendSubscriptionLogsStatus. */ + /** + * Static value Enabled for SendSubscriptionLogsStatus. + */ public static final SendSubscriptionLogsStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for SendSubscriptionLogsStatus. */ + /** + * Static value Disabled for SendSubscriptionLogsStatus. + */ public static final SendSubscriptionLogsStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of SendSubscriptionLogsStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public SendSubscriptionLogsStatus() { /** * Creates or finds a SendSubscriptionLogsStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding SendSubscriptionLogsStatus. */ @@ -38,7 +44,7 @@ public static SendSubscriptionLogsStatus fromString(String name) { /** * Gets known SendSubscriptionLogsStatus values. - * + * * @return known SendSubscriptionLogsStatus values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingLogsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingLogsStatus.java index da558d59ae8de..9be59c17731cd 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingLogsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingLogsStatus.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Indicates whether logs are being sent. */ +/** + * Indicates whether logs are being sent. + */ public final class SendingLogsStatus extends ExpandableStringEnum { - /** Static value Enabled for SendingLogsStatus. */ + /** + * Static value Enabled for SendingLogsStatus. + */ public static final SendingLogsStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for SendingLogsStatus. */ + /** + * Static value Disabled for SendingLogsStatus. + */ public static final SendingLogsStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of SendingLogsStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public SendingLogsStatus() { /** * Creates or finds a SendingLogsStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding SendingLogsStatus. */ @@ -38,7 +44,7 @@ public static SendingLogsStatus fromString(String name) { /** * Gets known SendingLogsStatus values. - * + * * @return known SendingLogsStatus values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingMetricsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingMetricsStatus.java index 6cc855315bc75..f1eef9e27b0cb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingMetricsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingMetricsStatus.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Indicates whether metrics are being sent. */ +/** + * Indicates whether metrics are being sent. + */ public final class SendingMetricsStatus extends ExpandableStringEnum { - /** Static value Enabled for SendingMetricsStatus. */ + /** + * Static value Enabled for SendingMetricsStatus. + */ public static final SendingMetricsStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for SendingMetricsStatus. */ + /** + * Static value Disabled for SendingMetricsStatus. + */ public static final SendingMetricsStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of SendingMetricsStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public SendingMetricsStatus() { /** * Creates or finds a SendingMetricsStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding SendingMetricsStatus. */ @@ -38,7 +44,7 @@ public static SendingMetricsStatus fromString(String name) { /** * Gets known SendingMetricsStatus values. - * + * * @return known SendingMetricsStatus values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SingleSignOnStates.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SingleSignOnStates.java index 6f6faa101ed36..c92e95f9d205a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SingleSignOnStates.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SingleSignOnStates.java @@ -8,23 +8,33 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Various states of the SSO resource. */ +/** + * Various states of the SSO resource. + */ public final class SingleSignOnStates extends ExpandableStringEnum { - /** Static value Initial for SingleSignOnStates. */ + /** + * Static value Initial for SingleSignOnStates. + */ public static final SingleSignOnStates INITIAL = fromString("Initial"); - /** Static value Enable for SingleSignOnStates. */ + /** + * Static value Enable for SingleSignOnStates. + */ public static final SingleSignOnStates ENABLE = fromString("Enable"); - /** Static value Disable for SingleSignOnStates. */ + /** + * Static value Disable for SingleSignOnStates. + */ public static final SingleSignOnStates DISABLE = fromString("Disable"); - /** Static value Existing for SingleSignOnStates. */ + /** + * Static value Existing for SingleSignOnStates. + */ public static final SingleSignOnStates EXISTING = fromString("Existing"); /** * Creates a new instance of SingleSignOnStates value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,7 +43,7 @@ public SingleSignOnStates() { /** * Creates or finds a SingleSignOnStates from its string representation. - * + * * @param name a name to look for. * @return the corresponding SingleSignOnStates. */ @@ -44,7 +54,7 @@ public static SingleSignOnStates fromString(String name) { /** * Gets known SingleSignOnStates values. - * + * * @return known SingleSignOnStates values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Status.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Status.java new file mode 100644 index 0000000000000..ec90cf8326883 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Status.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The state of monitoring. + */ +public final class Status extends ExpandableStringEnum { + /** + * Static value InProgress for Status. + */ + public static final Status IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Active for Status. + */ + public static final Status ACTIVE = fromString("Active"); + + /** + * Static value Failed for Status. + */ + public static final Status FAILED = fromString("Failed"); + + /** + * Static value Deleting for Status. + */ + public static final Status DELETING = fromString("Deleting"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SubscriptionList.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SubscriptionList.java new file mode 100644 index 0000000000000..7a5bf54b8ded3 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SubscriptionList.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + */ +@Fluent +public final class SubscriptionList { + /* + * The operation for the patch on the resource. + */ + @JsonProperty(value = "patchOperation") + private PatchOperation patchOperation; + + /* + * List of subscriptions and the state of the monitoring. + */ + @JsonProperty(value = "monitoredSubscriptionList") + private List monitoredSubscriptionList; + + /* + * Provisioning State of the resource + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Creates an instance of SubscriptionList class. + */ + public SubscriptionList() { + } + + /** + * Get the patchOperation property: The operation for the patch on the resource. + * + * @return the patchOperation value. + */ + public PatchOperation patchOperation() { + return this.patchOperation; + } + + /** + * Set the patchOperation property: The operation for the patch on the resource. + * + * @param patchOperation the patchOperation value to set. + * @return the SubscriptionList object itself. + */ + public SubscriptionList withPatchOperation(PatchOperation patchOperation) { + this.patchOperation = patchOperation; + return this; + } + + /** + * Get the monitoredSubscriptionList property: List of subscriptions and the state of the monitoring. + * + * @return the monitoredSubscriptionList value. + */ + public List monitoredSubscriptionList() { + return this.monitoredSubscriptionList; + } + + /** + * Set the monitoredSubscriptionList property: List of subscriptions and the state of the monitoring. + * + * @param monitoredSubscriptionList the monitoredSubscriptionList value to set. + * @return the SubscriptionList object itself. + */ + public SubscriptionList withMonitoredSubscriptionList(List monitoredSubscriptionList) { + this.monitoredSubscriptionList = monitoredSubscriptionList; + return this; + } + + /** + * Get the provisioningState property: Provisioning State of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (monitoredSubscriptionList() != null) { + monitoredSubscriptionList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SwitchBillingRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SwitchBillingRequest.java index ed3e611b96b1a..6171213e240fd 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SwitchBillingRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SwitchBillingRequest.java @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Request of a switch billing Operation. */ +/** + * Request of a switch billing Operation. + */ @Fluent public final class SwitchBillingRequest { /* @@ -35,13 +37,15 @@ public final class SwitchBillingRequest { @JsonProperty(value = "userEmail", required = true) private String userEmail; - /** Creates an instance of SwitchBillingRequest class. */ + /** + * Creates an instance of SwitchBillingRequest class. + */ public SwitchBillingRequest() { } /** * Get the azureResourceId property: Azure resource Id. - * + * * @return the azureResourceId value. */ public String azureResourceId() { @@ -50,7 +54,7 @@ public String azureResourceId() { /** * Set the azureResourceId property: Azure resource Id. - * + * * @param azureResourceId the azureResourceId value to set. * @return the SwitchBillingRequest object itself. */ @@ -61,7 +65,7 @@ public SwitchBillingRequest withAzureResourceId(String azureResourceId) { /** * Get the organizationId property: Organization id. - * + * * @return the organizationId value. */ public String organizationId() { @@ -70,7 +74,7 @@ public String organizationId() { /** * Set the organizationId property: Organization id. - * + * * @param organizationId the organizationId value to set. * @return the SwitchBillingRequest object itself. */ @@ -81,7 +85,7 @@ public SwitchBillingRequest withOrganizationId(String organizationId) { /** * Get the planData property: Plan details. - * + * * @return the planData value. */ public PlanData planData() { @@ -90,7 +94,7 @@ public PlanData planData() { /** * Set the planData property: Plan details. - * + * * @param planData the planData value to set. * @return the SwitchBillingRequest object itself. */ @@ -101,7 +105,7 @@ public SwitchBillingRequest withPlanData(PlanData planData) { /** * Get the userEmail property: User Email. - * + * * @return the userEmail value. */ public String userEmail() { @@ -110,7 +114,7 @@ public String userEmail() { /** * Set the userEmail property: User Email. - * + * * @param userEmail the userEmail value to set. * @return the SwitchBillingRequest object itself. */ @@ -121,7 +125,7 @@ public SwitchBillingRequest withUserEmail(String userEmail) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -129,9 +133,8 @@ public void validate() { planData().validate(); } if (userEmail() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model SwitchBillingRequest")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property userEmail in model SwitchBillingRequest")); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagAction.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagAction.java index bc98f7da77a94..e91a643f400dc 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagAction.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagAction.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Valid actions for a filtering tag. Exclusion takes priority over inclusion. */ +/** + * Valid actions for a filtering tag. Exclusion takes priority over inclusion. + */ public final class TagAction extends ExpandableStringEnum { - /** Static value Include for TagAction. */ + /** + * Static value Include for TagAction. + */ public static final TagAction INCLUDE = fromString("Include"); - /** Static value Exclude for TagAction. */ + /** + * Static value Exclude for TagAction. + */ public static final TagAction EXCLUDE = fromString("Exclude"); /** * Creates a new instance of TagAction value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public TagAction() { /** * Creates or finds a TagAction from its string representation. - * + * * @param name a name to look for. * @return the corresponding TagAction. */ @@ -38,7 +44,7 @@ public static TagAction fromString(String name) { /** * Gets known TagAction values. - * + * * @return known TagAction values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRule.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRule.java index 9323754452f34..2862613bc1438 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRule.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRule.java @@ -9,91 +9,104 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner; -/** An immutable client-side representation of TagRule. */ +/** + * An immutable client-side representation of TagRule. + */ public interface TagRule { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the provisioningState property: Provisioning State of the resource. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @return the logRules value. */ LogRules logRules(); /** * Gets the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @return the metricRules value. */ MetricRules metricRules(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner object. - * + * * @return the inner object. */ TagRuleInner innerModel(); - /** The entirety of the TagRule definition. */ + /** + * The entirety of the TagRule definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The TagRule definition stages. */ + + /** + * The TagRule definition stages. + */ interface DefinitionStages { - /** The first stage of the TagRule definition. */ + /** + * The first stage of the TagRule definition. + */ interface Blank extends WithParentResource { } - /** The stage of the TagRule definition allowing to specify parent resource. */ + + /** + * The stage of the TagRule definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, monitorName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @return the next definition stage. */ WithCreate withExistingMonitor(String resourceGroupName, String monitorName); } + /** * The stage of the TagRule definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. @@ -101,97 +114,115 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithLogRules, DefinitionStages.WithMetricRules { /** * Executes the create request. - * + * * @return the created resource. */ TagRule create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ TagRule create(Context context); } - /** The stage of the TagRule definition allowing to specify logRules. */ + + /** + * The stage of the TagRule definition allowing to specify logRules. + */ interface WithLogRules { /** * Specifies the logRules property: Set of rules for sending logs for the Monitor resource.. - * + * * @param logRules Set of rules for sending logs for the Monitor resource. * @return the next definition stage. */ WithCreate withLogRules(LogRules logRules); } - /** The stage of the TagRule definition allowing to specify metricRules. */ + + /** + * The stage of the TagRule definition allowing to specify metricRules. + */ interface WithMetricRules { /** * Specifies the metricRules property: Set of rules for sending metrics for the Monitor resource.. - * + * * @param metricRules Set of rules for sending metrics for the Monitor resource. * @return the next definition stage. */ WithCreate withMetricRules(MetricRulesInner metricRules); } } + /** * Begins update for the TagRule resource. - * + * * @return the stage of resource update. */ TagRule.Update update(); - /** The template for TagRule update. */ + /** + * The template for TagRule update. + */ interface Update extends UpdateStages.WithLogRules, UpdateStages.WithMetricRules { /** * Executes the update request. - * + * * @return the updated resource. */ TagRule apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ TagRule apply(Context context); } - /** The TagRule update stages. */ + + /** + * The TagRule update stages. + */ interface UpdateStages { - /** The stage of the TagRule update allowing to specify logRules. */ + /** + * The stage of the TagRule update allowing to specify logRules. + */ interface WithLogRules { /** * Specifies the logRules property: Set of rules for sending logs for the Monitor resource.. - * + * * @param logRules Set of rules for sending logs for the Monitor resource. * @return the next definition stage. */ Update withLogRules(LogRules logRules); } - /** The stage of the TagRule update allowing to specify metricRules. */ + + /** + * The stage of the TagRule update allowing to specify metricRules. + */ interface WithMetricRules { /** * Specifies the metricRules property: Set of rules for sending metrics for the Monitor resource.. - * + * * @param metricRules Set of rules for sending metrics for the Monitor resource. * @return the next definition stage. */ Update withMetricRules(MetricRulesInner metricRules); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ TagRule refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleListResult.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleListResult.java index 38d3bd256b780..488aafdcca92f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleListResult.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a TagRule list operation. */ +/** + * The response of a TagRule list operation. + */ @Fluent public final class TagRuleListResult { /* @@ -25,13 +27,15 @@ public final class TagRuleListResult { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of TagRuleListResult class. */ + /** + * Creates an instance of TagRuleListResult class. + */ public TagRuleListResult() { } /** * Get the value property: The TagRule items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The TagRule items on this page. - * + * * @param value the value value to set. * @return the TagRuleListResult object itself. */ @@ -51,7 +55,7 @@ public TagRuleListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +64,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of items. - * + * * @param nextLink the nextLink value to set. * @return the TagRuleListResult object itself. */ @@ -71,14 +75,13 @@ public TagRuleListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model TagRuleListResult")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model TagRuleListResult")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleUpdate.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleUpdate.java index 5c8e2deb4fdce..82b241c2ee764 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleUpdate.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleUpdate.java @@ -6,25 +6,27 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdateInner; -/** An immutable client-side representation of TagRuleUpdate. */ +/** + * An immutable client-side representation of TagRuleUpdate. + */ public interface TagRuleUpdate { /** * Gets the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @return the logRules value. */ LogRules logRules(); /** * Gets the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @return the metricRules value. */ MetricRules metricRules(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdateInner object. - * + * * @return the inner object. */ TagRuleUpdateInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleUpdateProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleUpdateProperties.java index 831a26093d566..6716f2b5cf645 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleUpdateProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleUpdateProperties.java @@ -6,25 +6,27 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdatePropertiesInner; -/** An immutable client-side representation of TagRuleUpdateProperties. */ +/** + * An immutable client-side representation of TagRuleUpdateProperties. + */ public interface TagRuleUpdateProperties { /** * Gets the logRules property: Set of rules for sending logs for the Monitor resource. - * + * * @return the logRules value. */ LogRules logRules(); /** * Gets the metricRules property: Set of rules for sending metrics for the Monitor resource. - * + * * @return the metricRules value. */ MetricRules metricRules(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdatePropertiesInner object. - * + * * @return the inner object. */ TagRuleUpdatePropertiesInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRules.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRules.java index e3fd28c3cc9b1..feb9c13f429e4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRules.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRules.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of TagRules. */ +/** + * Resource collection API of TagRules. + */ public interface TagRules { /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface TagRules { /** * List TagRule resources by NewRelicMonitorResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param context The context to associate with this operation. @@ -37,7 +39,7 @@ public interface TagRules { /** * Get a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -47,12 +49,12 @@ public interface TagRules { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a TagRule along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String monitorName, String ruleSetName, Context context); + Response getWithResponse(String resourceGroupName, String monitorName, String ruleSetName, + Context context); /** * Get a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -65,7 +67,7 @@ Response getWithResponse( /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -77,7 +79,7 @@ Response getWithResponse( /** * Delete a TagRule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. @@ -90,7 +92,7 @@ Response getWithResponse( /** * Get a TagRule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -101,7 +103,7 @@ Response getWithResponse( /** * Get a TagRule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -113,7 +115,7 @@ Response getWithResponse( /** * Delete a TagRule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -123,7 +125,7 @@ Response getWithResponse( /** * Delete a TagRule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -134,7 +136,7 @@ Response getWithResponse( /** * Begins definition for a new TagRule resource. - * + * * @param name resource name. * @return the first stage of the new TagRule definition. */ diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UsageType.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UsageType.java index 48a73b727f4d3..97bd6091e1f49 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UsageType.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UsageType.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Different usage type like PAYG/COMMITTED. */ +/** + * Different usage type like PAYG/COMMITTED. + */ public final class UsageType extends ExpandableStringEnum { - /** Static value PAYG for UsageType. */ + /** + * Static value PAYG for UsageType. + */ public static final UsageType PAYG = fromString("PAYG"); - /** Static value COMMITTED for UsageType. */ + /** + * Static value COMMITTED for UsageType. + */ public static final UsageType COMMITTED = fromString("COMMITTED"); /** * Creates a new instance of UsageType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public UsageType() { /** * Creates or finds a UsageType from its string representation. - * + * * @param name a name to look for. * @return the corresponding UsageType. */ @@ -38,7 +44,7 @@ public static UsageType fromString(String name) { /** * Gets known UsageType values. - * + * * @return known UsageType values. */ public static Collection values() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserAssignedIdentity.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserAssignedIdentity.java index fd62890f013f2..48a6239592d13 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserAssignedIdentity.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserAssignedIdentity.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; -/** User assigned identity properties. */ +/** + * User assigned identity properties. + */ @Immutable public final class UserAssignedIdentity { /* @@ -23,13 +25,15 @@ public final class UserAssignedIdentity { @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private UUID clientId; - /** Creates an instance of UserAssignedIdentity class. */ + /** + * Creates an instance of UserAssignedIdentity class. + */ public UserAssignedIdentity() { } /** * Get the principalId property: The principal ID of the assigned identity. - * + * * @return the principalId value. */ public UUID principalId() { @@ -38,7 +42,7 @@ public UUID principalId() { /** * Get the clientId property: The client ID of the assigned identity. - * + * * @return the clientId value. */ public UUID clientId() { @@ -47,7 +51,7 @@ public UUID clientId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserInfo.java index 9bd6581205776..a51372366e3f8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserInfo.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserInfo.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** User Info of NewRelic Monitor resource. */ +/** + * User Info of NewRelic Monitor resource. + */ @Fluent public final class UserInfo { /* @@ -40,13 +42,15 @@ public final class UserInfo { @JsonProperty(value = "country") private String country; - /** Creates an instance of UserInfo class. */ + /** + * Creates an instance of UserInfo class. + */ public UserInfo() { } /** * Get the firstName property: First name. - * + * * @return the firstName value. */ public String firstName() { @@ -55,7 +59,7 @@ public String firstName() { /** * Set the firstName property: First name. - * + * * @param firstName the firstName value to set. * @return the UserInfo object itself. */ @@ -66,7 +70,7 @@ public UserInfo withFirstName(String firstName) { /** * Get the lastName property: Last name. - * + * * @return the lastName value. */ public String lastName() { @@ -75,7 +79,7 @@ public String lastName() { /** * Set the lastName property: Last name. - * + * * @param lastName the lastName value to set. * @return the UserInfo object itself. */ @@ -86,7 +90,7 @@ public UserInfo withLastName(String lastName) { /** * Get the emailAddress property: User Email. - * + * * @return the emailAddress value. */ public String emailAddress() { @@ -95,7 +99,7 @@ public String emailAddress() { /** * Set the emailAddress property: User Email. - * + * * @param emailAddress the emailAddress value to set. * @return the UserInfo object itself. */ @@ -106,7 +110,7 @@ public UserInfo withEmailAddress(String emailAddress) { /** * Get the phoneNumber property: Contact phone number. - * + * * @return the phoneNumber value. */ public String phoneNumber() { @@ -115,7 +119,7 @@ public String phoneNumber() { /** * Set the phoneNumber property: Contact phone number. - * + * * @param phoneNumber the phoneNumber value to set. * @return the UserInfo object itself. */ @@ -126,7 +130,7 @@ public UserInfo withPhoneNumber(String phoneNumber) { /** * Get the country property: country if user. - * + * * @return the country value. */ public String country() { @@ -135,7 +139,7 @@ public String country() { /** * Set the country property: country if user. - * + * * @param country the country value to set. * @return the UserInfo object itself. */ @@ -146,7 +150,7 @@ public UserInfo withCountry(String country) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMExtensionPayload.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMExtensionPayload.java index 51494f6b65c02..6b52140376eb6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMExtensionPayload.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMExtensionPayload.java @@ -6,18 +6,20 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.VMExtensionPayloadInner; -/** An immutable client-side representation of VMExtensionPayload. */ +/** + * An immutable client-side representation of VMExtensionPayload. + */ public interface VMExtensionPayload { /** * Gets the ingestionKey property: Ingestion key of the account. - * + * * @return the ingestionKey value. */ String ingestionKey(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.VMExtensionPayloadInner object. - * + * * @return the inner object. */ VMExtensionPayloadInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMHostsListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMHostsListResponse.java index 2c88b3ed93db9..e3a24e32e1652 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMHostsListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMHostsListResponse.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response of a list VM Host Operation. */ +/** + * Response of a list VM Host Operation. + */ @Fluent public final class VMHostsListResponse { /* @@ -25,13 +27,15 @@ public final class VMHostsListResponse { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of VMHostsListResponse class. */ + /** + * Creates an instance of VMHostsListResponse class. + */ public VMHostsListResponse() { } /** * Get the value property: The VMInfo items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The VMInfo items on this page. - * + * * @param value the value value to set. * @return the VMHostsListResponse object itself. */ @@ -51,7 +55,7 @@ public VMHostsListResponse withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +64,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of items. - * + * * @param nextLink the nextLink value to set. * @return the VMHostsListResponse object itself. */ @@ -71,14 +75,13 @@ public VMHostsListResponse withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model VMHostsListResponse")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model VMHostsListResponse")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMInfo.java index a0a41cd6838de..c0e1722fb34f8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMInfo.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMInfo.java @@ -6,32 +6,34 @@ import com.azure.resourcemanager.newrelicobservability.fluent.models.VMInfoInner; -/** An immutable client-side representation of VMInfo. */ +/** + * An immutable client-side representation of VMInfo. + */ public interface VMInfo { /** * Gets the vmId property: Azure VM resource ID. - * + * * @return the vmId value. */ String vmId(); /** * Gets the agentVersion property: Version of the NewRelic agent installed on the VM. - * + * * @return the agentVersion value. */ String agentVersion(); /** * Gets the agentStatus property: Status of the NewRelic agent installed on the VM. - * + * * @return the agentStatus value. */ String agentStatus(); /** * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.VMInfoInner object. - * + * * @return the inner object. */ VMInfoInner innerModel(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/package-info.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/package-info.java index bbb69d3e3ea9b..340af4fed7366 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/package-info.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for NewRelicObservability. null. */ +/** + * Package containing the data models for NewRelicObservability. + * null. + */ package com.azure.resourcemanager.newrelicobservability.models; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/package-info.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/package-info.java index b9e83c443771e..d4611309be041 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/package-info.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for NewRelicObservability. null. */ +/** + * Package containing the classes for NewRelicObservability. + * null. + */ package com.azure.resourcemanager.newrelicobservability; diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/module-info.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/module-info.java index 6705bb4a65a92..ea7a0148c61fd 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/module-info.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.newrelicobservability { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.newrelicobservability; exports com.azure.resourcemanager.newrelicobservability.fluent; exports com.azure.resourcemanager.newrelicobservability.fluent.models; exports com.azure.resourcemanager.newrelicobservability.models; - - opens com.azure.resourcemanager.newrelicobservability.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.newrelicobservability.models to - com.azure.core, - com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.newrelicobservability.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.newrelicobservability.models to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/proxy-config.json b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/proxy-config.json new file mode 100644 index 0000000000000..a8095368d2081 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.newrelicobservability.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.AccountsClientImpl$AccountsService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.MonitorsClientImpl$MonitorsService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.OrganizationsClientImpl$OrganizationsService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.PlansClientImpl$PlansService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.BillingInfoesClientImpl$BillingInfoesService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.ConnectedPartnerResourcesClientImpl$ConnectedPartnerResourcesService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.TagRulesClientImpl$TagRulesService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.MonitoredSubscriptionsClientImpl$MonitoredSubscriptionsService" ] ] \ No newline at end of file diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/reflect-config.json b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/reflect-config.json new file mode 100644 index 0000000000000..a8e7fce62ba7a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/reflect-config.json @@ -0,0 +1,411 @@ +[ { + "name" : "com.azure.resourcemanager.newrelicobservability.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.AccountsListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.AccountProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.AccountInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.OrganizationInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.NewRelicSingleSignOnProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.UserInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.PlanData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.OrganizationsListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.PlanDataListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.MetricsRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.FilteringTag", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.AppServicesListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.VMHostsListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.VMInfoInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.MonitoredResourceListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.MarketplaceSaaSInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.PartnerBillingEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.TagRuleListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.LogRules", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdatePropertiesInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionPropertiesList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.SubscriptionList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.LinkedResourceListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.VMExtensionPayloadInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingHeaders", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.MonitoringStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.MarketplaceSubscriptionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.SingleSignOnStates", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.UsageType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.BillingCycle", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.LiftrResourceCategories", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.BillingSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.TagAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.SendingMetricsStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.SendingLogsStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.PatchOperation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.Status", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.newrelicobservability.models.ConfigurationName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java index 3d96f7c3ac164..0fa7cfb503cf8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Accounts List. */ +/** + * Samples for Accounts List. + */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Accounts_List_MinimumSet_Gen.json */ /** * Sample code: Accounts_List_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void accountsListMinimumSetGen( @@ -20,11 +23,12 @@ public static void accountsListMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Accounts_List_MaximumSet_Gen.json */ /** * Sample code: Accounts_List_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void accountsListMaximumSetGen( diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoGetSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoGetSamples.java new file mode 100644 index 0000000000000..e9162f8cee186 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +/** + * Samples for BillingInfo Get. + */ +public final class BillingInfoGetSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/BillingInfo_Get.json + */ + /** + * Sample code: BillingInfo_Get. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void + billingInfoGet(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.billingInfoes().getWithResponse("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListSamples.java new file mode 100644 index 0000000000000..3d97174a6caa6 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +/** + * Samples for ConnectedPartnerResources List. + */ +public final class ConnectedPartnerResourcesListSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * ConnectedPartnerResources_List.json + */ + /** + * Sample code: ConnectedPartnerResources_List. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void connectedPartnerResourcesList( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.connectedPartnerResources().list("myResourceGroup", "myMonitor", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateSamples.java new file mode 100644 index 0000000000000..81a98072e16cd --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; + +/** + * Samples for MonitoredSubscriptions CreateorUpdate. + */ +public final class MonitoredSubscriptionsCreateorUpdateSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_CreateorUpdate.json + */ + /** + * Sample code: Monitors_AddMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsAddMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitoredSubscriptions().define(ConfigurationName.DEFAULT) + .withExistingMonitor("myResourceGroup", "myMonitor").create(); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsDeleteSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsDeleteSamples.java new file mode 100644 index 0000000000000..5103c32c3b5f0 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; + +/** + * Samples for MonitoredSubscriptions Delete. + */ +public final class MonitoredSubscriptionsDeleteSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_Delete.json + */ + /** + * Sample code: Monitors_DeleteMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsDeleteMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitoredSubscriptions().delete("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetSamples.java new file mode 100644 index 0000000000000..423fffd5efeb3 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; + +/** + * Samples for MonitoredSubscriptions Get. + */ +public final class MonitoredSubscriptionsGetSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_Get.json + */ + /** + * Sample code: Monitors_GetMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsGetMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitoredSubscriptions().getWithResponse("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListSamples.java new file mode 100644 index 0000000000000..b791d83fb4e85 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +/** + * Samples for MonitoredSubscriptions List. + */ +public final class MonitoredSubscriptionsListSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_List.json + */ + /** + * Sample code: Monitors_GetMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsGetMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitoredSubscriptions().list("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsUpdateSamples.java new file mode 100644 index 0000000000000..a1f305680bbc5 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; + +/** + * Samples for MonitoredSubscriptions Update. + */ +public final class MonitoredSubscriptionsUpdateSamples { + /* + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * MonitoredSubscriptions_Update.json + */ + /** + * Sample code: Monitors_UpdateMonitoredSubscriptions. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsUpdateMonitoredSubscriptions( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + MonitoredSubscriptionProperties resource = manager.monitoredSubscriptions().getWithResponse("myResourceGroup", + "myMonitor", ConfigurationName.DEFAULT, com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java index ebcfdab1e8113..4b3326d538692 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java @@ -7,6 +7,8 @@ import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.AccountInfo; import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; +import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; +import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; import com.azure.resourcemanager.newrelicobservability.models.NewRelicSingleSignOnProperties; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; @@ -15,62 +17,48 @@ import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; import com.azure.resourcemanager.newrelicobservability.models.SingleSignOnStates; import com.azure.resourcemanager.newrelicobservability.models.UsageType; +import com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity; import com.azure.resourcemanager.newrelicobservability.models.UserInfo; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; -/** Samples for Monitors CreateOrUpdate. */ +/** + * Samples for Monitors CreateOrUpdate. + */ public final class MonitorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Monitors_CreateOrUpdate_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .define("cdlymktqw") - .withRegion("k") - .withExistingResourceGroup("rgNewRelic") - .withTags(mapOf("key6976", "oaxfhf")) - .withNewRelicAccountProperties( - new NewRelicAccountProperties() - .withUserId("vcscxlncofcuduadesd") - .withAccountInfo( - new AccountInfo() - .withAccountId("xhqmg") - .withIngestionKey("fakeTokenPlaceholder") - .withRegion("ljcf")) - .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) - .withSingleSignOnProperties( - new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL) - .withEnterpriseAppId("kwiwfz") - .withSingleSignOnUrl("kvseueuljsxmfwpqctz") - .withProvisioningState(ProvisioningState.ACCEPTED))) - .withUserInfo( - new UserInfo() - .withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") - .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc") - .withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") - .withPhoneNumber("krf") - .withCountry("hslqnwdanrconqyekwbnttaetv")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga") - .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.LIFTR) - .create(); + manager.monitors().define("cdlymktqw").withRegion("k").withExistingResourceGroup("rgNewRelic") + .withTags(mapOf("key6976", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) + .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("vcscxlncofcuduadesd") + .withAccountInfo(new AccountInfo() + .withAccountId("xhqmg").withIngestionKey("fakeTokenPlaceholder").withRegion("ljcf")) + .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) + .withSingleSignOnProperties(new NewRelicSingleSignOnProperties() + .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("kwiwfz") + .withSingleSignOnUrl("kvseueuljsxmfwpqctz").withProvisioningState(ProvisioningState.ACCEPTED))) + .withUserInfo(new UserInfo().withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") + .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc").withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") + .withPhoneNumber("krf").withCountry("hslqnwdanrconqyekwbnttaetv")) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR).withAccountCreationSource(AccountCreationSource.LIFTR) + .withSubscriptionState("Suspended").withSaaSAzureSubscriptionStatus("Subscribed").create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java index df1bcce4f1524..c33964d683a6f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java @@ -4,43 +4,37 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Monitors Delete. */ +/** + * Samples for Monitors Delete. + */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_Delete_MinimumSet_Gen.json */ /** * Sample code: Monitors_Delete_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .delete( - "rgopenapi", - "ruxvg@xqkmdhrnoo.hlmbpm", - "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors().delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_Delete_MaximumSet_Gen.json */ /** * Sample code: Monitors_Delete_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .delete( - "rgopenapi", - "ruxvg@xqkmdhrnoo.hlmbpm", - "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors().delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java index f3c289c7d18b1..caf1a6615ccbf 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java @@ -4,18 +4,21 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Monitors GetByResourceGroup. */ +/** + * Samples for Monitors GetByResourceGroup. + */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_Get_MaximumSet_Gen.json */ /** * Sample code: Monitors_Get_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void monitorsGetMaximumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + public static void + monitorsGetMaximumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { manager.monitors().getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java index 4c135009373f7..a7925763fca43 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java @@ -6,43 +6,37 @@ import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; -/** Samples for Monitors GetMetricRules. */ +/** + * Samples for Monitors GetMetricRules. + */ public final class MonitorsGetMetricRulesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_GetMetricRules_MinimumSet_Gen.json */ /** * Sample code: Monitors_GetMetricRules_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsGetMetricRulesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .getMetricRulesWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_GetMetricRules_MaximumSet_Gen.json */ /** * Sample code: Monitors_GetMetricRules_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsGetMetricRulesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .getMetricRulesWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java index 729dd907b15ba..1e76d589c2e1c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java @@ -7,45 +7,43 @@ import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; import java.util.Arrays; -/** Samples for Monitors GetMetricStatus. */ +/** + * Samples for Monitors GetMetricStatus. + */ public final class MonitorsGetMetricStatusSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_GetMetricStatus_MinimumSet_Gen.json */ /** * Sample code: Monitors_GetMetricStatus_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsGetMetricStatusMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .getMetricStatusWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsStatusRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_GetMetricStatus_MaximumSet_Gen.json */ /** * Sample code: Monitors_GetMetricStatus_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsGetMetricStatusMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .getMetricStatusWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsStatusRequest() - .withAzureResourceIds(Arrays.asList("enfghpfw")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java index 70fd06e09d501..4a2902ed55258 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java @@ -7,45 +7,43 @@ import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; import java.util.Arrays; -/** Samples for Monitors ListAppServices. */ +/** + * Samples for Monitors ListAppServices. + */ public final class MonitorsListAppServicesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListAppServices_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListAppServices_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListAppServicesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listAppServices( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new AppServicesGetRequest() - .withAzureResourceIds(Arrays.asList("pvzrksrmzowobuhxpwiotnpcvjbu")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListAppServices_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListAppServices_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListAppServicesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listAppServices( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new AppServicesGetRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java index 69c7e4adf0dd5..f32f6675d0473 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Monitors ListByResourceGroup. */ +/** + * Samples for Monitors ListByResourceGroup. + */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListByResourceGroup_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListByResourceGroupMaximumSetGen( diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java index d5875b2680b4a..6dc202b91fe24 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java @@ -7,47 +7,41 @@ import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; import java.util.Arrays; -/** Samples for Monitors ListHosts. */ +/** + * Samples for Monitors ListHosts. + */ public final class MonitorsListHostsSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListHosts_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListHosts_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListHostsMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listHosts( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - new HostsGetRequest() - .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().listHosts( + "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", new HostsGetRequest() + .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")).withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListHosts_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListHosts_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListHostsMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listHosts( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - new HostsGetRequest() - .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().listHosts( + "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", new HostsGetRequest() + .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")).withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesSamples.java new file mode 100644 index 0000000000000..7010b26e26bdd --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +/** + * Samples for Monitors ListLinkedResources. + */ +public final class MonitorsListLinkedResourcesSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/LinkedResources_List. + * json + */ + /** + * Sample code: Monitors_ListLinkedResources. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsListLinkedResources( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors().listLinkedResources("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java index 7e2390ebe2b13..812b01ef5e06f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java @@ -4,35 +4,37 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Monitors ListMonitoredResources. */ +/** + * Samples for Monitors ListMonitoredResources. + */ public final class MonitorsListMonitoredResourcesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListMonitoredResources_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListMonitoredResources_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListMonitoredResourcesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.monitors().listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListMonitoredResources_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListMonitoredResources_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListMonitoredResourcesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.monitors().listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java index ebbf77092329d..d4462aa2861c6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Monitors List. */ +/** + * Samples for Monitors List. + */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListBySubscription_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsListBySubscriptionMaximumSetGen( diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java index 8ce20bd6d228e..a5102e651ba22 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java @@ -10,52 +10,43 @@ import com.azure.resourcemanager.newrelicobservability.models.UsageType; import java.time.OffsetDateTime; -/** Samples for Monitors SwitchBilling. */ +/** + * Samples for Monitors SwitchBilling. + */ public final class MonitorsSwitchBillingSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_SwitchBilling_MinimumSet_Gen.json */ /** * Sample code: Monitors_SwitchBilling_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsSwitchBillingMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .switchBillingWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new SwitchBillingRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new SwitchBillingRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_SwitchBilling_MaximumSet_Gen.json */ /** * Sample code: Monitors_SwitchBilling_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsSwitchBillingMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .switchBillingWithResponse( - "rgNewRelic", - "fhcjxnxumkdlgpwanewtkdnyuz", - new SwitchBillingRequest() - .withAzureResourceId("enfghpfw") - .withOrganizationId("k") - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga") - .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors().switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new SwitchBillingRequest().withAzureResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") + .withOrganizationId("k") + .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java index 59cdb1788e217..a39b88575f5b1 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java @@ -24,63 +24,43 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Monitors Update. */ +/** + * Samples for Monitors Update. + */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_Update_MaximumSet_Gen.json */ /** * Sample code: Monitors_Update_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - NewRelicMonitorResource resource = - manager - .monitors() - .getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("key164", "jqakdrrmmyzytqu")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) - .withNewRelicAccountProperties( - new NewRelicAccountProperties() - .withUserId("vcscxlncofcuduadesd") - .withAccountInfo( - new AccountInfo() - .withAccountId("xhqmg") - .withIngestionKey("fakeTokenPlaceholder") - .withRegion("ljcf")) - .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) - .withSingleSignOnProperties( - new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL) - .withEnterpriseAppId("kwiwfz") - .withSingleSignOnUrl("kvseueuljsxmfwpqctz") - .withProvisioningState(ProvisioningState.ACCEPTED))) - .withUserInfo( - new UserInfo() - .withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") - .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc") - .withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") - .withPhoneNumber("krf") - .withCountry("hslqnwdanrconqyekwbnttaetv")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga") - .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.LIFTR) + NewRelicMonitorResource resource = manager.monitors() + .getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("key164", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) + .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("vcscxlncofcuduadesd") + .withAccountInfo(new AccountInfo() + .withAccountId("xhqmg").withIngestionKey("fakeTokenPlaceholder").withRegion("ljcf")) + .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) + .withSingleSignOnProperties(new NewRelicSingleSignOnProperties() + .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("kwiwfz") + .withSingleSignOnUrl("kvseueuljsxmfwpqctz").withProvisioningState(ProvisioningState.ACCEPTED))) + .withUserInfo(new UserInfo().withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") + .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc").withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") + .withPhoneNumber("krf").withCountry("hslqnwdanrconqyekwbnttaetv")) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR).withAccountCreationSource(AccountCreationSource.LIFTR) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java index 36c4a80ae49f9..2c3ffa0e82754 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java @@ -4,35 +4,37 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Monitors VmHostPayload. */ +/** + * Samples for Monitors VmHostPayload. + */ public final class MonitorsVmHostPayloadSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_VmHostPayload_MinimumSet_Gen.json */ /** * Sample code: Monitors_VmHostPayload_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsVmHostPayloadMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.monitors().vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Monitors_VmHostPayload_MaximumSet_Gen.json */ /** * Sample code: Monitors_VmHostPayload_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void monitorsVmHostPayloadMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .monitors() - .vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.monitors().vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java index 40771394c2e95..1f94f848d7c10 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void operationsListMinimumSetGen( @@ -20,11 +23,12 @@ public static void operationsListMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void operationsListMaximumSetGen( diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java index bd4d2591aa4be..99ba2b9bf7f6f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Organizations List. */ +/** + * Samples for Organizations List. + */ public final class OrganizationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Organizations_List_MinimumSet_Gen.json */ /** * Sample code: Organizations_List_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void organizationsListMinimumSetGen( @@ -20,11 +23,12 @@ public static void organizationsListMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Organizations_List_MaximumSet_Gen.json */ /** * Sample code: Organizations_List_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void organizationsListMaximumSetGen( diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java index 798b3ae411d56..4d834629fc246 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java @@ -4,31 +4,35 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for Plans List. */ +/** + * Samples for Plans List. + */ public final class PlansListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Plans_List_MaximumSet_Gen.json */ /** * Sample code: Plans_List_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void plansListMaximumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + public static void + plansListMaximumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { manager.plans().list("pwuxgvrmkk", "hilawwjz", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * Plans_List_MinimumSet_Gen.json */ /** * Sample code: Plans_List_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void plansListMinimumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.plans().list(null, null, com.azure.core.util.Context.NONE); + public static void + plansListMinimumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.plans().list(null, "hilawwjz", com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java index 779d3a5818e47..855790e35c59a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java @@ -13,61 +13,47 @@ import com.azure.resourcemanager.newrelicobservability.models.TagAction; import java.util.Arrays; -/** Samples for TagRules CreateOrUpdate. */ +/** + * Samples for TagRules CreateOrUpdate. + */ public final class TagRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: TagRules_CreateOrUpdate_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .define("bxcantgzggsepbhqmedjqyrqeezmfb") + manager.tagRules().define("bxcantgzggsepbhqmedjqyrqeezmfb") .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron") - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb") - .withAction(TagAction.INCLUDE)))) - .withMetricRules( - new MetricRulesInner() - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb") - .withAction(TagAction.INCLUDE))) - .withUserEmail("test@testing.com")) + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") + .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE)))) + .withMetricRules(new MetricRulesInner() + .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") + .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE))) + .withUserEmail("test@testing.com")) .create(); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: TagRules_CreateOrUpdate_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .define("bxcantgzggsepbhqmedjqyrqeezmfb") - .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron") - .create(); + manager.tagRules().define("bxcantgzggsepbhqmedjqyrqeezmfb") + .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron").create(); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java index bf2ee37a5c51f..0de870c4ee262 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java @@ -4,43 +4,37 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for TagRules Delete. */ +/** + * Samples for TagRules Delete. + */ public final class TagRulesDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Delete_MinimumSet_Gen.json */ /** * Sample code: TagRules_Delete_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .delete( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules().delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Delete_MaximumSet_Gen.json */ /** * Sample code: TagRules_Delete_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .delete( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules().delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java index 4dde5c5ce9f91..1fc8dbcdce8e3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java @@ -4,43 +4,37 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for TagRules Get. */ +/** + * Samples for TagRules Get. + */ public final class TagRulesGetSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Get_MinimumSet_Gen.json */ /** * Sample code: TagRules_Get_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void tagRulesGetMinimumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .getWithResponse( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + public static void + tagRulesGetMinimumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Get_MaximumSet_Gen.json */ /** * Sample code: TagRules_Get_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ - public static void tagRulesGetMaximumSetGen( - com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .getWithResponse( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + public static void + tagRulesGetMaximumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java index b28c3e3c9fec0..db66fbf3d26a6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java @@ -4,37 +4,37 @@ package com.azure.resourcemanager.newrelicobservability.generated; -/** Samples for TagRules ListByNewRelicMonitorResource. */ +/** + * Samples for TagRules ListByNewRelicMonitorResource. + */ public final class TagRulesListByNewRelicMonitorResourceSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json */ /** * Sample code: TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesListByNewRelicMonitorResourceMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .listByNewRelicMonitorResource( - "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.tagRules().listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json */ /** * Sample code: TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesListByNewRelicMonitorResourceMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager - .tagRules() - .listByNewRelicMonitorResource( - "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + manager.tagRules().listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java index 1aad4f817a39f..13b4756ffe6d8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java @@ -14,73 +14,49 @@ import com.azure.resourcemanager.newrelicobservability.models.TagRule; import java.util.Arrays; -/** Samples for TagRules Update. */ +/** + * Samples for TagRules Update. + */ public final class TagRulesUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Update_MaximumSet_Gen.json */ /** * Sample code: TagRules_Update_MaximumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - TagRule resource = - manager - .tagRules() - .getWithResponse( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb") - .withAction(TagAction.INCLUDE)))) - .withMetricRules( - new MetricRulesInner() - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb") - .withAction(TagAction.INCLUDE))) - .withUserEmail("test@testing.com")) + TagRule resource = manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + "bxcantgzggsepbhqmedjqyrqeezmfb", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") + .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE)))) + .withMetricRules(new MetricRulesInner() + .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") + .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE))) + .withUserEmail("test@testing.com")) .apply(); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * TagRules_Update_MinimumSet_Gen.json */ /** * Sample code: TagRules_Update_MinimumSet_Gen. - * + * * @param manager Entry point to NewRelicObservabilityManager. */ public static void tagRulesUpdateMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - TagRule resource = - manager - .tagRules() - .getWithResponse( - "rgopenapi", - "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE) - .getValue(); + TagRule resource = manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + "bxcantgzggsepbhqmedjqyrqeezmfb", com.azure.core.util.Context.NONE).getValue(); resource.update().apply(); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountPropertiesTests.java index 72eef6f3fb19c..132d9876c4ee8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountPropertiesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountPropertiesTests.java @@ -11,11 +11,9 @@ public final class AccountPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AccountProperties model = - BinaryData - .fromString( - "{\"organizationId\":\"wixjsprozvcp\",\"accountId\":\"eg\",\"accountName\":\"wmfdatscmdvpjhul\",\"region\":\"uvm\"}") - .toObject(AccountProperties.class); + AccountProperties model = BinaryData.fromString( + "{\"organizationId\":\"wixjsprozvcp\",\"accountId\":\"eg\",\"accountName\":\"wmfdatscmdvpjhul\",\"region\":\"uvm\"}") + .toObject(AccountProperties.class); Assertions.assertEquals("wixjsprozvcp", model.organizationId()); Assertions.assertEquals("eg", model.accountId()); Assertions.assertEquals("wmfdatscmdvpjhul", model.accountName()); @@ -24,12 +22,8 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AccountProperties model = - new AccountProperties() - .withOrganizationId("wixjsprozvcp") - .withAccountId("eg") - .withAccountName("wmfdatscmdvpjhul") - .withRegion("uvm"); + AccountProperties model = new AccountProperties().withOrganizationId("wixjsprozvcp").withAccountId("eg") + .withAccountName("wmfdatscmdvpjhul").withRegion("uvm"); model = BinaryData.fromObject(model).toObject(AccountProperties.class); Assertions.assertEquals("wixjsprozvcp", model.organizationId()); Assertions.assertEquals("eg", model.accountId()); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountResourceInnerTests.java index d48031a8f8193..796c12aba8dc5 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountResourceInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountResourceInnerTests.java @@ -11,11 +11,9 @@ public final class AccountResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AccountResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"organizationId\":\"s\",\"accountId\":\"nyejhkryhtnap\",\"accountName\":\"wlokjyem\",\"region\":\"vnipjox\"},\"id\":\"nchgej\",\"name\":\"podmailzydehojwy\",\"type\":\"huxinpmqnj\"}") - .toObject(AccountResourceInner.class); + AccountResourceInner model = BinaryData.fromString( + "{\"properties\":{\"organizationId\":\"s\",\"accountId\":\"nyejhkryhtnap\",\"accountName\":\"wlokjyem\",\"region\":\"vnipjox\"},\"id\":\"nchgej\",\"name\":\"podmailzydehojwy\",\"type\":\"huxinpmqnj\"}") + .toObject(AccountResourceInner.class); Assertions.assertEquals("s", model.organizationId()); Assertions.assertEquals("nyejhkryhtnap", model.accountId()); Assertions.assertEquals("wlokjyem", model.accountName()); @@ -24,12 +22,8 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AccountResourceInner model = - new AccountResourceInner() - .withOrganizationId("s") - .withAccountId("nyejhkryhtnap") - .withAccountName("wlokjyem") - .withRegion("vnipjox"); + AccountResourceInner model = new AccountResourceInner().withOrganizationId("s").withAccountId("nyejhkryhtnap") + .withAccountName("wlokjyem").withRegion("vnipjox"); model = BinaryData.fromObject(model).toObject(AccountResourceInner.class); Assertions.assertEquals("s", model.organizationId()); Assertions.assertEquals("nyejhkryhtnap", model.accountId()); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java index 8e0eb3771d644..00a921ae38e9b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java @@ -31,41 +31,30 @@ public void testList() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"organizationId\":\"fclhaaxdbabphlwr\",\"accountId\":\"fkts\",\"accountName\":\"sucocmnyyazttbtw\",\"region\":\"qpuedckzywbiex\"},\"id\":\"eyueaxibxujwb\",\"name\":\"qwalmuzyoxaepd\",\"type\":\"zjancuxr\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"organizationId\":\"bnxknalaulppg\",\"accountId\":\"tpnapnyiropuhpig\",\"accountName\":\"gylgqgitxmedjvcs\",\"region\":\"n\"},\"id\":\"wncwzzhxgktrmg\",\"name\":\"cnapkteoell\",\"type\":\"pt\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.accounts().list("tkcxywnytnrsy", "lqidyby", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fclhaaxdbabphlwr", response.iterator().next().organizationId()); - Assertions.assertEquals("fkts", response.iterator().next().accountId()); - Assertions.assertEquals("sucocmnyyazttbtw", response.iterator().next().accountName()); - Assertions.assertEquals("qpuedckzywbiex", response.iterator().next().region()); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.accounts().list("iidzyexzne", "ixhnrztf", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("bnxknalaulppg", response.iterator().next().organizationId()); + Assertions.assertEquals("tpnapnyiropuhpig", response.iterator().next().accountId()); + Assertions.assertEquals("gylgqgitxmedjvcs", response.iterator().next().accountName()); + Assertions.assertEquals("n", response.iterator().next().region()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListResponseTests.java index d1749734275b7..122541a2e4b6b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListResponseTests.java @@ -13,11 +13,9 @@ public final class AccountsListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AccountsListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"organizationId\":\"ithxqhabifpi\",\"accountId\":\"wczbys\",\"accountName\":\"pqxu\",\"region\":\"vyq\"},\"id\":\"wby\",\"name\":\"rkxvdum\",\"type\":\"grtfwvu\"}],\"nextLink\":\"gaudcc\"}") - .toObject(AccountsListResponse.class); + AccountsListResponse model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"organizationId\":\"ithxqhabifpi\",\"accountId\":\"wczbys\",\"accountName\":\"pqxu\",\"region\":\"vyq\"},\"id\":\"wby\",\"name\":\"rkxvdum\",\"type\":\"grtfwvu\"}],\"nextLink\":\"gaudcc\"}") + .toObject(AccountsListResponse.class); Assertions.assertEquals("ithxqhabifpi", model.value().get(0).organizationId()); Assertions.assertEquals("wczbys", model.value().get(0).accountId()); Assertions.assertEquals("pqxu", model.value().get(0).accountName()); @@ -27,17 +25,9 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AccountsListResponse model = - new AccountsListResponse() - .withValue( - Arrays - .asList( - new AccountResourceInner() - .withOrganizationId("ithxqhabifpi") - .withAccountId("wczbys") - .withAccountName("pqxu") - .withRegion("vyq"))) - .withNextLink("gaudcc"); + AccountsListResponse model = new AccountsListResponse().withValue(Arrays.asList(new AccountResourceInner() + .withOrganizationId("ithxqhabifpi").withAccountId("wczbys").withAccountName("pqxu").withRegion("vyq"))) + .withNextLink("gaudcc"); model = BinaryData.fromObject(model).toObject(AccountsListResponse.class); Assertions.assertEquals("ithxqhabifpi", model.value().get(0).organizationId()); Assertions.assertEquals("wczbys", model.value().get(0).accountId()); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java index 8b390223fdc4f..27583fe61d9ff 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java @@ -11,26 +11,21 @@ public final class AppServiceInfoInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AppServiceInfoInner model = - BinaryData - .fromString( - "{\"azureResourceId\":\"azjdyggd\",\"agentVersion\":\"ixhbkuofqweykhm\",\"agentStatus\":\"evfyexfwhybcib\"}") - .toObject(AppServiceInfoInner.class); - Assertions.assertEquals("azjdyggd", model.azureResourceId()); - Assertions.assertEquals("ixhbkuofqweykhm", model.agentVersion()); - Assertions.assertEquals("evfyexfwhybcib", model.agentStatus()); + AppServiceInfoInner model = BinaryData.fromString( + "{\"azureResourceId\":\"zvddntwndeicbtwn\",\"agentVersion\":\"aoqvuh\",\"agentStatus\":\"cffcyddglmj\"}") + .toObject(AppServiceInfoInner.class); + Assertions.assertEquals("zvddntwndeicbtwn", model.azureResourceId()); + Assertions.assertEquals("aoqvuh", model.agentVersion()); + Assertions.assertEquals("cffcyddglmj", model.agentStatus()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AppServiceInfoInner model = - new AppServiceInfoInner() - .withAzureResourceId("azjdyggd") - .withAgentVersion("ixhbkuofqweykhm") - .withAgentStatus("evfyexfwhybcib"); + AppServiceInfoInner model = new AppServiceInfoInner().withAzureResourceId("zvddntwndeicbtwn") + .withAgentVersion("aoqvuh").withAgentStatus("cffcyddglmj"); model = BinaryData.fromObject(model).toObject(AppServiceInfoInner.class); - Assertions.assertEquals("azjdyggd", model.azureResourceId()); - Assertions.assertEquals("ixhbkuofqweykhm", model.agentVersion()); - Assertions.assertEquals("evfyexfwhybcib", model.agentStatus()); + Assertions.assertEquals("zvddntwndeicbtwn", model.azureResourceId()); + Assertions.assertEquals("aoqvuh", model.agentVersion()); + Assertions.assertEquals("cffcyddglmj", model.agentStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java index 01035bd93e677..7a9edc9df892a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java @@ -12,20 +12,19 @@ public final class AppServicesGetRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AppServicesGetRequest model = - BinaryData - .fromString("{\"azureResourceIds\":[\"dudgwdslfhot\"],\"userEmail\":\"mcy\"}") + AppServicesGetRequest model + = BinaryData.fromString("{\"azureResourceIds\":[\"sglumma\",\"tjaodxobnb\"],\"userEmail\":\"xkqpxo\"}") .toObject(AppServicesGetRequest.class); - Assertions.assertEquals("dudgwdslfhot", model.azureResourceIds().get(0)); - Assertions.assertEquals("mcy", model.userEmail()); + Assertions.assertEquals("sglumma", model.azureResourceIds().get(0)); + Assertions.assertEquals("xkqpxo", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AppServicesGetRequest model = - new AppServicesGetRequest().withAzureResourceIds(Arrays.asList("dudgwdslfhot")).withUserEmail("mcy"); + AppServicesGetRequest model = new AppServicesGetRequest() + .withAzureResourceIds(Arrays.asList("sglumma", "tjaodxobnb")).withUserEmail("xkqpxo"); model = BinaryData.fromObject(model).toObject(AppServicesGetRequest.class); - Assertions.assertEquals("dudgwdslfhot", model.azureResourceIds().get(0)); - Assertions.assertEquals("mcy", model.userEmail()); + Assertions.assertEquals("sglumma", model.azureResourceIds().get(0)); + Assertions.assertEquals("xkqpxo", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java index 82be020a7c68a..5c9b265cd9863 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java @@ -13,37 +13,30 @@ public final class AppServicesListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AppServicesListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"azureResourceId\":\"lbjnpgacftadehx\",\"agentVersion\":\"tyfsoppusuesn\",\"agentStatus\":\"dejbavo\"},{\"azureResourceId\":\"zdmohctbqvu\",\"agentVersion\":\"xdn\",\"agentStatus\":\"vo\"}],\"nextLink\":\"ujjugwdkcglh\"}") - .toObject(AppServicesListResponse.class); - Assertions.assertEquals("lbjnpgacftadehx", model.value().get(0).azureResourceId()); - Assertions.assertEquals("tyfsoppusuesn", model.value().get(0).agentVersion()); - Assertions.assertEquals("dejbavo", model.value().get(0).agentStatus()); - Assertions.assertEquals("ujjugwdkcglh", model.nextLink()); + AppServicesListResponse model = BinaryData.fromString( + "{\"value\":[{\"azureResourceId\":\"ionpimexg\",\"agentVersion\":\"xgcp\",\"agentStatus\":\"gmaajrm\"},{\"azureResourceId\":\"jwzrl\",\"agentVersion\":\"mcl\",\"agentStatus\":\"ijcoejctb\"},{\"azureResourceId\":\"qsqsy\",\"agentVersion\":\"kbfkg\",\"agentStatus\":\"dkexxppofm\"},{\"azureResourceId\":\"x\",\"agentVersion\":\"jpgd\",\"agentStatus\":\"ocjjxhvpmouexh\"}],\"nextLink\":\"xibqeojnx\"}") + .toObject(AppServicesListResponse.class); + Assertions.assertEquals("ionpimexg", model.value().get(0).azureResourceId()); + Assertions.assertEquals("xgcp", model.value().get(0).agentVersion()); + Assertions.assertEquals("gmaajrm", model.value().get(0).agentStatus()); + Assertions.assertEquals("xibqeojnx", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AppServicesListResponse model = - new AppServicesListResponse() - .withValue( - Arrays - .asList( - new AppServiceInfoInner() - .withAzureResourceId("lbjnpgacftadehx") - .withAgentVersion("tyfsoppusuesn") - .withAgentStatus("dejbavo"), - new AppServiceInfoInner() - .withAzureResourceId("zdmohctbqvu") - .withAgentVersion("xdn") - .withAgentStatus("vo"))) - .withNextLink("ujjugwdkcglh"); + AppServicesListResponse model = new AppServicesListResponse().withValue(Arrays.asList( + new AppServiceInfoInner().withAzureResourceId("ionpimexg").withAgentVersion("xgcp") + .withAgentStatus("gmaajrm"), + new AppServiceInfoInner().withAzureResourceId("jwzrl").withAgentVersion("mcl").withAgentStatus("ijcoejctb"), + new AppServiceInfoInner().withAzureResourceId("qsqsy").withAgentVersion("kbfkg") + .withAgentStatus("dkexxppofm"), + new AppServiceInfoInner().withAzureResourceId("x").withAgentVersion("jpgd") + .withAgentStatus("ocjjxhvpmouexh"))) + .withNextLink("xibqeojnx"); model = BinaryData.fromObject(model).toObject(AppServicesListResponse.class); - Assertions.assertEquals("lbjnpgacftadehx", model.value().get(0).azureResourceId()); - Assertions.assertEquals("tyfsoppusuesn", model.value().get(0).agentVersion()); - Assertions.assertEquals("dejbavo", model.value().get(0).agentStatus()); - Assertions.assertEquals("ujjugwdkcglh", model.nextLink()); + Assertions.assertEquals("ionpimexg", model.value().get(0).azureResourceId()); + Assertions.assertEquals("xgcp", model.value().get(0).agentVersion()); + Assertions.assertEquals("gmaajrm", model.value().get(0).agentStatus()); + Assertions.assertEquals("xibqeojnx", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoResponseInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoResponseInnerTests.java new file mode 100644 index 0000000000000..ac913034b5fbe --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoResponseInnerTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner; +import com.azure.resourcemanager.newrelicobservability.models.MarketplaceSaaSInfo; +import com.azure.resourcemanager.newrelicobservability.models.PartnerBillingEntity; +import org.junit.jupiter.api.Assertions; + +public final class BillingInfoResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BillingInfoResponseInner model = BinaryData.fromString( + "{\"marketplaceSaasInfo\":{\"marketplaceSubscriptionId\":\"eo\",\"marketplaceSubscriptionName\":\"okeyyienj\",\"marketplaceResourceId\":\"lwtgrhpdj\",\"marketplaceStatus\":\"umasxazjpq\",\"billedAzureSubscriptionId\":\"gual\"},\"partnerBillingEntity\":{\"organizationId\":\"xhejjzzvdud\",\"organizationName\":\"dslfhotwmcy\"}}") + .toObject(BillingInfoResponseInner.class); + Assertions.assertEquals("eo", model.marketplaceSaasInfo().marketplaceSubscriptionId()); + Assertions.assertEquals("okeyyienj", model.marketplaceSaasInfo().marketplaceSubscriptionName()); + Assertions.assertEquals("lwtgrhpdj", model.marketplaceSaasInfo().marketplaceResourceId()); + Assertions.assertEquals("umasxazjpq", model.marketplaceSaasInfo().marketplaceStatus()); + Assertions.assertEquals("gual", model.marketplaceSaasInfo().billedAzureSubscriptionId()); + Assertions.assertEquals("xhejjzzvdud", model.partnerBillingEntity().organizationId()); + Assertions.assertEquals("dslfhotwmcy", model.partnerBillingEntity().organizationName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BillingInfoResponseInner model + = new BillingInfoResponseInner() + .withMarketplaceSaasInfo(new MarketplaceSaaSInfo().withMarketplaceSubscriptionId("eo") + .withMarketplaceSubscriptionName("okeyyienj").withMarketplaceResourceId("lwtgrhpdj") + .withMarketplaceStatus("umasxazjpq").withBilledAzureSubscriptionId("gual")) + .withPartnerBillingEntity( + new PartnerBillingEntity().withOrganizationId("xhejjzzvdud").withOrganizationName("dslfhotwmcy")); + model = BinaryData.fromObject(model).toObject(BillingInfoResponseInner.class); + Assertions.assertEquals("eo", model.marketplaceSaasInfo().marketplaceSubscriptionId()); + Assertions.assertEquals("okeyyienj", model.marketplaceSaasInfo().marketplaceSubscriptionName()); + Assertions.assertEquals("lwtgrhpdj", model.marketplaceSaasInfo().marketplaceResourceId()); + Assertions.assertEquals("umasxazjpq", model.marketplaceSaasInfo().marketplaceStatus()); + Assertions.assertEquals("gual", model.marketplaceSaasInfo().billedAzureSubscriptionId()); + Assertions.assertEquals("xhejjzzvdud", model.partnerBillingEntity().organizationId()); + Assertions.assertEquals("dslfhotwmcy", model.partnerBillingEntity().organizationName()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoesGetWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoesGetWithResponseMockTests.java new file mode 100644 index 0000000000000..7af2eaa89e6bd --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoesGetWithResponseMockTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; +import com.azure.resourcemanager.newrelicobservability.models.BillingInfoResponse; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class BillingInfoesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"marketplaceSaasInfo\":{\"marketplaceSubscriptionId\":\"mkcxozapvh\",\"marketplaceSubscriptionName\":\"xprglyatddc\",\"marketplaceResourceId\":\"bcuejrjxgci\",\"marketplaceStatus\":\"brh\",\"billedAzureSubscriptionId\":\"xsdqrhzoymibmrqy\"},\"partnerBillingEntity\":{\"organizationId\":\"hwflu\",\"organizationName\":\"dtmhrkwofyyvoqa\"}}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + BillingInfoResponse response = manager.billingInfoes() + .getWithResponse("gkopkwhojvpajqgx", "smocmbq", com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("mkcxozapvh", response.marketplaceSaasInfo().marketplaceSubscriptionId()); + Assertions.assertEquals("xprglyatddc", response.marketplaceSaasInfo().marketplaceSubscriptionName()); + Assertions.assertEquals("bcuejrjxgci", response.marketplaceSaasInfo().marketplaceResourceId()); + Assertions.assertEquals("brh", response.marketplaceSaasInfo().marketplaceStatus()); + Assertions.assertEquals("xsdqrhzoymibmrqy", response.marketplaceSaasInfo().billedAzureSubscriptionId()); + Assertions.assertEquals("hwflu", response.partnerBillingEntity().organizationId()); + Assertions.assertEquals("dtmhrkwofyyvoqa", response.partnerBillingEntity().organizationName()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcePropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcePropertiesTests.java new file mode 100644 index 0000000000000..0ff45eea2894a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcePropertiesTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourceProperties; +import org.junit.jupiter.api.Assertions; + +public final class ConnectedPartnerResourcePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectedPartnerResourceProperties model = BinaryData.fromString( + "{\"accountName\":\"agfuaxbezyiu\",\"accountId\":\"ktwh\",\"azureResourceId\":\"xw\",\"location\":\"wqsmbsur\"}") + .toObject(ConnectedPartnerResourceProperties.class); + Assertions.assertEquals("agfuaxbezyiu", model.accountName()); + Assertions.assertEquals("ktwh", model.accountId()); + Assertions.assertEquals("xw", model.azureResourceId()); + Assertions.assertEquals("wqsmbsur", model.location()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectedPartnerResourceProperties model = new ConnectedPartnerResourceProperties() + .withAccountName("agfuaxbezyiu").withAccountId("ktwh").withAzureResourceId("xw").withLocation("wqsmbsur"); + model = BinaryData.fromObject(model).toObject(ConnectedPartnerResourceProperties.class); + Assertions.assertEquals("agfuaxbezyiu", model.accountName()); + Assertions.assertEquals("ktwh", model.accountId()); + Assertions.assertEquals("xw", model.azureResourceId()); + Assertions.assertEquals("wqsmbsur", model.location()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListFormatInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListFormatInnerTests.java new file mode 100644 index 0000000000000..3041d13cc693d --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListFormatInnerTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourceProperties; +import org.junit.jupiter.api.Assertions; + +public final class ConnectedPartnerResourcesListFormatInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectedPartnerResourcesListFormatInner model = BinaryData.fromString( + "{\"properties\":{\"accountName\":\"eupfhyhltrpm\",\"accountId\":\"jmcmatuokthfu\",\"azureResourceId\":\"aodsfcpkv\",\"location\":\"dpuozmyz\"}}") + .toObject(ConnectedPartnerResourcesListFormatInner.class); + Assertions.assertEquals("eupfhyhltrpm", model.properties().accountName()); + Assertions.assertEquals("jmcmatuokthfu", model.properties().accountId()); + Assertions.assertEquals("aodsfcpkv", model.properties().azureResourceId()); + Assertions.assertEquals("dpuozmyz", model.properties().location()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectedPartnerResourcesListFormatInner model = new ConnectedPartnerResourcesListFormatInner() + .withProperties(new ConnectedPartnerResourceProperties().withAccountName("eupfhyhltrpm") + .withAccountId("jmcmatuokthfu").withAzureResourceId("aodsfcpkv").withLocation("dpuozmyz")); + model = BinaryData.fromObject(model).toObject(ConnectedPartnerResourcesListFormatInner.class); + Assertions.assertEquals("eupfhyhltrpm", model.properties().accountName()); + Assertions.assertEquals("jmcmatuokthfu", model.properties().accountId()); + Assertions.assertEquals("aodsfcpkv", model.properties().azureResourceId()); + Assertions.assertEquals("dpuozmyz", model.properties().location()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListMockTests.java new file mode 100644 index 0000000000000..95921a1bd289b --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListMockTests.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListFormat; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class ConnectedPartnerResourcesListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"value\":[{\"properties\":{\"accountName\":\"nqxwbp\",\"accountId\":\"ulpiuj\",\"azureResourceId\":\"asipqiio\",\"location\":\"uqerpqlpqwc\"}}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.connectedPartnerResources() + .list("piexpbtgiw", "wo", "nwashrtd", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("nqxwbp", response.iterator().next().properties().accountName()); + Assertions.assertEquals("ulpiuj", response.iterator().next().properties().accountId()); + Assertions.assertEquals("asipqiio", response.iterator().next().properties().azureResourceId()); + Assertions.assertEquals("uqerpqlpqwc", response.iterator().next().properties().location()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListResponseTests.java new file mode 100644 index 0000000000000..807c3cfa111ee --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListResponseTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourceProperties; +import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListResponse; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ConnectedPartnerResourcesListResponseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectedPartnerResourcesListResponse model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"accountName\":\"ggd\",\"accountId\":\"ixhbkuofqweykhm\",\"azureResourceId\":\"evfyexfwhybcib\",\"location\":\"vdcsitynn\"}},{\"properties\":{\"accountName\":\"dectehfiqsc\",\"accountId\":\"ypvhezrkg\",\"azureResourceId\":\"c\",\"location\":\"efovgmk\"}},{\"properties\":{\"accountName\":\"eyyvxyqjpkcat\",\"accountId\":\"ngj\",\"azureResourceId\":\"cczsq\",\"location\":\"hvmdajvnysounq\"}}],\"nextLink\":\"a\"}") + .toObject(ConnectedPartnerResourcesListResponse.class); + Assertions.assertEquals("ggd", model.value().get(0).properties().accountName()); + Assertions.assertEquals("ixhbkuofqweykhm", model.value().get(0).properties().accountId()); + Assertions.assertEquals("evfyexfwhybcib", model.value().get(0).properties().azureResourceId()); + Assertions.assertEquals("vdcsitynn", model.value().get(0).properties().location()); + Assertions.assertEquals("a", model.nextLink()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectedPartnerResourcesListResponse model = new ConnectedPartnerResourcesListResponse() + .withValue(Arrays.asList( + new ConnectedPartnerResourcesListFormatInner().withProperties( + new ConnectedPartnerResourceProperties().withAccountName("ggd").withAccountId("ixhbkuofqweykhm") + .withAzureResourceId("evfyexfwhybcib").withLocation("vdcsitynn")), + new ConnectedPartnerResourcesListFormatInner() + .withProperties(new ConnectedPartnerResourceProperties().withAccountName("dectehfiqsc") + .withAccountId("ypvhezrkg").withAzureResourceId("c").withLocation("efovgmk")), + new ConnectedPartnerResourcesListFormatInner() + .withProperties(new ConnectedPartnerResourceProperties().withAccountName("eyyvxyqjpkcat") + .withAccountId("ngj").withAzureResourceId("cczsq").withLocation("hvmdajvnysounq")))) + .withNextLink("a"); + model = BinaryData.fromObject(model).toObject(ConnectedPartnerResourcesListResponse.class); + Assertions.assertEquals("ggd", model.value().get(0).properties().accountName()); + Assertions.assertEquals("ixhbkuofqweykhm", model.value().get(0).properties().accountId()); + Assertions.assertEquals("evfyexfwhybcib", model.value().get(0).properties().azureResourceId()); + Assertions.assertEquals("vdcsitynn", model.value().get(0).properties().location()); + Assertions.assertEquals("a", model.nextLink()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java index cdb298e9303bd..fb4a30587bf47 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java @@ -12,22 +12,19 @@ public final class FilteringTagTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FilteringTag model = - BinaryData - .fromString("{\"name\":\"nqvpkvlrxnje\",\"value\":\"eipheoflokeyy\",\"action\":\"Include\"}") - .toObject(FilteringTag.class); - Assertions.assertEquals("nqvpkvlrxnje", model.name()); - Assertions.assertEquals("eipheoflokeyy", model.value()); - Assertions.assertEquals(TagAction.INCLUDE, model.action()); + FilteringTag model = BinaryData.fromString("{\"name\":\"ajzyul\",\"value\":\"u\",\"action\":\"Exclude\"}") + .toObject(FilteringTag.class); + Assertions.assertEquals("ajzyul", model.name()); + Assertions.assertEquals("u", model.value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FilteringTag model = - new FilteringTag().withName("nqvpkvlrxnje").withValue("eipheoflokeyy").withAction(TagAction.INCLUDE); + FilteringTag model = new FilteringTag().withName("ajzyul").withValue("u").withAction(TagAction.EXCLUDE); model = BinaryData.fromObject(model).toObject(FilteringTag.class); - Assertions.assertEquals("nqvpkvlrxnje", model.name()); - Assertions.assertEquals("eipheoflokeyy", model.value()); - Assertions.assertEquals(TagAction.INCLUDE, model.action()); + Assertions.assertEquals("ajzyul", model.name()); + Assertions.assertEquals("u", model.value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.action()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java index a16732f0db83b..2dc98d1789da7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java @@ -12,20 +12,18 @@ public final class HostsGetRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - HostsGetRequest model = - BinaryData - .fromString("{\"vmIds\":[\"xyqj\",\"k\",\"attpngjcrcczsq\",\"jh\"],\"userEmail\":\"mdajv\"}") - .toObject(HostsGetRequest.class); - Assertions.assertEquals("xyqj", model.vmIds().get(0)); - Assertions.assertEquals("mdajv", model.userEmail()); + HostsGetRequest model = BinaryData.fromString("{\"vmIds\":[\"uhrzayvvt\"],\"userEmail\":\"gvdfgiotkftutq\"}") + .toObject(HostsGetRequest.class); + Assertions.assertEquals("uhrzayvvt", model.vmIds().get(0)); + Assertions.assertEquals("gvdfgiotkftutq", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HostsGetRequest model = - new HostsGetRequest().withVmIds(Arrays.asList("xyqj", "k", "attpngjcrcczsq", "jh")).withUserEmail("mdajv"); + HostsGetRequest model + = new HostsGetRequest().withVmIds(Arrays.asList("uhrzayvvt")).withUserEmail("gvdfgiotkftutq"); model = BinaryData.fromObject(model).toObject(HostsGetRequest.class); - Assertions.assertEquals("xyqj", model.vmIds().get(0)); - Assertions.assertEquals("mdajv", model.userEmail()); + Assertions.assertEquals("uhrzayvvt", model.vmIds().get(0)); + Assertions.assertEquals("gvdfgiotkftutq", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceInnerTests.java new file mode 100644 index 0000000000000..b66a3d9a7dfc1 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; +import org.junit.jupiter.api.Assertions; + +public final class LinkedResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LinkedResourceInner model = BinaryData.fromString("{\"id\":\"hkfpbs\"}").toObject(LinkedResourceInner.class); + Assertions.assertEquals("hkfpbs", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LinkedResourceInner model = new LinkedResourceInner().withId("hkfpbs"); + model = BinaryData.fromObject(model).toObject(LinkedResourceInner.class); + Assertions.assertEquals("hkfpbs", model.id()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceListResponseTests.java new file mode 100644 index 0000000000000..9f573a57da3f0 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceListResponseTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; +import com.azure.resourcemanager.newrelicobservability.models.LinkedResourceListResponse; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class LinkedResourceListResponseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LinkedResourceListResponse model = BinaryData.fromString( + "{\"value\":[{\"id\":\"ovawjvzunlu\"},{\"id\":\"nnprn\"},{\"id\":\"peilpjzuaejxdu\"},{\"id\":\"skzbb\"}],\"nextLink\":\"zumveekgpwo\"}") + .toObject(LinkedResourceListResponse.class); + Assertions.assertEquals("ovawjvzunlu", model.value().get(0).id()); + Assertions.assertEquals("zumveekgpwo", model.nextLink()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LinkedResourceListResponse model = new LinkedResourceListResponse().withValue( + Arrays.asList(new LinkedResourceInner().withId("ovawjvzunlu"), new LinkedResourceInner().withId("nnprn"), + new LinkedResourceInner().withId("peilpjzuaejxdu"), new LinkedResourceInner().withId("skzbb"))) + .withNextLink("zumveekgpwo"); + model = BinaryData.fromObject(model).toObject(LinkedResourceListResponse.class); + Assertions.assertEquals("ovawjvzunlu", model.value().get(0).id()); + Assertions.assertEquals("zumveekgpwo", model.nextLink()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java index ea9ee3973b43b..0ef82e45e76e6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java @@ -17,45 +17,32 @@ public final class LogRulesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LogRules model = - BinaryData - .fromString( - "{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"gyxzk\",\"value\":\"ocukoklyax\",\"action\":\"Include\"},{\"name\":\"uqszfk\",\"value\":\"ypewrmjmwvvjekt\",\"action\":\"Include\"},{\"name\":\"nhwlrsffrzpwvl\",\"value\":\"q\",\"action\":\"Exclude\"},{\"name\":\"ylihkaetckt\",\"value\":\"civfsnkymuctq\",\"action\":\"Exclude\"}]}") - .toObject(LogRules.class); - Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.sendActivityLogs()); - Assertions.assertEquals("gyxzk", model.filteringTags().get(0).name()); - Assertions.assertEquals("ocukoklyax", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); + LogRules model = BinaryData.fromString( + "{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"cohoq\",\"value\":\"wvl\",\"action\":\"Exclude\"},{\"name\":\"w\",\"value\":\"eun\",\"action\":\"Exclude\"},{\"name\":\"gyxzk\",\"value\":\"ocukoklyax\",\"action\":\"Include\"},{\"name\":\"uqszfk\",\"value\":\"ypewrmjmwvvjekt\",\"action\":\"Include\"}]}") + .toObject(LogRules.class); + Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.sendActivityLogs()); + Assertions.assertEquals("cohoq", model.filteringTags().get(0).name()); + Assertions.assertEquals("wvl", model.filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogRules model = - new LogRules() - .withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag().withName("gyxzk").withValue("ocukoklyax").withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("uqszfk") - .withValue("ypewrmjmwvvjekt") - .withAction(TagAction.INCLUDE), - new FilteringTag().withName("nhwlrsffrzpwvl").withValue("q").withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("ylihkaetckt") - .withValue("civfsnkymuctq") - .withAction(TagAction.EXCLUDE))); + LogRules model = new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED).withFilteringTags( + Arrays.asList(new FilteringTag().withName("cohoq").withValue("wvl").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("w").withValue("eun").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("gyxzk").withValue("ocukoklyax").withAction(TagAction.INCLUDE), + new FilteringTag().withName("uqszfk").withValue("ypewrmjmwvvjekt").withAction(TagAction.INCLUDE))); model = BinaryData.fromObject(model).toObject(LogRules.class); - Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.sendActivityLogs()); - Assertions.assertEquals("gyxzk", model.filteringTags().get(0).name()); - Assertions.assertEquals("ocukoklyax", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); + Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.sendActivityLogs()); + Assertions.assertEquals("cohoq", model.filteringTags().get(0).name()); + Assertions.assertEquals("wvl", model.filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java index f37b181498ebb..0bc0dc5b97a3f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java @@ -15,25 +15,22 @@ public final class ManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ManagedServiceIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"ed20690c-0d99-4300-bd3f-e89837be9fd9\",\"tenantId\":\"07795c14-51aa-4339-8acf-2795ce44c27e\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"t\":{\"principalId\":\"043c8a2a-aab2-4c2d-8beb-1803d690866b\",\"clientId\":\"307e5b23-1b85-4b79-bd0a-0d69d7d7813a\"},\"zzvypyqrimzinp\":{\"principalId\":\"ad3f8f30-f7c2-427b-bca6-ad05c8cbe214\",\"clientId\":\"780adc1c-eea6-4973-bb5a-d44abed6a269\"}}}") - .toObject(ManagedServiceIdentity.class); + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"0d515111-0dc0-4c79-ae35-bca8b0ff4154\",\"tenantId\":\"b65466f3-b3f7-4db6-b20d-92b39e36d15a\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ouskcqvkocrc\":{\"principalId\":\"edbc0ee6-6ed1-423a-914c-efc493826b54\",\"clientId\":\"38be2d04-ad2e-40ed-97c8-a81b5638be65\"},\"wtnhxbnjbiksqr\":{\"principalId\":\"1f47b747-1ebc-4183-996a-5fb0848fa847\",\"clientId\":\"58511d65-2fdb-49a0-aed6-0629aae71d97\"}}}") + .toObject(ManagedServiceIdentity.class); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedServiceIdentity model = - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("t", new UserAssignedIdentity(), "zzvypyqrimzinp", new UserAssignedIdentity())); + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("ouskcqvkocrc", new UserAssignedIdentity(), "wtnhxbnjbiksqr", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MarketplaceSaaSInfoTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MarketplaceSaaSInfoTests.java new file mode 100644 index 0000000000000..13869be1149ad --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MarketplaceSaaSInfoTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.models.MarketplaceSaaSInfo; +import org.junit.jupiter.api.Assertions; + +public final class MarketplaceSaaSInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MarketplaceSaaSInfo model = BinaryData.fromString( + "{\"marketplaceSubscriptionId\":\"wlbjnpgacftade\",\"marketplaceSubscriptionName\":\"nltyfsoppusuesnz\",\"marketplaceResourceId\":\"ej\",\"marketplaceStatus\":\"vorxzdmohct\",\"billedAzureSubscriptionId\":\"vudwx\"}") + .toObject(MarketplaceSaaSInfo.class); + Assertions.assertEquals("wlbjnpgacftade", model.marketplaceSubscriptionId()); + Assertions.assertEquals("nltyfsoppusuesnz", model.marketplaceSubscriptionName()); + Assertions.assertEquals("ej", model.marketplaceResourceId()); + Assertions.assertEquals("vorxzdmohct", model.marketplaceStatus()); + Assertions.assertEquals("vudwx", model.billedAzureSubscriptionId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MarketplaceSaaSInfo model = new MarketplaceSaaSInfo().withMarketplaceSubscriptionId("wlbjnpgacftade") + .withMarketplaceSubscriptionName("nltyfsoppusuesnz").withMarketplaceResourceId("ej") + .withMarketplaceStatus("vorxzdmohct").withBilledAzureSubscriptionId("vudwx"); + model = BinaryData.fromObject(model).toObject(MarketplaceSaaSInfo.class); + Assertions.assertEquals("wlbjnpgacftade", model.marketplaceSubscriptionId()); + Assertions.assertEquals("nltyfsoppusuesnz", model.marketplaceSubscriptionName()); + Assertions.assertEquals("ej", model.marketplaceResourceId()); + Assertions.assertEquals("vorxzdmohct", model.marketplaceStatus()); + Assertions.assertEquals("vudwx", model.billedAzureSubscriptionId()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java index f55f60fa3e462..afcb03cd0f1e4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java @@ -15,39 +15,29 @@ public final class MetricRulesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricRulesInner model = - BinaryData - .fromString( - "{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"m\",\"value\":\"qabcypm\",\"action\":\"Exclude\"},{\"name\":\"lzu\",\"value\":\"c\",\"action\":\"Exclude\"},{\"name\":\"nbacfi\",\"value\":\"l\",\"action\":\"Include\"},{\"name\":\"tqgtzxdpnqbqq\",\"value\":\"rjfeallnwsubisnj\",\"action\":\"Include\"}],\"userEmail\":\"ngnzscxaqwoochc\"}") - .toObject(MetricRulesInner.class); + MetricRulesInner model = BinaryData.fromString( + "{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"dsoifiyipj\",\"value\":\"qwpgrjbzn\",\"action\":\"Exclude\"},{\"name\":\"xv\",\"value\":\"byxqabn\",\"action\":\"Include\"},{\"name\":\"cyshurzafbljjgp\",\"value\":\"oq\",\"action\":\"Include\"}],\"userEmail\":\"ljavbqid\"}") + .toObject(MetricRulesInner.class); Assertions.assertEquals(SendMetricsStatus.ENABLED, model.sendMetrics()); - Assertions.assertEquals("m", model.filteringTags().get(0).name()); - Assertions.assertEquals("qabcypm", model.filteringTags().get(0).value()); + Assertions.assertEquals("dsoifiyipj", model.filteringTags().get(0).name()); + Assertions.assertEquals("qwpgrjbzn", model.filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); - Assertions.assertEquals("ngnzscxaqwoochc", model.userEmail()); + Assertions.assertEquals("ljavbqid", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MetricRulesInner model = - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag().withName("m").withValue("qabcypm").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("lzu").withValue("c").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("nbacfi").withValue("l").withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("tqgtzxdpnqbqq") - .withValue("rjfeallnwsubisnj") - .withAction(TagAction.INCLUDE))) - .withUserEmail("ngnzscxaqwoochc"); + MetricRulesInner model = new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("dsoifiyipj").withValue("qwpgrjbzn").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("xv").withValue("byxqabn").withAction(TagAction.INCLUDE), + new FilteringTag().withName("cyshurzafbljjgp").withValue("oq").withAction(TagAction.INCLUDE))) + .withUserEmail("ljavbqid"); model = BinaryData.fromObject(model).toObject(MetricRulesInner.class); Assertions.assertEquals(SendMetricsStatus.ENABLED, model.sendMetrics()); - Assertions.assertEquals("m", model.filteringTags().get(0).name()); - Assertions.assertEquals("qabcypm", model.filteringTags().get(0).value()); + Assertions.assertEquals("dsoifiyipj", model.filteringTags().get(0).name()); + Assertions.assertEquals("qwpgrjbzn", model.filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); - Assertions.assertEquals("ngnzscxaqwoochc", model.userEmail()); + Assertions.assertEquals("ljavbqid", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java index f75bed659942b..01a90ad8d6ed4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java @@ -11,14 +11,15 @@ public final class MetricsRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricsRequest model = BinaryData.fromString("{\"userEmail\":\"ofsx\"}").toObject(MetricsRequest.class); - Assertions.assertEquals("ofsx", model.userEmail()); + MetricsRequest model + = BinaryData.fromString("{\"userEmail\":\"rsoodqxhcrmnoh\"}").toObject(MetricsRequest.class); + Assertions.assertEquals("rsoodqxhcrmnoh", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MetricsRequest model = new MetricsRequest().withUserEmail("ofsx"); + MetricsRequest model = new MetricsRequest().withUserEmail("rsoodqxhcrmnoh"); model = BinaryData.fromObject(model).toObject(MetricsRequest.class); - Assertions.assertEquals("ofsx", model.userEmail()); + Assertions.assertEquals("rsoodqxhcrmnoh", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java index 3de4e83529a50..736ace07e176f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java @@ -12,23 +12,19 @@ public final class MetricsStatusRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricsStatusRequest model = - BinaryData - .fromString( - "{\"azureResourceIds\":[\"dlwtgrhpdj\",\"jumasx\",\"zj\",\"qyeg\"],\"userEmail\":\"alhbx\"}") + MetricsStatusRequest model + = BinaryData.fromString("{\"azureResourceIds\":[\"khbzhfepgzg\",\"e\"],\"userEmail\":\"zloc\"}") .toObject(MetricsStatusRequest.class); - Assertions.assertEquals("dlwtgrhpdj", model.azureResourceIds().get(0)); - Assertions.assertEquals("alhbx", model.userEmail()); + Assertions.assertEquals("khbzhfepgzg", model.azureResourceIds().get(0)); + Assertions.assertEquals("zloc", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MetricsStatusRequest model = - new MetricsStatusRequest() - .withAzureResourceIds(Arrays.asList("dlwtgrhpdj", "jumasx", "zj", "qyeg")) - .withUserEmail("alhbx"); + MetricsStatusRequest model + = new MetricsStatusRequest().withAzureResourceIds(Arrays.asList("khbzhfepgzg", "e")).withUserEmail("zloc"); model = BinaryData.fromObject(model).toObject(MetricsStatusRequest.class); - Assertions.assertEquals("dlwtgrhpdj", model.azureResourceIds().get(0)); - Assertions.assertEquals("alhbx", model.userEmail()); + Assertions.assertEquals("khbzhfepgzg", model.azureResourceIds().get(0)); + Assertions.assertEquals("zloc", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java index b1a22fb7525fb..a70fc21e72ec4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java @@ -12,15 +12,16 @@ public final class MetricsStatusResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricsStatusResponseInner model = - BinaryData.fromString("{\"azureResourceIds\":[\"jj\"]}").toObject(MetricsStatusResponseInner.class); - Assertions.assertEquals("jj", model.azureResourceIds().get(0)); + MetricsStatusResponseInner model + = BinaryData.fromString("{\"azureResourceIds\":[\"paierh\"]}").toObject(MetricsStatusResponseInner.class); + Assertions.assertEquals("paierh", model.azureResourceIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MetricsStatusResponseInner model = new MetricsStatusResponseInner().withAzureResourceIds(Arrays.asList("jj")); + MetricsStatusResponseInner model + = new MetricsStatusResponseInner().withAzureResourceIds(Arrays.asList("paierh")); model = BinaryData.fromObject(model).toObject(MetricsStatusResponseInner.class); - Assertions.assertEquals("jj", model.azureResourceIds().get(0)); + Assertions.assertEquals("paierh", model.azureResourceIds().get(0)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java index b73a117dc48a6..244fa6cf1ca0b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java @@ -13,32 +13,26 @@ public final class MonitoredResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MonitoredResourceInner model = - BinaryData - .fromString( - "{\"id\":\"uqkhrsajiwku\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"kg\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"uimjmvx\"}") - .toObject(MonitoredResourceInner.class); - Assertions.assertEquals("uqkhrsajiwku", model.id()); - Assertions.assertEquals(SendingMetricsStatus.ENABLED, model.sendingMetrics()); - Assertions.assertEquals("kg", model.reasonForMetricsStatus()); + MonitoredResourceInner model = BinaryData.fromString( + "{\"id\":\"scxaq\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"hcbonqvpkvlr\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"ase\"}") + .toObject(MonitoredResourceInner.class); + Assertions.assertEquals("scxaq", model.id()); + Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.sendingMetrics()); + Assertions.assertEquals("hcbonqvpkvlr", model.reasonForMetricsStatus()); Assertions.assertEquals(SendingLogsStatus.ENABLED, model.sendingLogs()); - Assertions.assertEquals("uimjmvx", model.reasonForLogsStatus()); + Assertions.assertEquals("ase", model.reasonForLogsStatus()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MonitoredResourceInner model = - new MonitoredResourceInner() - .withId("uqkhrsajiwku") - .withSendingMetrics(SendingMetricsStatus.ENABLED) - .withReasonForMetricsStatus("kg") - .withSendingLogs(SendingLogsStatus.ENABLED) - .withReasonForLogsStatus("uimjmvx"); + MonitoredResourceInner model = new MonitoredResourceInner().withId("scxaq") + .withSendingMetrics(SendingMetricsStatus.DISABLED).withReasonForMetricsStatus("hcbonqvpkvlr") + .withSendingLogs(SendingLogsStatus.ENABLED).withReasonForLogsStatus("ase"); model = BinaryData.fromObject(model).toObject(MonitoredResourceInner.class); - Assertions.assertEquals("uqkhrsajiwku", model.id()); - Assertions.assertEquals(SendingMetricsStatus.ENABLED, model.sendingMetrics()); - Assertions.assertEquals("kg", model.reasonForMetricsStatus()); + Assertions.assertEquals("scxaq", model.id()); + Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.sendingMetrics()); + Assertions.assertEquals("hcbonqvpkvlr", model.reasonForMetricsStatus()); Assertions.assertEquals(SendingLogsStatus.ENABLED, model.sendingLogs()); - Assertions.assertEquals("uimjmvx", model.reasonForLogsStatus()); + Assertions.assertEquals("ase", model.reasonForLogsStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java index 25d9a05d8acb6..7bd478ec30c8a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java @@ -15,57 +15,33 @@ public final class MonitoredResourceListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MonitoredResourceListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"gf\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"ezyiuokktwhrdxw\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"sm\"},{\"id\":\"ureximoryocfs\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"mddystkiiux\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"dxorrqnbpoczv\"},{\"id\":\"fqrvkdvjsllrmvvd\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"kpnpulexxbczwtr\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"zb\"},{\"id\":\"vsovmyokac\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"lhzdobp\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"lb\"}],\"nextLink\":\"nchrkcciww\"}") - .toObject(MonitoredResourceListResponse.class); - Assertions.assertEquals("gf", model.value().get(0).id()); + MonitoredResourceListResponse model = BinaryData.fromString( + "{\"value\":[{\"id\":\"gyncocpecfvmmc\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"xlzevgbmqjqabcy\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"kwlzuvccfwnfn\"},{\"id\":\"cfionl\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"tqgtzxdpnqbqq\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"feallnwsu\"}],\"nextLink\":\"snjampmng\"}") + .toObject(MonitoredResourceListResponse.class); + Assertions.assertEquals("gyncocpecfvmmc", model.value().get(0).id()); Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.value().get(0).sendingMetrics()); - Assertions.assertEquals("ezyiuokktwhrdxw", model.value().get(0).reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.ENABLED, model.value().get(0).sendingLogs()); - Assertions.assertEquals("sm", model.value().get(0).reasonForLogsStatus()); - Assertions.assertEquals("nchrkcciww", model.nextLink()); + Assertions.assertEquals("xlzevgbmqjqabcy", model.value().get(0).reasonForMetricsStatus()); + Assertions.assertEquals(SendingLogsStatus.DISABLED, model.value().get(0).sendingLogs()); + Assertions.assertEquals("kwlzuvccfwnfn", model.value().get(0).reasonForLogsStatus()); + Assertions.assertEquals("snjampmng", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MonitoredResourceListResponse model = - new MonitoredResourceListResponse() - .withValue( - Arrays - .asList( - new MonitoredResourceInner() - .withId("gf") - .withSendingMetrics(SendingMetricsStatus.DISABLED) - .withReasonForMetricsStatus("ezyiuokktwhrdxw") - .withSendingLogs(SendingLogsStatus.ENABLED) - .withReasonForLogsStatus("sm"), - new MonitoredResourceInner() - .withId("ureximoryocfs") - .withSendingMetrics(SendingMetricsStatus.ENABLED) - .withReasonForMetricsStatus("mddystkiiux") - .withSendingLogs(SendingLogsStatus.DISABLED) - .withReasonForLogsStatus("dxorrqnbpoczv"), - new MonitoredResourceInner() - .withId("fqrvkdvjsllrmvvd") - .withSendingMetrics(SendingMetricsStatus.ENABLED) - .withReasonForMetricsStatus("kpnpulexxbczwtr") - .withSendingLogs(SendingLogsStatus.ENABLED) - .withReasonForLogsStatus("zb"), - new MonitoredResourceInner() - .withId("vsovmyokac") - .withSendingMetrics(SendingMetricsStatus.ENABLED) - .withReasonForMetricsStatus("lhzdobp") - .withSendingLogs(SendingLogsStatus.ENABLED) - .withReasonForLogsStatus("lb"))) - .withNextLink("nchrkcciww"); + MonitoredResourceListResponse model = new MonitoredResourceListResponse().withValue(Arrays.asList( + new MonitoredResourceInner().withId("gyncocpecfvmmc").withSendingMetrics(SendingMetricsStatus.DISABLED) + .withReasonForMetricsStatus("xlzevgbmqjqabcy").withSendingLogs(SendingLogsStatus.DISABLED) + .withReasonForLogsStatus("kwlzuvccfwnfn"), + new MonitoredResourceInner().withId("cfionl").withSendingMetrics(SendingMetricsStatus.ENABLED) + .withReasonForMetricsStatus("tqgtzxdpnqbqq").withSendingLogs(SendingLogsStatus.DISABLED) + .withReasonForLogsStatus("feallnwsu"))) + .withNextLink("snjampmng"); model = BinaryData.fromObject(model).toObject(MonitoredResourceListResponse.class); - Assertions.assertEquals("gf", model.value().get(0).id()); + Assertions.assertEquals("gyncocpecfvmmc", model.value().get(0).id()); Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.value().get(0).sendingMetrics()); - Assertions.assertEquals("ezyiuokktwhrdxw", model.value().get(0).reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.ENABLED, model.value().get(0).sendingLogs()); - Assertions.assertEquals("sm", model.value().get(0).reasonForLogsStatus()); - Assertions.assertEquals("nchrkcciww", model.nextLink()); + Assertions.assertEquals("xlzevgbmqjqabcy", model.value().get(0).reasonForMetricsStatus()); + Assertions.assertEquals(SendingLogsStatus.DISABLED, model.value().get(0).sendingLogs()); + Assertions.assertEquals("kwlzuvccfwnfn", model.value().get(0).reasonForLogsStatus()); + Assertions.assertEquals("snjampmng", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionInnerTests.java new file mode 100644 index 0000000000000..3407737ec3807 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionInnerTests.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; +import com.azure.resourcemanager.newrelicobservability.models.LogRules; +import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.Status; +import com.azure.resourcemanager.newrelicobservability.models.TagAction; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MonitoredSubscriptionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MonitoredSubscriptionInner model = BinaryData.fromString( + "{\"subscriptionId\":\"jawgqwg\",\"status\":\"InProgress\",\"error\":\"skxfbk\",\"tagRules\":{\"provisioningState\":\"Accepted\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"uwhvylwzbtdhxujz\",\"value\":\"mpowuwpr\",\"action\":\"Include\"},{\"name\":\"eualupjmkhf\",\"value\":\"bbcswsrtjri\",\"action\":\"Exclude\"},{\"name\":\"pbewtghfgblcgwx\",\"value\":\"lvqhjkbegibtnmx\",\"action\":\"Include\"},{\"name\":\"waloayqcgwr\",\"value\":\"j\",\"action\":\"Include\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"xongmtsavjcbpwxq\",\"value\":\"rknftguvriuhprwm\",\"action\":\"Exclude\"},{\"name\":\"qtayri\",\"value\":\"ro\",\"action\":\"Include\"},{\"name\":\"xrmcqibycnojvk\",\"value\":\"e\",\"action\":\"Exclude\"},{\"name\":\"zvahapjy\",\"value\":\"pvgqzcjrvxdjzlm\",\"action\":\"Exclude\"}],\"userEmail\":\"vu\"}}}") + .toObject(MonitoredSubscriptionInner.class); + Assertions.assertEquals("jawgqwg", model.subscriptionId()); + Assertions.assertEquals(Status.IN_PROGRESS, model.status()); + Assertions.assertEquals("skxfbk", model.error()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.tagRules().logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, + model.tagRules().logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.tagRules().logRules().sendActivityLogs()); + Assertions.assertEquals("uwhvylwzbtdhxujz", model.tagRules().logRules().filteringTags().get(0).name()); + Assertions.assertEquals("mpowuwpr", model.tagRules().logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.tagRules().logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.tagRules().metricRules().sendMetrics()); + Assertions.assertEquals("xongmtsavjcbpwxq", model.tagRules().metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("rknftguvriuhprwm", model.tagRules().metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.tagRules().metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("vu", model.tagRules().metricRules().userEmail()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MonitoredSubscriptionInner model = new MonitoredSubscriptionInner().withSubscriptionId("jawgqwg") + .withStatus(Status.IN_PROGRESS).withError("skxfbk") + .withTagRules(new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules() + .withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("uwhvylwzbtdhxujz").withValue("mpowuwpr").withAction(TagAction.INCLUDE), + new FilteringTag().withName("eualupjmkhf").withValue("bbcswsrtjri").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("pbewtghfgblcgwx").withValue("lvqhjkbegibtnmx") + .withAction(TagAction.INCLUDE), + new FilteringTag().withName("waloayqcgwr").withValue("j").withAction(TagAction.INCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("xongmtsavjcbpwxq").withValue("rknftguvriuhprwm") + .withAction(TagAction.EXCLUDE), + new FilteringTag().withName("qtayri").withValue("ro").withAction(TagAction.INCLUDE), + new FilteringTag().withName("xrmcqibycnojvk").withValue("e").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("zvahapjy").withValue("pvgqzcjrvxdjzlm") + .withAction(TagAction.EXCLUDE))) + .withUserEmail("vu"))); + model = BinaryData.fromObject(model).toObject(MonitoredSubscriptionInner.class); + Assertions.assertEquals("jawgqwg", model.subscriptionId()); + Assertions.assertEquals(Status.IN_PROGRESS, model.status()); + Assertions.assertEquals("skxfbk", model.error()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.tagRules().logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, + model.tagRules().logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.tagRules().logRules().sendActivityLogs()); + Assertions.assertEquals("uwhvylwzbtdhxujz", model.tagRules().logRules().filteringTags().get(0).name()); + Assertions.assertEquals("mpowuwpr", model.tagRules().logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.tagRules().logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.tagRules().metricRules().sendMetrics()); + Assertions.assertEquals("xongmtsavjcbpwxq", model.tagRules().metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("rknftguvriuhprwm", model.tagRules().metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.tagRules().metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("vu", model.tagRules().metricRules().userEmail()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesInnerTests.java new file mode 100644 index 0000000000000..a7b4213213150 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesInnerTests.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; +import com.azure.resourcemanager.newrelicobservability.models.LogRules; +import com.azure.resourcemanager.newrelicobservability.models.PatchOperation; +import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.Status; +import com.azure.resourcemanager.newrelicobservability.models.SubscriptionList; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MonitoredSubscriptionPropertiesInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MonitoredSubscriptionPropertiesInner model = BinaryData.fromString( + "{\"properties\":{\"patchOperation\":\"AddComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"ywpmueefjzwfqkq\",\"status\":\"InProgress\",\"error\":\"suyonobglaocq\",\"tagRules\":{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{},{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{}],\"userEmail\":\"wfudwpzntxhdzhl\"}}},{\"subscriptionId\":\"jbhckfrlhr\",\"status\":\"Active\",\"error\":\"yvpycanuzbpzk\",\"tagRules\":{\"provisioningState\":\"Accepted\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{},{},{},{}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{},{},{}],\"userEmail\":\"jusrtslhspk\"}}}],\"provisioningState\":\"Updating\"},\"id\":\"maofmxagkv\",\"name\":\"melmqkrha\",\"type\":\"vljua\"}") + .toObject(MonitoredSubscriptionPropertiesInner.class); + Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.properties().patchOperation()); + Assertions.assertEquals("ywpmueefjzwfqkq", + model.properties().monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.IN_PROGRESS, model.properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("suyonobglaocq", model.properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals(SendAadLogsStatus.DISABLED, + model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.DISABLED, + model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendActivityLogs()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, + model.properties().monitoredSubscriptionList().get(0).tagRules().metricRules().sendMetrics()); + Assertions.assertEquals("wfudwpzntxhdzhl", + model.properties().monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MonitoredSubscriptionPropertiesInner model + = new MonitoredSubscriptionPropertiesInner() + .withProperties( + new SubscriptionList() + .withPatchOperation( + PatchOperation.ADD_COMPLETE) + .withMonitoredSubscriptionList( + Arrays + .asList( + new MonitoredSubscriptionInner().withSubscriptionId("ywpmueefjzwfqkq") + .withStatus( + Status.IN_PROGRESS) + .withError("suyonobglaocq") + .withTagRules(new MonitoringTagRulesPropertiesInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withFilteringTags( + Arrays.asList(new FilteringTag(), new FilteringTag()))) + .withMetricRules(new MetricRulesInner() + .withSendMetrics(SendMetricsStatus.DISABLED) + .withFilteringTags(Arrays.asList(new FilteringTag())) + .withUserEmail("wfudwpzntxhdzhl"))), + new MonitoredSubscriptionInner().withSubscriptionId("jbhckfrlhr") + .withStatus(Status.ACTIVE).withError("yvpycanuzbpzk") + .withTagRules(new MonitoringTagRulesPropertiesInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag(), + new FilteringTag(), new FilteringTag()))) + .withMetricRules(new MetricRulesInner() + .withSendMetrics(SendMetricsStatus.ENABLED).withFilteringTags(Arrays + .asList(new FilteringTag(), new FilteringTag(), new FilteringTag())) + .withUserEmail("jusrtslhspk")))))); + model = BinaryData.fromObject(model).toObject(MonitoredSubscriptionPropertiesInner.class); + Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.properties().patchOperation()); + Assertions.assertEquals("ywpmueefjzwfqkq", + model.properties().monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.IN_PROGRESS, model.properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("suyonobglaocq", model.properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals(SendAadLogsStatus.DISABLED, + model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.DISABLED, + model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendActivityLogs()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, + model.properties().monitoredSubscriptionList().get(0).tagRules().metricRules().sendMetrics()); + Assertions.assertEquals("wfudwpzntxhdzhl", + model.properties().monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesListTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesListTests.java new file mode 100644 index 0000000000000..0a0ee0422274b --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesListTests.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionPropertiesList; +import com.azure.resourcemanager.newrelicobservability.models.PatchOperation; +import com.azure.resourcemanager.newrelicobservability.models.Status; +import com.azure.resourcemanager.newrelicobservability.models.SubscriptionList; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MonitoredSubscriptionPropertiesListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MonitoredSubscriptionPropertiesList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"patchOperation\":\"AddComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"kx\",\"status\":\"Deleting\",\"error\":\"pbh\",\"tagRules\":{}},{\"subscriptionId\":\"tkcxywnytnrsy\",\"status\":\"Active\",\"error\":\"dybyxczfclhaa\",\"tagRules\":{}},{\"subscriptionId\":\"abphlw\",\"status\":\"Active\",\"error\":\"ktsthsucocmny\",\"tagRules\":{}},{\"subscriptionId\":\"t\",\"status\":\"Active\",\"error\":\"wrqpue\",\"tagRules\":{}}],\"provisioningState\":\"Succeeded\"},\"id\":\"ywbiexzfeyueax\",\"name\":\"bxu\",\"type\":\"wbhqwal\"},{\"properties\":{\"patchOperation\":\"DeleteComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"epdkzja\",\"status\":\"InProgress\",\"error\":\"rhdwbavxbniw\",\"tagRules\":{}},{\"subscriptionId\":\"wz\",\"status\":\"Failed\",\"error\":\"pgn\",\"tagRules\":{}},{\"subscriptionId\":\"x\",\"status\":\"Failed\",\"error\":\"bzpfzab\",\"tagRules\":{}},{\"subscriptionId\":\"uhxwtctyqiklbbov\",\"status\":\"Failed\",\"error\":\"bhvgy\",\"tagRules\":{}}],\"provisioningState\":\"Succeeded\"},\"id\":\"svmkfssxquk\",\"name\":\"fpl\",\"type\":\"mg\"},{\"properties\":{\"patchOperation\":\"Active\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"deslp\",\"status\":\"InProgress\",\"error\":\"wiyighxpkdw\",\"tagRules\":{}}],\"provisioningState\":\"Updating\"},\"id\":\"uebbaumnyqup\",\"name\":\"deoj\",\"type\":\"a\"},{\"properties\":{\"patchOperation\":\"Active\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"xpsiebtfhvpes\",\"status\":\"Failed\",\"error\":\"rdqmhjjdhtldwkyz\",\"tagRules\":{}},{\"subscriptionId\":\"tkncwsc\",\"status\":\"Deleting\",\"error\":\"xotogtwrupqsxv\",\"tagRules\":{}},{\"subscriptionId\":\"cykvceo\",\"status\":\"Active\",\"error\":\"ovnotyfjfcnjbkcn\",\"tagRules\":{}}],\"provisioningState\":\"Creating\"},\"id\":\"ttkphywpnvjtoqne\",\"name\":\"mclfplphoxuscr\",\"type\":\"abgy\"}],\"nextLink\":\"sbj\"}") + .toObject(MonitoredSubscriptionPropertiesList.class); + Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.value().get(0).properties().patchOperation()); + Assertions.assertEquals("kx", + model.value().get(0).properties().monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.DELETING, + model.value().get(0).properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("pbh", model.value().get(0).properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals("sbj", model.nextLink()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MonitoredSubscriptionPropertiesList model = new MonitoredSubscriptionPropertiesList() + .withValue(Arrays.asList( + new MonitoredSubscriptionPropertiesInner().withProperties(new SubscriptionList() + .withPatchOperation(PatchOperation.ADD_COMPLETE) + .withMonitoredSubscriptionList(Arrays.asList( + new MonitoredSubscriptionInner().withSubscriptionId("kx").withStatus(Status.DELETING) + .withError("pbh").withTagRules(new MonitoringTagRulesPropertiesInner()), + new MonitoredSubscriptionInner().withSubscriptionId("tkcxywnytnrsy").withStatus(Status.ACTIVE) + .withError("dybyxczfclhaa").withTagRules(new MonitoringTagRulesPropertiesInner()), + new MonitoredSubscriptionInner().withSubscriptionId("abphlw").withStatus(Status.ACTIVE) + .withError("ktsthsucocmny").withTagRules(new MonitoringTagRulesPropertiesInner()), + new MonitoredSubscriptionInner().withSubscriptionId("t").withStatus(Status.ACTIVE) + .withError("wrqpue").withTagRules(new MonitoringTagRulesPropertiesInner())))), + new MonitoredSubscriptionPropertiesInner().withProperties(new SubscriptionList() + .withPatchOperation(PatchOperation.DELETE_COMPLETE) + .withMonitoredSubscriptionList(Arrays.asList( + new MonitoredSubscriptionInner().withSubscriptionId("epdkzja").withStatus(Status.IN_PROGRESS) + .withError("rhdwbavxbniw").withTagRules(new MonitoringTagRulesPropertiesInner()), + new MonitoredSubscriptionInner().withSubscriptionId("wz").withStatus(Status.FAILED) + .withError("pgn").withTagRules(new MonitoringTagRulesPropertiesInner()), + new MonitoredSubscriptionInner().withSubscriptionId("x").withStatus(Status.FAILED) + .withError("bzpfzab").withTagRules(new MonitoringTagRulesPropertiesInner()), + new MonitoredSubscriptionInner().withSubscriptionId("uhxwtctyqiklbbov") + .withStatus(Status.FAILED).withError("bhvgy") + .withTagRules(new MonitoringTagRulesPropertiesInner())))), + new MonitoredSubscriptionPropertiesInner() + .withProperties( + new SubscriptionList().withPatchOperation(PatchOperation.ACTIVE).withMonitoredSubscriptionList( + Arrays.asList(new MonitoredSubscriptionInner().withSubscriptionId("deslp") + .withStatus(Status.IN_PROGRESS).withError("wiyighxpkdw") + .withTagRules(new MonitoringTagRulesPropertiesInner())))), + new MonitoredSubscriptionPropertiesInner().withProperties(new SubscriptionList() + .withPatchOperation(PatchOperation.ACTIVE) + .withMonitoredSubscriptionList(Arrays.asList( + new MonitoredSubscriptionInner().withSubscriptionId("xpsiebtfhvpes").withStatus(Status.FAILED) + .withError("rdqmhjjdhtldwkyz").withTagRules(new MonitoringTagRulesPropertiesInner()), + new MonitoredSubscriptionInner().withSubscriptionId("tkncwsc").withStatus(Status.DELETING) + .withError("xotogtwrupqsxv").withTagRules(new MonitoringTagRulesPropertiesInner()), + new MonitoredSubscriptionInner().withSubscriptionId("cykvceo").withStatus(Status.ACTIVE) + .withError("ovnotyfjfcnjbkcn").withTagRules(new MonitoringTagRulesPropertiesInner())))))) + .withNextLink("sbj"); + model = BinaryData.fromObject(model).toObject(MonitoredSubscriptionPropertiesList.class); + Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.value().get(0).properties().patchOperation()); + Assertions.assertEquals("kx", + model.value().get(0).properties().monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.DELETING, + model.value().get(0).properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("pbh", model.value().get(0).properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals("sbj", model.nextLink()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateMockTests.java new file mode 100644 index 0000000000000..0dbae985ff14a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateMockTests.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; +import com.azure.resourcemanager.newrelicobservability.models.LogRules; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; +import com.azure.resourcemanager.newrelicobservability.models.PatchOperation; +import com.azure.resourcemanager.newrelicobservability.models.Status; +import com.azure.resourcemanager.newrelicobservability.models.SubscriptionList; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class MonitoredSubscriptionsCreateorUpdateMockTests { + @Test + public void testCreateorUpdate() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"patchOperation\":\"Active\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"zkoj\",\"status\":\"InProgress\",\"error\":\"zfoqouicybxar\",\"tagRules\":{\"provisioningState\":\"NotSpecified\",\"logRules\":{},\"metricRules\":{}}}],\"provisioningState\":\"Succeeded\"},\"id\":\"ciqopidoa\",\"name\":\"ciodhkhaz\",\"type\":\"khnzbonlw\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + MonitoredSubscriptionProperties response + = manager + .monitoredSubscriptions().define(ConfigurationName.DEFAULT).withExistingMonitor("pfuvglsbjjca", + "vxb") + .withProperties( + new SubscriptionList().withPatchOperation(PatchOperation.DELETE_COMPLETE) + .withMonitoredSubscriptionList( + Arrays.asList( + new MonitoredSubscriptionInner().withSubscriptionId("cormr").withStatus(Status.DELETING) + .withError("vcofudfl") + .withTagRules(new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules()) + .withMetricRules(new MetricRulesInner())), + new MonitoredSubscriptionInner().withSubscriptionId("dknnqvsazn") + .withStatus(Status.IN_PROGRESS).withError("rudsg") + .withTagRules(new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules()) + .withMetricRules(new MetricRulesInner())), + new MonitoredSubscriptionInner().withSubscriptionId("grauwjuetaebur") + .withStatus(Status.ACTIVE).withError("ovsm") + .withTagRules(new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules()) + .withMetricRules(new MetricRulesInner())), + new MonitoredSubscriptionInner().withSubscriptionId("q").withStatus(Status.ACTIVE) + .withError("ifrvtpu").withTagRules(new MonitoringTagRulesPropertiesInner() + .withLogRules(new LogRules()).withMetricRules(new MetricRulesInner()))))) + .create(); + + Assertions.assertEquals(PatchOperation.ACTIVE, response.properties().patchOperation()); + Assertions.assertEquals("zkoj", response.properties().monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.IN_PROGRESS, response.properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("zfoqouicybxar", response.properties().monitoredSubscriptionList().get(0).error()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetWithResponseMockTests.java new file mode 100644 index 0000000000000..cb79a28687584 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetWithResponseMockTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; +import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; +import com.azure.resourcemanager.newrelicobservability.models.PatchOperation; +import com.azure.resourcemanager.newrelicobservability.models.Status; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class MonitoredSubscriptionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"patchOperation\":\"AddComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"kfpagao\",\"status\":\"Deleting\",\"error\":\"pqblylsyxkqjnsj\",\"tagRules\":{\"provisioningState\":\"Updating\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"xsdszuempsb\",\"status\":\"InProgress\",\"error\":\"beyvpnqicvinvkjj\",\"tagRules\":{\"provisioningState\":\"Canceled\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"kzclewyh\",\"status\":\"InProgress\",\"error\":\"aztz\",\"tagRules\":{\"provisioningState\":\"Creating\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"wyfzqwhxxbuyqa\",\"status\":\"Failed\",\"error\":\"qztpp\",\"tagRules\":{\"provisioningState\":\"Updating\",\"logRules\":{},\"metricRules\":{}}}],\"provisioningState\":\"NotSpecified\"},\"id\":\"altol\",\"name\":\"ncwsob\",\"type\":\"wcsdbnwdcfhucq\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + MonitoredSubscriptionProperties response = manager.monitoredSubscriptions().getWithResponse("vdkcrodtj", + "nfwjlfltkacjvefk", ConfigurationName.DEFAULT, com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals(PatchOperation.ADD_COMPLETE, response.properties().patchOperation()); + Assertions.assertEquals("kfpagao", response.properties().monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.DELETING, response.properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("pqblylsyxkqjnsj", response.properties().monitoredSubscriptionList().get(0).error()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListMockTests.java new file mode 100644 index 0000000000000..c106c739ea813 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; +import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; +import com.azure.resourcemanager.newrelicobservability.models.PatchOperation; +import com.azure.resourcemanager.newrelicobservability.models.Status; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class MonitoredSubscriptionsListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"value\":[{\"properties\":{\"patchOperation\":\"AddComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"q\",\"status\":\"Failed\",\"error\":\"axoruzfgsquy\",\"tagRules\":{\"provisioningState\":\"Updating\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"ptramxj\",\"status\":\"Failed\",\"error\":\"wnwxuqlcvyd\",\"tagRules\":{\"provisioningState\":\"Deleting\",\"logRules\":{},\"metricRules\":{}}}],\"provisioningState\":\"Deleted\"},\"id\":\"ojknio\",\"name\":\"kooebwnu\",\"type\":\"hemms\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.monitoredSubscriptions().list("ytdw", "qbrqubpaxhexiili", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PatchOperation.ADD_COMPLETE, response.iterator().next().properties().patchOperation()); + Assertions.assertEquals("q", + response.iterator().next().properties().monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.FAILED, + response.iterator().next().properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("axoruzfgsquy", + response.iterator().next().properties().monitoredSubscriptionList().get(0).error()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java index e40fbe92d6b62..0af9c019fde49 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java @@ -20,78 +20,50 @@ public final class MonitoringTagRulesPropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MonitoringTagRulesPropertiesInner model = - BinaryData - .fromString( - "{\"provisioningState\":\"Accepted\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"o\",\"value\":\"ukgjnpiucgygevq\",\"action\":\"Exclude\"},{\"name\":\"pmr\",\"value\":\"izcdrqjsd\",\"action\":\"Exclude\"},{\"name\":\"fyhxde\",\"value\":\"jzicwifsjt\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"bkh\",\"value\":\"deyeamdphagalpbu\",\"action\":\"Exclude\"},{\"name\":\"pwhonowkg\",\"value\":\"wankixzbi\",\"action\":\"Exclude\"},{\"name\":\"uttmrywnuzoqft\",\"value\":\"qzrnkcqvyxlwhz\",\"action\":\"Exclude\"}],\"userEmail\":\"ohoqqnwvlryav\"}}") - .toObject(MonitoringTagRulesPropertiesInner.class); + MonitoringTagRulesPropertiesInner model = BinaryData.fromString( + "{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"kpoc\",\"value\":\"azyxoegukg\",\"action\":\"Include\"},{\"name\":\"ucgygevqz\",\"value\":\"yp\",\"action\":\"Exclude\"},{\"name\":\"izcdrqjsd\",\"value\":\"dnfyhxdeoejzicwi\",\"action\":\"Include\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"ishc\",\"value\":\"hajdeyeamdpha\",\"action\":\"Exclude\"},{\"name\":\"buxwgip\",\"value\":\"onowk\",\"action\":\"Exclude\"},{\"name\":\"ankixzbinjeput\",\"value\":\"rywn\",\"action\":\"Exclude\"}],\"userEmail\":\"ftiyqzrnkcq\"}}") + .toObject(MonitoringTagRulesPropertiesInner.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("o", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("ukgjnpiucgygevq", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("bkh", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("deyeamdphagalpbu", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals("kpoc", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("azyxoegukg", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("ishc", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("hajdeyeamdpha", model.metricRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ohoqqnwvlryav", model.metricRules().userEmail()); + Assertions.assertEquals("ftiyqzrnkcq", model.metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MonitoringTagRulesPropertiesInner model = - new MonitoringTagRulesPropertiesInner() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("o") - .withValue("ukgjnpiucgygevq") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("pmr") - .withValue("izcdrqjsd") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("fyhxde") - .withValue("jzicwifsjt") - .withAction(TagAction.EXCLUDE)))) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("bkh") - .withValue("deyeamdphagalpbu") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("pwhonowkg") - .withValue("wankixzbi") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("uttmrywnuzoqft") - .withValue("qzrnkcqvyxlwhz") - .withAction(TagAction.EXCLUDE))) - .withUserEmail("ohoqqnwvlryav")); + MonitoringTagRulesPropertiesInner model = new MonitoringTagRulesPropertiesInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("kpoc").withValue("azyxoegukg").withAction(TagAction.INCLUDE), + new FilteringTag().withName("ucgygevqz").withValue("yp").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("izcdrqjsd").withValue("dnfyhxdeoejzicwi") + .withAction(TagAction.INCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("ishc").withValue("hajdeyeamdpha").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("buxwgip").withValue("onowk").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("ankixzbinjeput").withValue("rywn").withAction(TagAction.EXCLUDE))) + .withUserEmail("ftiyqzrnkcq")); model = BinaryData.fromObject(model).toObject(MonitoringTagRulesPropertiesInner.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("o", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("ukgjnpiucgygevq", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("bkh", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("deyeamdphagalpbu", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals("kpoc", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("azyxoegukg", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("ishc", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("hajdeyeamdpha", model.metricRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ohoqqnwvlryav", model.metricRules().userEmail()); + Assertions.assertEquals("ftiyqzrnkcq", model.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateMockTests.java deleted file mode 100644 index 6ddc8ee79ad5a..0000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"tgqr\",\"newRelicAccountProperties\":{\"userId\":\"muwlauwzizxbm\"},\"userInfo\":{\"firstName\":\"u\",\"lastName\":\"uvpb\",\"emailAddress\":\"d\",\"phoneNumber\":\"orppxebmnzbtb\",\"country\":\"pglkf\"},\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"el\",\"effectiveDate\":\"2021-04-04T13:11:17Z\"},\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":314213768,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"1be7716f-5649-47e7-9220-3cf2fedbeb8d\",\"tenantId\":\"9aa28025-d8d0-4611-a2ed-7f90fe46c74c\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"uuvxz\",\"tags\":{\"zonosgg\":\"vithh\",\"ljuti\":\"hcohfwdsjnk\",\"wkfvhqcrailvp\":\"swacffgdkzz\",\"wdmhdlxyjrxs\":\"ppfufl\"},\"id\":\"gafcnihgwqapnedg\",\"name\":\"bcvkcvqvpkeq\",\"type\":\"cvdrhvoodsot\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NewRelicMonitorResource response = - manager - .monitors() - .define("l") - .withRegion("hszhedplvwiwu") - .withExistingResourceGroup("ertgccymva") - .withTags( - mapOf( - "dnkwwtppjflcxog", - "mbes", - "qqkdltfzxmhhvhgu", - "okonzmnsikvmkqz", - "xtibqdxbxwakbog", - "eodkwobda")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("wyhzdx")) - .withUserInfo( - new UserInfo() - .withFirstName("mnvdfzn") - .withLastName("ao") - .withEmailAddress("xzb") - .withPhoneNumber("blylpstdbh") - .withCountry("srzdzucerscdn")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.WEEKLY) - .withPlanDetails("jmygtdsslswtmwer") - .withEffectiveDate(OffsetDateTime.parse("2021-09-22T20:42:28Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.LIFTR) - .create(); - - Assertions.assertEquals("uuvxz", response.location()); - Assertions.assertEquals("vithh", response.tags().get("zonosgg")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("muwlauwzizxbm", response.newRelicAccountProperties().userId()); - Assertions.assertEquals("u", response.userInfo().firstName()); - Assertions.assertEquals("uvpb", response.userInfo().lastName()); - Assertions.assertEquals("d", response.userInfo().emailAddress()); - Assertions.assertEquals("orppxebmnzbtb", response.userInfo().phoneNumber()); - Assertions.assertEquals("pglkf", response.userInfo().country()); - Assertions.assertEquals(UsageType.PAYG, response.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, response.planData().billingCycle()); - Assertions.assertEquals("el", response.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T13:11:17Z"), response.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, response.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.accountCreationSource()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java index 58544416f15e3..f6b697c808f75 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java @@ -32,30 +32,20 @@ public void testDelete() throws Exception { Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.monitors().delete("l", "zbtd", "xujznbmpowu", com.azure.core.util.Context.NONE); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.monitors().delete("lmpewwwfbkr", "rn", "vshqjohxcr", com.azure.core.util.Context.NONE); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 248a15ae66447..0000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Creating\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"melmqkrha\",\"newRelicAccountProperties\":{\"userId\":\"juahaquhcdhmdual\"},\"userInfo\":{\"firstName\":\"fadmws\",\"lastName\":\"r\",\"emailAddress\":\"xpvgo\",\"phoneNumber\":\"lf\",\"country\":\"sgwbnbbeld\"},\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"io\",\"effectiveDate\":\"2021-05-06T22:54:03Z\"},\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":391809232,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"f8829299-fc95-4144-aef6-fe4aa2d30e0b\",\"tenantId\":\"8d57248d-6b81-42fe-abf1-13066e5741ee\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"owzxcu\",\"tags\":{\"ucww\":\"jooxdjebw\",\"bvmeuecivy\":\"vo\",\"ueiotwmcdyt\":\"zceuojgjrw\",\"it\":\"x\"},\"id\":\"nrjawgqwg\",\"name\":\"hniskxfbkpyc\",\"type\":\"klwndnhjdauwhv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NewRelicMonitorResource response = - manager - .monitors() - .getByResourceGroupWithResponse("ehhseyvjusrts", "hspkdeemao", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("owzxcu", response.location()); - Assertions.assertEquals("jooxdjebw", response.tags().get("ucww")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("juahaquhcdhmdual", response.newRelicAccountProperties().userId()); - Assertions.assertEquals("fadmws", response.userInfo().firstName()); - Assertions.assertEquals("r", response.userInfo().lastName()); - Assertions.assertEquals("xpvgo", response.userInfo().emailAddress()); - Assertions.assertEquals("lf", response.userInfo().phoneNumber()); - Assertions.assertEquals("sgwbnbbeld", response.userInfo().country()); - Assertions.assertEquals(UsageType.COMMITTED, response.planData().usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, response.planData().billingCycle()); - Assertions.assertEquals("io", response.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T22:54:03Z"), response.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, response.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java index 9e0c776c5b3b8..0a0f108eef730 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java @@ -33,49 +33,31 @@ public void testGetMetricRulesWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"bpbewtghfgb\",\"value\":\"gw\",\"action\":\"Exclude\"},{\"name\":\"v\",\"value\":\"jkbegibtnmxiebww\",\"action\":\"Include\"},{\"name\":\"yqcgwrtzjuzgwy\",\"value\":\"htxongmtsavjc\",\"action\":\"Exclude\"},{\"name\":\"qpsrknftguvri\",\"value\":\"prwmdyvxqt\",\"action\":\"Include\"}],\"userEmail\":\"ww\"}"; + String responseStr + = "{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"bsrfbj\",\"value\":\"twss\",\"action\":\"Exclude\"},{\"name\":\"pvjzbe\",\"value\":\"l\",\"action\":\"Include\"},{\"name\":\"qqnvwpmq\",\"value\":\"ruoujmk\",\"action\":\"Include\"}],\"userEmail\":\"qytjrybnwjewgd\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - MetricRules response = - manager - .monitors() - .getMetricRulesWithResponse( - "przqlveu", - "lupj", - new MetricsRequest().withUserEmail("khfxobbcswsrt"), - com.azure.core.util.Context.NONE) - .getValue(); + MetricRules response = manager.monitors().getMetricRulesWithResponse("bfovasrruvwbhsq", "sub", + new MetricsRequest().withUserEmail("gjb"), com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals(SendMetricsStatus.DISABLED, response.sendMetrics()); - Assertions.assertEquals("bpbewtghfgb", response.filteringTags().get(0).name()); - Assertions.assertEquals("gw", response.filteringTags().get(0).value()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, response.sendMetrics()); + Assertions.assertEquals("bsrfbj", response.filteringTags().get(0).name()); + Assertions.assertEquals("twss", response.filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, response.filteringTags().get(0).action()); - Assertions.assertEquals("ww", response.userEmail()); + Assertions.assertEquals("qytjrybnwjewgd", response.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java index 65526cf5d25b2..701e5002817fd 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java @@ -32,46 +32,29 @@ public void testGetMetricStatusWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"azureResourceIds\":[\"vxdjzlmwlxkvugf\",\"zovawjvz\",\"nluthnnp\"]}"; + String responseStr = "{\"azureResourceIds\":[\"duhavhqlkt\",\"umaq\",\"lbg\",\"cdui\"]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MetricsStatusResponse response = - manager - .monitors() - .getMetricStatusWithResponse( - "oyq", - "exrmcqibycnojvk", - new MetricsStatusRequest() - .withAzureResourceIds(Arrays.asList("fqsgzvahapjy")) - .withUserEmail("hpvgqz"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vxdjzlmwlxkvugf", response.azureResourceIds().get(0)); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + MetricsStatusResponse response = manager.monitors() + .getMetricStatusWithResponse("jervnaenqpehi", "doy", + new MetricsStatusRequest().withAzureResourceIds(Arrays.asList("fthnzdn", "sl")).withUserEmail("nayqi"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("duhavhqlkt", response.azureResourceIds().get(0)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java index 8fd56d8b4eee8..befffe32bf083 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java @@ -33,48 +33,31 @@ public void testListAppServices() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"azureResourceId\":\"nsmvbxwyj\",\"agentVersion\":\"lh\",\"agentStatus\":\"aalnjixi\"}]}"; + String responseStr + = "{\"value\":[{\"azureResourceId\":\"dvxzbncblylpst\",\"agentVersion\":\"hh\",\"agentStatus\":\"rzdzucerscdnt\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .monitors() - .listAppServices( - "nxipeil", - "jzuaejxdultskzbb", - new AppServicesGetRequest() - .withAzureResourceIds(Arrays.asList("umveekgpwozuhkf", "bsjyofdx", "uusdttouwa")) - .withUserEmail("oekqvk"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nsmvbxwyj", response.iterator().next().azureResourceId()); - Assertions.assertEquals("lh", response.iterator().next().agentVersion()); - Assertions.assertEquals("aalnjixi", response.iterator().next().agentStatus()); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.monitors().listAppServices( + "r", "gccymvaolpssl", new AppServicesGetRequest() + .withAzureResourceIds(Arrays.asList("mmdnbbglzps", "iydmcwyhzdxs")).withUserEmail("adbzmnvdfznud"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("dvxzbncblylpst", response.iterator().next().azureResourceId()); + Assertions.assertEquals("hh", response.iterator().next().agentVersion()); + Assertions.assertEquals("rzdzucerscdnt", response.iterator().next().agentStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupMockTests.java deleted file mode 100644 index 95905092b4f9c..0000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Suspended\",\"marketplaceSubscriptionId\":\"pqsxvnmicy\",\"newRelicAccountProperties\":{\"userId\":\"eoveilovnotyf\"},\"userInfo\":{\"firstName\":\"k\",\"lastName\":\"x\",\"emailAddress\":\"bttk\",\"phoneNumber\":\"ywpnvjt\",\"country\":\"nermcl\"},\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"YEARLY\",\"planDetails\":\"uscrpabgyepsb\",\"effectiveDate\":\"2021-01-26T13:24:27Z\"},\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":2075352957,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"43342a83-3a17-432a-9476-d5df04a78549\",\"tenantId\":\"1d876899-4898-434d-bb81-20fd15cc7d98\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"wfqkquj\",\"tags\":{\"xtccmg\":\"uyonobglaoc\",\"wfudwpzntxhdzhl\":\"udxytlmoyrx\",\"hckfrlhrx\":\"qj\",\"ca\":\"bkyvp\"},\"id\":\"uzbpzkafku\",\"name\":\"b\",\"type\":\"rnwb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.monitors().listByResourceGroup("cwscwsvlx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wfqkquj", response.iterator().next().location()); - Assertions.assertEquals("uyonobglaoc", response.iterator().next().tags().get("xtccmg")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("eoveilovnotyf", response.iterator().next().newRelicAccountProperties().userId()); - Assertions.assertEquals("k", response.iterator().next().userInfo().firstName()); - Assertions.assertEquals("x", response.iterator().next().userInfo().lastName()); - Assertions.assertEquals("bttk", response.iterator().next().userInfo().emailAddress()); - Assertions.assertEquals("ywpnvjt", response.iterator().next().userInfo().phoneNumber()); - Assertions.assertEquals("nermcl", response.iterator().next().userInfo().country()); - Assertions.assertEquals(UsageType.PAYG, response.iterator().next().planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, response.iterator().next().planData().billingCycle()); - Assertions.assertEquals("uscrpabgyepsb", response.iterator().next().planData().planDetails()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-01-26T13:24:27Z"), response.iterator().next().planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, response.iterator().next().orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.iterator().next().accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java index ec67050e4df4f..99cda390af124 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java @@ -33,46 +33,30 @@ public void testListHosts() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"vmId\":\"otftpvjzbexilz\",\"agentVersion\":\"fqqnvwpmqtaruo\",\"agentStatus\":\"mkcjhwqytjrybn\"}]}"; + String responseStr + = "{\"value\":[{\"vmId\":\"koievseo\",\"agentVersion\":\"q\",\"agentStatus\":\"ltmuwlauwzizx\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .monitors() - .listHosts( - "bfovasrruvwbhsq", - "sub", - new HostsGetRequest().withVmIds(Arrays.asList("birx")).withUserEmail("pybsrfbjfdtw"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("otftpvjzbexilz", response.iterator().next().vmId()); - Assertions.assertEquals("fqqnvwpmqtaruo", response.iterator().next().agentVersion()); - Assertions.assertEquals("mkcjhwqytjrybn", response.iterator().next().agentStatus()); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.monitors().listHosts("ur", "odkwobd", new HostsGetRequest() + .withVmIds(Arrays.asList("tibqdxbxwakb", "gqxndlkzgxhuripl", "podxunkb", "bxmubyynt")).withUserEmail("lrb"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("koievseo", response.iterator().next().vmId()); + Assertions.assertEquals("q", response.iterator().next().agentVersion()); + Assertions.assertEquals("ltmuwlauwzizx", response.iterator().next().agentStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesMockTests.java new file mode 100644 index 0000000000000..6c1ade3ee7a82 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; +import com.azure.resourcemanager.newrelicobservability.models.LinkedResource; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class MonitorsListLinkedResourcesMockTests { + @Test + public void testListLinkedResources() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{\"value\":[{\"id\":\"xzxcl\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.monitors().listLinkedResources("phsdyhto", "fikdowwqu", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xzxcl", response.iterator().next().id()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMockTests.java deleted file mode 100644 index a095504d3229a..0000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMockTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"niwdjsw\",\"newRelicAccountProperties\":{\"userId\":\"dbpgnxytxhp\"},\"userInfo\":{\"firstName\":\"zabglcuhxwt\",\"lastName\":\"yqiklbbovplwzb\",\"emailAddress\":\"gy\",\"phoneNumber\":\"uosvmkfssxqukk\",\"country\":\"l\"},\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"jzkdeslpvlopwi\",\"effectiveDate\":\"2021-09-12T13:52:28Z\"},\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":1973154307,\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"75dd3c6a-354c-4390-a355-7aa10b3b870c\",\"tenantId\":\"f4f159ab-7620-4931-a69d-a7b80d4e817a\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"umnyqu\",\"tags\":{\"hsmtxpsiebtfhvp\":\"eojnabc\"},\"id\":\"sapskr\",\"name\":\"qmhjjdhtld\",\"type\":\"kyzxuutk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.monitors().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("umnyqu", response.iterator().next().location()); - Assertions.assertEquals("eojnabc", response.iterator().next().tags().get("hsmtxpsiebtfhvp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("dbpgnxytxhp", response.iterator().next().newRelicAccountProperties().userId()); - Assertions.assertEquals("zabglcuhxwt", response.iterator().next().userInfo().firstName()); - Assertions.assertEquals("yqiklbbovplwzb", response.iterator().next().userInfo().lastName()); - Assertions.assertEquals("gy", response.iterator().next().userInfo().emailAddress()); - Assertions.assertEquals("uosvmkfssxqukk", response.iterator().next().userInfo().phoneNumber()); - Assertions.assertEquals("l", response.iterator().next().userInfo().country()); - Assertions.assertEquals(UsageType.COMMITTED, response.iterator().next().planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, response.iterator().next().planData().billingCycle()); - Assertions.assertEquals("jzkdeslpvlopwi", response.iterator().next().planData().planDetails()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-09-12T13:52:28Z"), response.iterator().next().planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.LIFTR, response.iterator().next().orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.iterator().next().accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java index c74206d253e7a..86de7a0c106f2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java @@ -33,42 +33,31 @@ public void testListMonitoredResources() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"id\":\"eh\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"ygmi\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"zdnds\"}]}"; + String responseStr + = "{\"value\":[{\"id\":\"orppxebmnzbtb\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"lkfg\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"euel\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager.monitors().listMonitoredResources("jewgdrjerv", "aen", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.monitors().listMonitoredResources("mpgcjefuzmuvpbt", "d", com.azure.core.util.Context.NONE); - Assertions.assertEquals("eh", response.iterator().next().id()); + Assertions.assertEquals("orppxebmnzbtb", response.iterator().next().id()); Assertions.assertEquals(SendingMetricsStatus.ENABLED, response.iterator().next().sendingMetrics()); - Assertions.assertEquals("ygmi", response.iterator().next().reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.DISABLED, response.iterator().next().sendingLogs()); - Assertions.assertEquals("zdnds", response.iterator().next().reasonForLogsStatus()); + Assertions.assertEquals("lkfg", response.iterator().next().reasonForMetricsStatus()); + Assertions.assertEquals(SendingLogsStatus.ENABLED, response.iterator().next().sendingLogs()); + Assertions.assertEquals("euel", response.iterator().next().reasonForLogsStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingWithResponseMockTests.java deleted file mode 100644 index b269b94c6abb2..0000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingWithResponseMockTests.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsSwitchBillingWithResponseMockTests { - @Test - public void testSwitchBillingWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Updating\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"txmedj\",\"newRelicAccountProperties\":{\"userId\":\"lynqwwncwzzh\"},\"userInfo\":{\"firstName\":\"gucnapkte\",\"lastName\":\"llwptfdy\",\"emailAddress\":\"fqbuaceopzf\",\"phoneNumber\":\"hhuao\",\"country\":\"pcqeqx\"},\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"xcto\",\"effectiveDate\":\"2021-01-13T03:12:52Z\"},\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":1740681281,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"identity\":{\"principalId\":\"1151cee7-9e16-4851-9d31-70346fb26ae6\",\"tenantId\":\"7bd4edf3-d1c7-4626-a15b-a59b946f8cc5\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"bunrmfqjhhk\",\"tags\":{\"vkr\":\"vjymjhxxjyngud\",\"szjfauvjfdxxivet\":\"swbxqz\",\"qaqtdoqmcbxvwvxy\":\"t\",\"obl\":\"lqbhsf\"},\"id\":\"tkblmpewww\",\"name\":\"bkrvrnsvshqj\",\"type\":\"hxcr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NewRelicMonitorResource response = - manager - .monitors() - .switchBillingWithResponse( - "xyawj", - "yaqcslyjpkiidz", - new SwitchBillingRequest() - .withAzureResourceId("xznelixhnrztf") - .withOrganizationId("hb") - .withPlanData( - new PlanData() - .withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("ulppggdtpnapnyir") - .withEffectiveDate(OffsetDateTime.parse("2021-02-09T03:01:47Z"))) - .withUserEmail("hpigv"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bunrmfqjhhk", response.location()); - Assertions.assertEquals("vjymjhxxjyngud", response.tags().get("vkr")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals("lynqwwncwzzh", response.newRelicAccountProperties().userId()); - Assertions.assertEquals("gucnapkte", response.userInfo().firstName()); - Assertions.assertEquals("llwptfdy", response.userInfo().lastName()); - Assertions.assertEquals("fqbuaceopzf", response.userInfo().emailAddress()); - Assertions.assertEquals("hhuao", response.userInfo().phoneNumber()); - Assertions.assertEquals("pcqeqx", response.userInfo().country()); - Assertions.assertEquals(UsageType.COMMITTED, response.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, response.planData().billingCycle()); - Assertions.assertEquals("xcto", response.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-13T03:12:52Z"), response.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, response.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, response.accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceInnerTests.java deleted file mode 100644 index 39395af8acdd5..0000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceInnerTests.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity; -import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NewRelicMonitorResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NewRelicMonitorResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"ltmrldh\",\"newRelicAccountProperties\":{\"userId\":\"zzd\"},\"userInfo\":{\"firstName\":\"cdgea\",\"lastName\":\"gphuticndvka\",\"emailAddress\":\"wyiftyhxhur\",\"phoneNumber\":\"ftyxolniw\",\"country\":\"cukjf\"},\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"lryplwckbasyy\",\"effectiveDate\":\"2021-05-24T00:31:31Z\"},\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":1048772360,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"identity\":{\"principalId\":\"17917958-feea-475b-924d-d460356abeb7\",\"tenantId\":\"0c6581b4-9dc9-4139-9af6-885e2ea5f76d\",\"type\":\"None\",\"userAssignedIdentities\":{\"nqgoulzndli\":{\"principalId\":\"1441313f-47dc-4ce5-b867-17a8c2992b93\",\"clientId\":\"0c0cf59f-46a6-479e-954b-b32c3748fb4f\"}}},\"location\":\"yqkgfg\",\"tags\":{\"qedqytbciqfoufl\":\"adgakeqsrxybz\",\"glougpbk\":\"mnkzsmod\",\"uqktap\":\"tmut\",\"kdosvqw\":\"pwgcuertu\"},\"id\":\"bmdg\",\"name\":\"bjf\",\"type\":\"dgmb\"}") - .toObject(NewRelicMonitorResourceInner.class); - Assertions.assertEquals("yqkgfg", model.location()); - Assertions.assertEquals("adgakeqsrxybz", model.tags().get("qedqytbciqfoufl")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("zzd", model.newRelicAccountProperties().userId()); - Assertions.assertEquals("cdgea", model.userInfo().firstName()); - Assertions.assertEquals("gphuticndvka", model.userInfo().lastName()); - Assertions.assertEquals("wyiftyhxhur", model.userInfo().emailAddress()); - Assertions.assertEquals("ftyxolniw", model.userInfo().phoneNumber()); - Assertions.assertEquals("cukjf", model.userInfo().country()); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("lryplwckbasyy", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T00:31:31Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NewRelicMonitorResourceInner model = - new NewRelicMonitorResourceInner() - .withLocation("yqkgfg") - .withTags( - mapOf( - "qedqytbciqfoufl", - "adgakeqsrxybz", - "glougpbk", - "mnkzsmod", - "uqktap", - "tmut", - "kdosvqw", - "pwgcuertu")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("nqgoulzndli", new UserAssignedIdentity()))) - .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("zzd")) - .withUserInfo( - new UserInfo() - .withFirstName("cdgea") - .withLastName("gphuticndvka") - .withEmailAddress("wyiftyhxhur") - .withPhoneNumber("ftyxolniw") - .withCountry("cukjf")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("lryplwckbasyy") - .withEffectiveDate(OffsetDateTime.parse("2021-05-24T00:31:31Z"))) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) - .withAccountCreationSource(AccountCreationSource.LIFTR); - model = BinaryData.fromObject(model).toObject(NewRelicMonitorResourceInner.class); - Assertions.assertEquals("yqkgfg", model.location()); - Assertions.assertEquals("adgakeqsrxybz", model.tags().get("qedqytbciqfoufl")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("zzd", model.newRelicAccountProperties().userId()); - Assertions.assertEquals("cdgea", model.userInfo().firstName()); - Assertions.assertEquals("gphuticndvka", model.userInfo().lastName()); - Assertions.assertEquals("wyiftyhxhur", model.userInfo().emailAddress()); - Assertions.assertEquals("ftyxolniw", model.userInfo().phoneNumber()); - Assertions.assertEquals("cukjf", model.userInfo().country()); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("lryplwckbasyy", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T00:31:31Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceListResultTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceListResultTests.java deleted file mode 100644 index a508f9d0af21e..0000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceListResultTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceListResult; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NewRelicMonitorResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NewRelicMonitorResourceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"monitoringStatus\":\"Enabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"dio\",\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":2028392349,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"08951b99-ca13-4bdc-8322-11806828a442\",\"tenantId\":\"79c88631-a94e-42f2-98e2-666dbc928c5f\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"oacctaza\",\"tags\":{\"fdosyg\":\"lahbcryff\"},\"id\":\"xpaojakhmsbz\",\"name\":\"hcrzevd\",\"type\":\"hlxaolthqtr\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Suspended\",\"marketplaceSubscriptionId\":\"s\",\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":1595507269,\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"e5702e62-e947-47d1-91f9-508630ba078a\",\"tenantId\":\"8352b2cc-4a40-45aa-9eab-5bae81f94e26\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"lluwfzitonpeq\",\"tags\":{\"xypininmayhuybbk\":\"kjlxofpdvhpf\",\"vamih\":\"odepoogin\",\"vyevcciqi\":\"ognarxzxtheotus\",\"zrnf\":\"nhungbw\"},\"id\":\"gxg\",\"name\":\"spemvtzfk\",\"type\":\"fublj\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"aeqjhqjbasvms\",\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":951964300,\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"7ea6bb96-e02c-41b8-bb30-8f33eb3a80a4\",\"tenantId\":\"27310914-912e-4105-abf8-2ac41b52c5d5\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"wrwclxxwrljd\",\"tags\":{\"dkwt\":\"kcqvkocrc\",\"ssainqpjwnzll\":\"hxbnjbiksqrg\",\"bvmgxsabkyqduuji\":\"fmppe\"},\"id\":\"c\",\"name\":\"czdzev\",\"type\":\"dhkrwpdappdsbdk\"}],\"nextLink\":\"rwjfe\"}") - .toObject(NewRelicMonitorResourceListResult.class); - Assertions.assertEquals("oacctaza", model.value().get(0).location()); - Assertions.assertEquals("lahbcryff", model.value().get(0).tags().get("fdosyg")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("rwjfe", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NewRelicMonitorResourceListResult model = - new NewRelicMonitorResourceListResult() - .withValue( - Arrays - .asList( - new NewRelicMonitorResourceInner() - .withLocation("oacctaza") - .withTags(mapOf("fdosyg", "lahbcryff")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) - .withAccountCreationSource(AccountCreationSource.NEWRELIC), - new NewRelicMonitorResourceInner() - .withLocation("lluwfzitonpeq") - .withTags( - mapOf( - "xypininmayhuybbk", - "kjlxofpdvhpf", - "vamih", - "odepoogin", - "vyevcciqi", - "ognarxzxtheotus", - "zrnf", - "nhungbw")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.NEWRELIC), - new NewRelicMonitorResourceInner() - .withLocation("wrwclxxwrljd") - .withTags( - mapOf( - "dkwt", - "kcqvkocrc", - "ssainqpjwnzll", - "hxbnjbiksqrg", - "bvmgxsabkyqduuji", - "fmppe")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.NEWRELIC))) - .withNextLink("rwjfe"); - model = BinaryData.fromObject(model).toObject(NewRelicMonitorResourceListResult.class); - Assertions.assertEquals("oacctaza", model.value().get(0).location()); - Assertions.assertEquals("lahbcryff", model.value().get(0).tags().get("fdosyg")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("rwjfe", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceUpdateTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceUpdateTests.java deleted file mode 100644 index e6fa50cb0c277..0000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceUpdateTests.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity; -import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NewRelicMonitorResourceUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NewRelicMonitorResourceUpdate model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"8af364d0-2423-4107-bc81-1b490f4f4095\",\"tenantId\":\"c20fd884-bcd8-4a5a-9fa4-24f086f2191f\",\"type\":\"None\",\"userAssignedIdentities\":{\"ciwqvhk\":{\"principalId\":\"ac4a2a96-2e50-41e8-8716-1e44c18db630\",\"clientId\":\"aefefa77-aa8d-4e04-8ad5-d6ec26306953\"},\"uigdtopbobjog\":{\"principalId\":\"011ce17c-e213-4ecb-a551-6bb9fd7292be\",\"clientId\":\"7edf55c0-8c77-4501-ab62-0461a07096ec\"}}},\"tags\":{\"a\":\"w\"},\"properties\":{\"newRelicAccountProperties\":{\"userId\":\"rzayv\"},\"userInfo\":{\"firstName\":\"f\",\"lastName\":\"otkftutqxlngx\",\"emailAddress\":\"fgugnxkrxdqmid\",\"phoneNumber\":\"hzrvqd\",\"country\":\"bhj\"},\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"YEARLY\",\"planDetails\":\"qfbow\",\"effectiveDate\":\"2021-05-19T19:15:18Z\"},\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"}}") - .toObject(NewRelicMonitorResourceUpdate.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("w", model.tags().get("a")); - Assertions.assertEquals("rzayv", model.newRelicAccountProperties().userId()); - Assertions.assertEquals("f", model.userInfo().firstName()); - Assertions.assertEquals("otkftutqxlngx", model.userInfo().lastName()); - Assertions.assertEquals("fgugnxkrxdqmid", model.userInfo().emailAddress()); - Assertions.assertEquals("hzrvqd", model.userInfo().phoneNumber()); - Assertions.assertEquals("bhj", model.userInfo().country()); - Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, model.planData().billingCycle()); - Assertions.assertEquals("qfbow", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T19:15:18Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NewRelicMonitorResourceUpdate model = - new NewRelicMonitorResourceUpdate() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf("ciwqvhk", new UserAssignedIdentity(), "uigdtopbobjog", new UserAssignedIdentity()))) - .withTags(mapOf("a", "w")) - .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("rzayv")) - .withUserInfo( - new UserInfo() - .withFirstName("f") - .withLastName("otkftutqxlngx") - .withEmailAddress("fgugnxkrxdqmid") - .withPhoneNumber("hzrvqd") - .withCountry("bhj")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("qfbow") - .withEffectiveDate(OffsetDateTime.parse("2021-05-19T19:15:18Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.NEWRELIC); - model = BinaryData.fromObject(model).toObject(NewRelicMonitorResourceUpdate.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("w", model.tags().get("a")); - Assertions.assertEquals("rzayv", model.newRelicAccountProperties().userId()); - Assertions.assertEquals("f", model.userInfo().firstName()); - Assertions.assertEquals("otkftutqxlngx", model.userInfo().lastName()); - Assertions.assertEquals("fgugnxkrxdqmid", model.userInfo().emailAddress()); - Assertions.assertEquals("hzrvqd", model.userInfo().phoneNumber()); - Assertions.assertEquals("bhj", model.userInfo().country()); - Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, model.planData().billingCycle()); - Assertions.assertEquals("qfbow", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T19:15:18Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java index 3f64b074eae53..41ec33a390b16 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java @@ -13,29 +13,24 @@ public final class NewRelicSingleSignOnPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NewRelicSingleSignOnProperties model = - BinaryData - .fromString( - "{\"singleSignOnState\":\"Initial\",\"enterpriseAppId\":\"itnwuizgazxufi\",\"singleSignOnUrl\":\"ckyfih\",\"provisioningState\":\"NotSpecified\"}") - .toObject(NewRelicSingleSignOnProperties.class); - Assertions.assertEquals(SingleSignOnStates.INITIAL, model.singleSignOnState()); - Assertions.assertEquals("itnwuizgazxufi", model.enterpriseAppId()); - Assertions.assertEquals("ckyfih", model.singleSignOnUrl()); - Assertions.assertEquals(ProvisioningState.NOT_SPECIFIED, model.provisioningState()); + NewRelicSingleSignOnProperties model = BinaryData.fromString( + "{\"singleSignOnState\":\"Enable\",\"enterpriseAppId\":\"o\",\"singleSignOnUrl\":\"si\",\"provisioningState\":\"Deleting\"}") + .toObject(NewRelicSingleSignOnProperties.class); + Assertions.assertEquals(SingleSignOnStates.ENABLE, model.singleSignOnState()); + Assertions.assertEquals("o", model.enterpriseAppId()); + Assertions.assertEquals("si", model.singleSignOnUrl()); + Assertions.assertEquals(ProvisioningState.DELETING, model.provisioningState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NewRelicSingleSignOnProperties model = - new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL) - .withEnterpriseAppId("itnwuizgazxufi") - .withSingleSignOnUrl("ckyfih") - .withProvisioningState(ProvisioningState.NOT_SPECIFIED); + NewRelicSingleSignOnProperties model + = new NewRelicSingleSignOnProperties().withSingleSignOnState(SingleSignOnStates.ENABLE) + .withEnterpriseAppId("o").withSingleSignOnUrl("si").withProvisioningState(ProvisioningState.DELETING); model = BinaryData.fromObject(model).toObject(NewRelicSingleSignOnProperties.class); - Assertions.assertEquals(SingleSignOnStates.INITIAL, model.singleSignOnState()); - Assertions.assertEquals("itnwuizgazxufi", model.enterpriseAppId()); - Assertions.assertEquals("ckyfih", model.singleSignOnUrl()); - Assertions.assertEquals(ProvisioningState.NOT_SPECIFIED, model.provisioningState()); + Assertions.assertEquals(SingleSignOnStates.ENABLE, model.singleSignOnState()); + Assertions.assertEquals("o", model.enterpriseAppId()); + Assertions.assertEquals("si", model.singleSignOnUrl()); + Assertions.assertEquals(ProvisioningState.DELETING, model.provisioningState()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationDisplayTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationDisplayTests.java index eb95705cc2d70..b350856cac806 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationDisplayTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationDisplayTests.java @@ -10,11 +10,9 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") + .toObject(OperationDisplay.class); } @org.junit.jupiter.api.Test diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationInnerTests.java index 17f43b2e1daaf..222e69c373cca 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationInnerTests.java @@ -11,11 +11,9 @@ public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); + OperationInner model = BinaryData.fromString( + "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); } @org.junit.jupiter.api.Test diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationListResultTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationListResultTests.java index 2e507159686a0..fcd014fed12d9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationListResultTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationListResultTests.java @@ -10,11 +10,9 @@ public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") + .toObject(OperationListResult.class); } @org.junit.jupiter.api.Test diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java index 56422a5cd7319..34b0f5719bfb5 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java @@ -30,35 +30,25 @@ public void testList() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"name\":\"uynhijg\",\"isDataAction\":false,\"display\":{\"provider\":\"siarbutrcvpn\",\"resource\":\"zmhjrunmp\",\"operation\":\"tdbhrbnla\",\"description\":\"xmyskp\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + String responseStr + = "{\"value\":[{\"name\":\"uusdttouwa\",\"isDataAction\":false,\"display\":{\"provider\":\"v\",\"resource\":\"lns\",\"operation\":\"bxwyjsflhhcaa\",\"description\":\"jixisxyawjoyaqcs\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java index 63d7fbe57c8a8..15c572cc37d19 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java @@ -11,14 +11,15 @@ public final class OrganizationInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OrganizationInfo model = BinaryData.fromString("{\"organizationId\":\"zw\"}").toObject(OrganizationInfo.class); - Assertions.assertEquals("zw", model.organizationId()); + OrganizationInfo model + = BinaryData.fromString("{\"organizationId\":\"amiheognarxz\"}").toObject(OrganizationInfo.class); + Assertions.assertEquals("amiheognarxz", model.organizationId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OrganizationInfo model = new OrganizationInfo().withOrganizationId("zw"); + OrganizationInfo model = new OrganizationInfo().withOrganizationId("amiheognarxz"); model = BinaryData.fromObject(model).toObject(OrganizationInfo.class); - Assertions.assertEquals("zw", model.organizationId()); + Assertions.assertEquals("amiheognarxz", model.organizationId()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java index fd2c0dc1577ea..5c7511db25359 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java @@ -12,26 +12,21 @@ public final class OrganizationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OrganizationProperties model = - BinaryData - .fromString( - "{\"organizationId\":\"jwzrl\",\"organizationName\":\"mcl\",\"billingSource\":\"NEWRELIC\"}") - .toObject(OrganizationProperties.class); - Assertions.assertEquals("jwzrl", model.organizationId()); - Assertions.assertEquals("mcl", model.organizationName()); + OrganizationProperties model = BinaryData.fromString( + "{\"organizationId\":\"utduqktapspwgcu\",\"organizationName\":\"tumkdosvqwhbm\",\"billingSource\":\"NEWRELIC\"}") + .toObject(OrganizationProperties.class); + Assertions.assertEquals("utduqktapspwgcu", model.organizationId()); + Assertions.assertEquals("tumkdosvqwhbm", model.organizationName()); Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OrganizationProperties model = - new OrganizationProperties() - .withOrganizationId("jwzrl") - .withOrganizationName("mcl") - .withBillingSource(BillingSource.NEWRELIC); + OrganizationProperties model = new OrganizationProperties().withOrganizationId("utduqktapspwgcu") + .withOrganizationName("tumkdosvqwhbm").withBillingSource(BillingSource.NEWRELIC); model = BinaryData.fromObject(model).toObject(OrganizationProperties.class); - Assertions.assertEquals("jwzrl", model.organizationId()); - Assertions.assertEquals("mcl", model.organizationName()); + Assertions.assertEquals("utduqktapspwgcu", model.organizationId()); + Assertions.assertEquals("tumkdosvqwhbm", model.organizationName()); Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java index d76476215ebdd..32d8a31f9f08e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java @@ -12,26 +12,21 @@ public final class OrganizationResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OrganizationResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"organizationId\":\"okaj\",\"organizationName\":\"npime\",\"billingSource\":\"AZURE\"},\"id\":\"xgcp\",\"name\":\"dg\",\"type\":\"aajrm\"}") - .toObject(OrganizationResourceInner.class); - Assertions.assertEquals("okaj", model.organizationId()); - Assertions.assertEquals("npime", model.organizationName()); - Assertions.assertEquals(BillingSource.AZURE, model.billingSource()); + OrganizationResourceInner model = BinaryData.fromString( + "{\"properties\":{\"organizationId\":\"kgfg\",\"organizationName\":\"madgakeqsrxyb\",\"billingSource\":\"NEWRELIC\"},\"id\":\"dqytbciqfouflmm\",\"name\":\"kzsmodm\",\"type\":\"lougpbkw\"}") + .toObject(OrganizationResourceInner.class); + Assertions.assertEquals("kgfg", model.organizationId()); + Assertions.assertEquals("madgakeqsrxyb", model.organizationName()); + Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OrganizationResourceInner model = - new OrganizationResourceInner() - .withOrganizationId("okaj") - .withOrganizationName("npime") - .withBillingSource(BillingSource.AZURE); + OrganizationResourceInner model = new OrganizationResourceInner().withOrganizationId("kgfg") + .withOrganizationName("madgakeqsrxyb").withBillingSource(BillingSource.NEWRELIC); model = BinaryData.fromObject(model).toObject(OrganizationResourceInner.class); - Assertions.assertEquals("okaj", model.organizationId()); - Assertions.assertEquals("npime", model.organizationName()); - Assertions.assertEquals(BillingSource.AZURE, model.billingSource()); + Assertions.assertEquals("kgfg", model.organizationId()); + Assertions.assertEquals("madgakeqsrxyb", model.organizationName()); + Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java index 28529ffbb52b4..6ddce9f2c1410 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java @@ -32,40 +32,29 @@ public void testList() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"organizationId\":\"twuoegrpkhjwni\",\"organizationName\":\"sluicpdggkzz\",\"billingSource\":\"NEWRELIC\"},\"id\":\"mpaxmodfvuefywsb\",\"name\":\"fvmwy\",\"type\":\"rfouyftaakcpw\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"organizationId\":\"cjwvn\",\"organizationName\":\"ld\",\"billingSource\":\"AZURE\"},\"id\":\"cxrslpmutwuoe\",\"name\":\"rpkhjwn\",\"type\":\"yqsluic\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager.organizations().list("obzdopcjwvnhdl", "wmgxcxrsl", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.organizations().list("rhvoods", "tbobz", com.azure.core.util.Context.NONE); - Assertions.assertEquals("twuoegrpkhjwni", response.iterator().next().organizationId()); - Assertions.assertEquals("sluicpdggkzz", response.iterator().next().organizationName()); - Assertions.assertEquals(BillingSource.NEWRELIC, response.iterator().next().billingSource()); + Assertions.assertEquals("cjwvn", response.iterator().next().organizationId()); + Assertions.assertEquals("ld", response.iterator().next().organizationName()); + Assertions.assertEquals(BillingSource.AZURE, response.iterator().next().billingSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java index 1da9f7158aa02..9a0ee97ac5ea8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java @@ -14,41 +14,29 @@ public final class OrganizationsListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OrganizationsListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"organizationId\":\"irsoodqxhcrmnohj\",\"organizationName\":\"kwh\",\"billingSource\":\"NEWRELIC\"},\"id\":\"fiyipjxsqwpgrj\",\"name\":\"znorcj\",\"type\":\"vsnb\"},{\"properties\":{\"organizationId\":\"abnmocpcyshu\",\"organizationName\":\"afbljjgpbtoqcjmk\",\"billingSource\":\"AZURE\"},\"id\":\"bqidtqaj\",\"name\":\"yulpkudjkr\",\"type\":\"khbzhfepgzg\"},{\"properties\":{\"organizationId\":\"zloc\",\"organizationName\":\"c\",\"billingSource\":\"NEWRELIC\"},\"id\":\"rhhbcs\",\"name\":\"l\",\"type\":\"mmajtjaodx\"}],\"nextLink\":\"nbdxk\"}") - .toObject(OrganizationsListResponse.class); - Assertions.assertEquals("irsoodqxhcrmnohj", model.value().get(0).organizationId()); - Assertions.assertEquals("kwh", model.value().get(0).organizationName()); + OrganizationsListResponse model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"organizationId\":\"nqpjwnzlljfmpp\",\"organizationName\":\"bvmgxsabkyqduuji\",\"billingSource\":\"NEWRELIC\"},\"id\":\"zdzevndh\",\"name\":\"rwpdappdsbdkvwrw\",\"type\":\"feusnhut\"},{\"properties\":{\"organizationId\":\"tmrldhugjzzdatq\",\"organizationName\":\"oc\",\"billingSource\":\"AZURE\"},\"id\":\"blgphuticn\",\"name\":\"vkaozwyiftyhxhur\",\"type\":\"k\"},{\"properties\":{\"organizationId\":\"xolniwpwcukjfk\",\"organizationName\":\"awxklr\",\"billingSource\":\"NEWRELIC\"},\"id\":\"ckbasyypndd\",\"name\":\"sgcbac\",\"type\":\"hejkotynqgou\"}],\"nextLink\":\"ndlik\"}") + .toObject(OrganizationsListResponse.class); + Assertions.assertEquals("nqpjwnzlljfmpp", model.value().get(0).organizationId()); + Assertions.assertEquals("bvmgxsabkyqduuji", model.value().get(0).organizationName()); Assertions.assertEquals(BillingSource.NEWRELIC, model.value().get(0).billingSource()); - Assertions.assertEquals("nbdxk", model.nextLink()); + Assertions.assertEquals("ndlik", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OrganizationsListResponse model = - new OrganizationsListResponse() - .withValue( - Arrays - .asList( - new OrganizationResourceInner() - .withOrganizationId("irsoodqxhcrmnohj") - .withOrganizationName("kwh") - .withBillingSource(BillingSource.NEWRELIC), - new OrganizationResourceInner() - .withOrganizationId("abnmocpcyshu") - .withOrganizationName("afbljjgpbtoqcjmk") - .withBillingSource(BillingSource.AZURE), - new OrganizationResourceInner() - .withOrganizationId("zloc") - .withOrganizationName("c") - .withBillingSource(BillingSource.NEWRELIC))) - .withNextLink("nbdxk"); + OrganizationsListResponse model = new OrganizationsListResponse().withValue(Arrays.asList( + new OrganizationResourceInner().withOrganizationId("nqpjwnzlljfmpp") + .withOrganizationName("bvmgxsabkyqduuji").withBillingSource(BillingSource.NEWRELIC), + new OrganizationResourceInner().withOrganizationId("tmrldhugjzzdatq").withOrganizationName("oc") + .withBillingSource(BillingSource.AZURE), + new OrganizationResourceInner().withOrganizationId("xolniwpwcukjfk").withOrganizationName("awxklr") + .withBillingSource(BillingSource.NEWRELIC))) + .withNextLink("ndlik"); model = BinaryData.fromObject(model).toObject(OrganizationsListResponse.class); - Assertions.assertEquals("irsoodqxhcrmnohj", model.value().get(0).organizationId()); - Assertions.assertEquals("kwh", model.value().get(0).organizationName()); + Assertions.assertEquals("nqpjwnzlljfmpp", model.value().get(0).organizationId()); + Assertions.assertEquals("bvmgxsabkyqduuji", model.value().get(0).organizationName()); Assertions.assertEquals(BillingSource.NEWRELIC, model.value().get(0).billingSource()); - Assertions.assertEquals("nbdxk", model.nextLink()); + Assertions.assertEquals("ndlik", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PartnerBillingEntityTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PartnerBillingEntityTests.java new file mode 100644 index 0000000000000..ef9070a10cbc0 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PartnerBillingEntityTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.models.PartnerBillingEntity; +import org.junit.jupiter.api.Assertions; + +public final class PartnerBillingEntityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PartnerBillingEntity model + = BinaryData.fromString("{\"organizationId\":\"dnvowg\",\"organizationName\":\"jugwdkcglhsl\"}") + .toObject(PartnerBillingEntity.class); + Assertions.assertEquals("dnvowg", model.organizationId()); + Assertions.assertEquals("jugwdkcglhsl", model.organizationName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PartnerBillingEntity model + = new PartnerBillingEntity().withOrganizationId("dnvowg").withOrganizationName("jugwdkcglhsl"); + model = BinaryData.fromObject(model).toObject(PartnerBillingEntity.class); + Assertions.assertEquals("dnvowg", model.organizationId()); + Assertions.assertEquals("jugwdkcglhsl", model.organizationName()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java index 3c146b86aa769..ba6234a60686f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java @@ -7,38 +7,46 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner; import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; +import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; +import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.PlanDataListResponse; +import com.azure.resourcemanager.newrelicobservability.models.UsageType; +import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PlanDataListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PlanDataListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"},\"id\":\"zaqsqsycbkbfk\",\"name\":\"ukdkexxppofmxa\",\"type\":\"c\"}],\"nextLink\":\"pg\"}") - .toObject(PlanDataListResponse.class); - Assertions.assertEquals(OrgCreationSource.LIFTR, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("pg", model.nextLink()); + PlanDataListResponse model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"mbe\",\"effectiveDate\":\"2021-10-01T04:14:33Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"rolfpfp\",\"name\":\"algbquxigjyjg\",\"type\":\"jaoyfhrtx\"}],\"nextLink\":\"n\"}") + .toObject(PlanDataListResponse.class); + Assertions.assertEquals(UsageType.PAYG, model.value().get(0).planData().usageType()); + Assertions.assertEquals(BillingCycle.WEEKLY, model.value().get(0).planData().billingCycle()); + Assertions.assertEquals("mbe", model.value().get(0).planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T04:14:33Z"), + model.value().get(0).planData().effectiveDate()); + Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.value().get(0).orgCreationSource()); + Assertions.assertEquals(AccountCreationSource.LIFTR, model.value().get(0).accountCreationSource()); + Assertions.assertEquals("n", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PlanDataListResponse model = - new PlanDataListResponse() - .withValue( - Arrays - .asList( - new PlanDataResourceInner() - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.NEWRELIC))) - .withNextLink("pg"); + PlanDataListResponse model = new PlanDataListResponse().withValue(Arrays.asList(new PlanDataResourceInner() + .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.WEEKLY) + .withPlanDetails("mbe").withEffectiveDate(OffsetDateTime.parse("2021-10-01T04:14:33Z"))) + .withOrgCreationSource(OrgCreationSource.NEWRELIC).withAccountCreationSource(AccountCreationSource.LIFTR))) + .withNextLink("n"); model = BinaryData.fromObject(model).toObject(PlanDataListResponse.class); - Assertions.assertEquals(OrgCreationSource.LIFTR, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("pg", model.nextLink()); + Assertions.assertEquals(UsageType.PAYG, model.value().get(0).planData().usageType()); + Assertions.assertEquals(BillingCycle.WEEKLY, model.value().get(0).planData().billingCycle()); + Assertions.assertEquals("mbe", model.value().get(0).planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T04:14:33Z"), + model.value().get(0).planData().effectiveDate()); + Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.value().get(0).orgCreationSource()); + Assertions.assertEquals(AccountCreationSource.LIFTR, model.value().get(0).accountCreationSource()); + Assertions.assertEquals("n", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java index d7d14f72dfc47..42402532c9a0d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java @@ -17,37 +17,29 @@ public final class PlanDataPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PlanDataProperties model = - BinaryData - .fromString( - "{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"ddglm\",\"effectiveDate\":\"2020-12-21T16:15:31Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"}") - .toObject(PlanDataProperties.class); + PlanDataProperties model = BinaryData.fromString( + "{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"rwzwbng\",\"effectiveDate\":\"2021-01-28T09:21:30Z\"},\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"LIFTR\"}") + .toObject(PlanDataProperties.class); Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("ddglm", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T16:15:31Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); + Assertions.assertEquals(BillingCycle.WEEKLY, model.planData().billingCycle()); + Assertions.assertEquals("rwzwbng", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-28T09:21:30Z"), model.planData().effectiveDate()); + Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); + Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PlanDataProperties model = - new PlanDataProperties() - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("ddglm") - .withEffectiveDate(OffsetDateTime.parse("2020-12-21T16:15:31Z"))) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) - .withAccountCreationSource(AccountCreationSource.NEWRELIC); + PlanDataProperties model = new PlanDataProperties() + .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.WEEKLY) + .withPlanDetails("rwzwbng").withEffectiveDate(OffsetDateTime.parse("2021-01-28T09:21:30Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR).withAccountCreationSource(AccountCreationSource.LIFTR); model = BinaryData.fromObject(model).toObject(PlanDataProperties.class); Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("ddglm", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T16:15:31Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); + Assertions.assertEquals(BillingCycle.WEEKLY, model.planData().billingCycle()); + Assertions.assertEquals("rwzwbng", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-28T09:21:30Z"), model.planData().effectiveDate()); + Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); + Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java index d3fa0b9682300..4bb41687e1f6a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java @@ -17,36 +17,28 @@ public final class PlanDataResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PlanDataResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"YEARLY\",\"planDetails\":\"hvpmoue\",\"effectiveDate\":\"2021-06-30T20:07:19Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"eojnxqbzvddn\",\"name\":\"wndeicbtwnp\",\"type\":\"aoqvuh\"}") - .toObject(PlanDataResourceInner.class); + PlanDataResourceInner model = BinaryData.fromString( + "{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"l\",\"effectiveDate\":\"2020-12-23T01:20:43Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"rlyxwjkcprbnw\",\"name\":\"xgjvtbv\",\"type\":\"ysszdnrujqguh\"}") + .toObject(PlanDataResourceInner.class); Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, model.planData().billingCycle()); - Assertions.assertEquals("hvpmoue", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T20:07:19Z"), model.planData().effectiveDate()); + Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); + Assertions.assertEquals("l", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T01:20:43Z"), model.planData().effectiveDate()); Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PlanDataResourceInner model = - new PlanDataResourceInner() - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("hvpmoue") - .withEffectiveDate(OffsetDateTime.parse("2021-06-30T20:07:19Z"))) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) - .withAccountCreationSource(AccountCreationSource.LIFTR); + PlanDataResourceInner model = new PlanDataResourceInner() + .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.MONTHLY) + .withPlanDetails("l").withEffectiveDate(OffsetDateTime.parse("2020-12-23T01:20:43Z"))) + .withOrgCreationSource(OrgCreationSource.NEWRELIC).withAccountCreationSource(AccountCreationSource.LIFTR); model = BinaryData.fromObject(model).toObject(PlanDataResourceInner.class); Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, model.planData().billingCycle()); - Assertions.assertEquals("hvpmoue", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T20:07:19Z"), model.planData().effectiveDate()); + Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); + Assertions.assertEquals("l", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T01:20:43Z"), model.planData().effectiveDate()); Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java index 69a3e3041b2ec..960b4e4cbc787 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java @@ -14,29 +14,23 @@ public final class PlanDataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PlanData model = - BinaryData - .fromString( - "{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"mdwzjeiachboo\",\"effectiveDate\":\"2021-07-31T08:54:57Z\"}") - .toObject(PlanData.class); - Assertions.assertEquals(UsageType.PAYG, model.usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.billingCycle()); - Assertions.assertEquals("mdwzjeiachboo", model.planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T08:54:57Z"), model.effectiveDate()); + PlanData model = BinaryData.fromString( + "{\"usageType\":\"COMMITTED\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"gsntnbybkzgcwr\",\"effectiveDate\":\"2021-09-26T22:03:54Z\"}") + .toObject(PlanData.class); + Assertions.assertEquals(UsageType.COMMITTED, model.usageType()); + Assertions.assertEquals(BillingCycle.WEEKLY, model.billingCycle()); + Assertions.assertEquals("gsntnbybkzgcwr", model.planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T22:03:54Z"), model.effectiveDate()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PlanData model = - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("mdwzjeiachboo") - .withEffectiveDate(OffsetDateTime.parse("2021-07-31T08:54:57Z")); + PlanData model = new PlanData().withUsageType(UsageType.COMMITTED).withBillingCycle(BillingCycle.WEEKLY) + .withPlanDetails("gsntnbybkzgcwr").withEffectiveDate(OffsetDateTime.parse("2021-09-26T22:03:54Z")); model = BinaryData.fromObject(model).toObject(PlanData.class); - Assertions.assertEquals(UsageType.PAYG, model.usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.billingCycle()); - Assertions.assertEquals("mdwzjeiachboo", model.planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T08:54:57Z"), model.effectiveDate()); + Assertions.assertEquals(UsageType.COMMITTED, model.usageType()); + Assertions.assertEquals(BillingCycle.WEEKLY, model.billingCycle()); + Assertions.assertEquals("gsntnbybkzgcwr", model.planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T22:03:54Z"), model.effectiveDate()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java index 427c5b45ffb7a..3e999fe148cb0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java @@ -35,45 +35,33 @@ public void testList() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"YEARLY\",\"planDetails\":\"jmquxvypomgk\",\"effectiveDate\":\"2021-08-12T00:08:05Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"pajqgxysm\",\"name\":\"cmbqfqvmk\",\"type\":\"xozap\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"ft\",\"effectiveDate\":\"2021-05-16T02:46:56Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"id\":\"zvqtmnubexkp\",\"name\":\"ksmond\",\"type\":\"mquxvypo\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager.plans().list("yzvqt", "nubexk", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.plans().list("dggkzzlvmbmpa", "modfvuefywsbpfvm", com.azure.core.util.Context.NONE); Assertions.assertEquals(UsageType.PAYG, response.iterator().next().planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, response.iterator().next().planData().billingCycle()); - Assertions.assertEquals("jmquxvypomgk", response.iterator().next().planData().planDetails()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-08-12T00:08:05Z"), response.iterator().next().planData().effectiveDate()); + Assertions.assertEquals(BillingCycle.MONTHLY, response.iterator().next().planData().billingCycle()); + Assertions.assertEquals("ft", response.iterator().next().planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-16T02:46:56Z"), + response.iterator().next().planData().effectiveDate()); Assertions.assertEquals(OrgCreationSource.NEWRELIC, response.iterator().next().orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, response.iterator().next().accountCreationSource()); + Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.iterator().next().accountCreationSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SubscriptionListTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SubscriptionListTests.java new file mode 100644 index 0000000000000..c9c20a9dac033 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SubscriptionListTests.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner; +import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; +import com.azure.resourcemanager.newrelicobservability.models.LogRules; +import com.azure.resourcemanager.newrelicobservability.models.PatchOperation; +import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.Status; +import com.azure.resourcemanager.newrelicobservability.models.SubscriptionList; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SubscriptionListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SubscriptionList model = BinaryData.fromString( + "{\"patchOperation\":\"DeleteComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"dhmdua\",\"status\":\"InProgress\",\"error\":\"qpv\",\"tagRules\":{\"provisioningState\":\"Creating\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{},{},{},{}],\"userEmail\":\"fmisg\"}}},{\"subscriptionId\":\"nbbelda\",\"status\":\"Failed\",\"error\":\"ali\",\"tagRules\":{\"provisioningState\":\"Deleting\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{},{},{},{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{}],\"userEmail\":\"owzxcu\"}}},{\"subscriptionId\":\"cjooxdjebwpucwwf\",\"status\":\"Active\",\"error\":\"vmeueci\",\"tagRules\":{\"provisioningState\":\"Deleted\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{},{}],\"userEmail\":\"wmcdytdxwi\"}}}],\"provisioningState\":\"Deleting\"}") + .toObject(SubscriptionList.class); + Assertions.assertEquals(PatchOperation.DELETE_COMPLETE, model.patchOperation()); + Assertions.assertEquals("dhmdua", model.monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.IN_PROGRESS, model.monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("qpv", model.monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, + model.monitoredSubscriptionList().get(0).tagRules().logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + model.monitoredSubscriptionList().get(0).tagRules().logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, + model.monitoredSubscriptionList().get(0).tagRules().logRules().sendActivityLogs()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, + model.monitoredSubscriptionList().get(0).tagRules().metricRules().sendMetrics()); + Assertions.assertEquals("fmisg", model.monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SubscriptionList model + = new SubscriptionList().withPatchOperation(PatchOperation.DELETE_COMPLETE) + .withMonitoredSubscriptionList(Arrays + .asList( + new MonitoredSubscriptionInner().withSubscriptionId("dhmdua").withStatus(Status.IN_PROGRESS) + .withError("qpv").withTagRules( + new MonitoringTagRulesPropertiesInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag()))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag(), + new FilteringTag(), new FilteringTag())) + .withUserEmail("fmisg"))), + new MonitoredSubscriptionInner().withSubscriptionId("nbbelda").withStatus(Status.FAILED) + .withError( + "ali") + .withTagRules(new MonitoringTagRulesPropertiesInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag(), + new FilteringTag(), new FilteringTag()))) + .withMetricRules(new MetricRulesInner() + .withSendMetrics(SendMetricsStatus.DISABLED).withFilteringTags( + Arrays.asList(new FilteringTag())) + .withUserEmail("owzxcu"))), + new MonitoredSubscriptionInner().withSubscriptionId("cjooxdjebwpucwwf") + .withStatus(Status.ACTIVE).withError("vmeueci") + .withTagRules(new MonitoringTagRulesPropertiesInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withFilteringTags(Arrays.asList(new FilteringTag()))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag())) + .withUserEmail("wmcdytdxwi"))))); + model = BinaryData.fromObject(model).toObject(SubscriptionList.class); + Assertions.assertEquals(PatchOperation.DELETE_COMPLETE, model.patchOperation()); + Assertions.assertEquals("dhmdua", model.monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.IN_PROGRESS, model.monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("qpv", model.monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, + model.monitoredSubscriptionList().get(0).tagRules().logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + model.monitoredSubscriptionList().get(0).tagRules().logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, + model.monitoredSubscriptionList().get(0).tagRules().logRules().sendActivityLogs()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, + model.monitoredSubscriptionList().get(0).tagRules().metricRules().sendMetrics()); + Assertions.assertEquals("fmisg", model.monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java index 51bfece6cd933..7d46e64b928e5 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java @@ -15,40 +15,32 @@ public final class SwitchBillingRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SwitchBillingRequest model = - BinaryData - .fromString( - "{\"azureResourceId\":\"vdcsitynn\",\"organizationId\":\"mdectehfiqscjey\",\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"gqhcjrefovg\",\"effectiveDate\":\"2021-10-26T09:37:04Z\"},\"userEmail\":\"sle\"}") - .toObject(SwitchBillingRequest.class); - Assertions.assertEquals("vdcsitynn", model.azureResourceId()); - Assertions.assertEquals("mdectehfiqscjey", model.organizationId()); + SwitchBillingRequest model = BinaryData.fromString( + "{\"azureResourceId\":\"jqkwpyeicx\",\"organizationId\":\"ciwqvhk\",\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"topbobjogh\",\"effectiveDate\":\"2021-04-17T11:58:30Z\"},\"userEmail\":\"u\"}") + .toObject(SwitchBillingRequest.class); + Assertions.assertEquals("jqkwpyeicx", model.azureResourceId()); + Assertions.assertEquals("ciwqvhk", model.organizationId()); Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("gqhcjrefovg", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T09:37:04Z"), model.planData().effectiveDate()); - Assertions.assertEquals("sle", model.userEmail()); + Assertions.assertEquals(BillingCycle.WEEKLY, model.planData().billingCycle()); + Assertions.assertEquals("topbobjogh", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T11:58:30Z"), model.planData().effectiveDate()); + Assertions.assertEquals("u", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SwitchBillingRequest model = - new SwitchBillingRequest() - .withAzureResourceId("vdcsitynn") - .withOrganizationId("mdectehfiqscjey") - .withPlanData( - new PlanData() - .withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("gqhcjrefovg") - .withEffectiveDate(OffsetDateTime.parse("2021-10-26T09:37:04Z"))) - .withUserEmail("sle"); + SwitchBillingRequest model + = new SwitchBillingRequest().withAzureResourceId("jqkwpyeicx").withOrganizationId("ciwqvhk") + .withPlanData(new PlanData().withUsageType(UsageType.COMMITTED).withBillingCycle(BillingCycle.WEEKLY) + .withPlanDetails("topbobjogh").withEffectiveDate(OffsetDateTime.parse("2021-04-17T11:58:30Z"))) + .withUserEmail("u"); model = BinaryData.fromObject(model).toObject(SwitchBillingRequest.class); - Assertions.assertEquals("vdcsitynn", model.azureResourceId()); - Assertions.assertEquals("mdectehfiqscjey", model.organizationId()); + Assertions.assertEquals("jqkwpyeicx", model.azureResourceId()); + Assertions.assertEquals("ciwqvhk", model.organizationId()); Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("gqhcjrefovg", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T09:37:04Z"), model.planData().effectiveDate()); - Assertions.assertEquals("sle", model.userEmail()); + Assertions.assertEquals(BillingCycle.WEEKLY, model.planData().billingCycle()); + Assertions.assertEquals("topbobjogh", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T11:58:30Z"), model.planData().effectiveDate()); + Assertions.assertEquals("u", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java index f446c92709af6..e6eb2d114f5bc 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java @@ -7,49 +7,63 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner; +import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; import com.azure.resourcemanager.newrelicobservability.models.LogRules; import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.TagAction; import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class TagRuleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TagRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[],\"userEmail\":\"burvjxxjnspy\"}},\"id\":\"tko\",\"name\":\"nkoukn\",\"type\":\"udwtiukbl\"}") - .toObject(TagRuleInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); + TagRuleInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Deleting\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"yokacspkw\",\"value\":\"zdobpxjmflbvvnch\",\"action\":\"Include\"},{\"name\":\"iwwzjuqk\",\"value\":\"sa\",\"action\":\"Exclude\"},{\"name\":\"uo\",\"value\":\"skghsauuimj\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"idyjrrfbyaosvexc\",\"value\":\"npc\",\"action\":\"Exclude\"},{\"name\":\"ohslkevlegg\",\"value\":\"buhfmvfaxkffeiit\",\"action\":\"Include\"}],\"userEmail\":\"ez\"}},\"id\":\"shxmzsbbzoggigrx\",\"name\":\"burvjxxjnspy\",\"type\":\"ptkoenkoukn\"}") + .toObject(TagRuleInner.class); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("burvjxxjnspy", model.metricRules().userEmail()); + Assertions.assertEquals("yokacspkw", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("zdobpxjmflbvvnch", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("idyjrrfbyaosvexc", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("npc", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("ez", model.metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagRuleInner model = - new TagRuleInner() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList())) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.ENABLED) - .withFilteringTags(Arrays.asList()) - .withUserEmail("burvjxxjnspy")); + TagRuleInner model = new TagRuleInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("yokacspkw").withValue("zdobpxjmflbvvnch") + .withAction(TagAction.INCLUDE), + new FilteringTag().withName("iwwzjuqk").withValue("sa").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("uo").withValue("skghsauuimj").withAction(TagAction.EXCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("idyjrrfbyaosvexc").withValue("npc").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("ohslkevlegg").withValue("buhfmvfaxkffeiit") + .withAction(TagAction.INCLUDE))) + .withUserEmail("ez")); model = BinaryData.fromObject(model).toObject(TagRuleInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("burvjxxjnspy", model.metricRules().userEmail()); + Assertions.assertEquals("yokacspkw", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("zdobpxjmflbvvnch", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("idyjrrfbyaosvexc", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("npc", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("ez", model.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java index 82b1370b03de2..fe7a746bdcd5b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java @@ -5,7 +5,14 @@ package com.azure.resourcemanager.newrelicobservability.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner; +import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; +import com.azure.resourcemanager.newrelicobservability.models.LogRules; +import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; +import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.TagRuleListResult; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -13,21 +20,42 @@ public final class TagRuleListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TagRuleListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"dyjrrfbyaosv\",\"name\":\"xc\",\"type\":\"onpc\"},{\"properties\":{\"provisioningState\":\"Accepted\"},\"id\":\"slkevle\",\"name\":\"gz\",\"type\":\"buhfmvfaxkffeiit\"}],\"nextLink\":\"vmezy\"}") - .toObject(TagRuleListResult.class); - Assertions.assertEquals("vmezy", model.nextLink()); + TagRuleListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"NotSpecified\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{},{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{},{},{},{}],\"userEmail\":\"stkiiuxhqyud\"}},\"id\":\"rrqnbpoczvyifqrv\",\"name\":\"dvjsllrmvvdf\",\"type\":\"atkpnp\"}],\"nextLink\":\"exxbczwtr\"}") + .toObject(TagRuleListResult.class); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.value().get(0).logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + model.value().get(0).logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.value().get(0).logRules().sendActivityLogs()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.value().get(0).metricRules().sendMetrics()); + Assertions.assertEquals("stkiiuxhqyud", model.value().get(0).metricRules().userEmail()); + Assertions.assertEquals("exxbczwtr", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagRuleListResult model = - new TagRuleListResult() - .withValue(Arrays.asList(new TagRuleInner(), new TagRuleInner())) - .withNextLink("vmezy"); + TagRuleListResult model + = new TagRuleListResult() + .withValue( + Arrays + .asList( + new TagRuleInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag()))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag(), + new FilteringTag(), new FilteringTag())) + .withUserEmail("stkiiuxhqyud")))) + .withNextLink("exxbczwtr"); model = BinaryData.fromObject(model).toObject(TagRuleListResult.class); - Assertions.assertEquals("vmezy", model.nextLink()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.value().get(0).logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + model.value().get(0).logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.value().get(0).logRules().sendActivityLogs()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.value().get(0).metricRules().sendMetrics()); + Assertions.assertEquals("stkiiuxhqyud", model.value().get(0).metricRules().userEmail()); + Assertions.assertEquals("exxbczwtr", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java index 9009dbb1fc46c..27c37b9679eb9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java @@ -7,49 +7,62 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdateInner; +import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; import com.azure.resourcemanager.newrelicobservability.models.LogRules; import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.TagAction; import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class TagRuleUpdateInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TagRuleUpdateInner model = - BinaryData - .fromString( - "{\"properties\":{\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[],\"userEmail\":\"xfvjrbirp\"}}}") - .toObject(TagRuleUpdateInner.class); + TagRuleUpdateInner model = BinaryData.fromString( + "{\"properties\":{\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"pwvlqdq\",\"value\":\"iqylihkaetck\",\"action\":\"Exclude\"},{\"name\":\"ivfsnk\",\"value\":\"uctqhjfbe\",\"action\":\"Exclude\"},{\"name\":\"xerf\",\"value\":\"utttxfvjrbirp\",\"action\":\"Exclude\"},{\"name\":\"c\",\"value\":\"ahfn\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"ujqgidok\",\"value\":\"ljyoxgvcltb\",\"action\":\"Include\"},{\"name\":\"ghkjeszzhbi\",\"value\":\"txfvgx\",\"action\":\"Include\"}],\"userEmail\":\"xnehmpvec\"}}}") + .toObject(TagRuleUpdateInner.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("pwvlqdq", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("iqylihkaetck", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("xfvjrbirp", model.metricRules().userEmail()); + Assertions.assertEquals("ujqgidok", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("ljyoxgvcltb", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("xnehmpvec", model.metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagRuleUpdateInner model = - new TagRuleUpdateInner() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList())) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags(Arrays.asList()) - .withUserEmail("xfvjrbirp")); + TagRuleUpdateInner model = new TagRuleUpdateInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("pwvlqdq").withValue("iqylihkaetck").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("ivfsnk").withValue("uctqhjfbe").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("xerf").withValue("utttxfvjrbirp").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("c").withValue("ahfn").withAction(TagAction.EXCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("ujqgidok").withValue("ljyoxgvcltb").withAction(TagAction.INCLUDE), + new FilteringTag().withName("ghkjeszzhbi").withValue("txfvgx").withAction(TagAction.INCLUDE))) + .withUserEmail("xnehmpvec")); model = BinaryData.fromObject(model).toObject(TagRuleUpdateInner.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("pwvlqdq", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("iqylihkaetck", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("xfvjrbirp", model.metricRules().userEmail()); + Assertions.assertEquals("ujqgidok", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("ljyoxgvcltb", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("xnehmpvec", model.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java index 6b4858324a0bd..d71171c475488 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java @@ -20,74 +20,49 @@ public final class TagRuleUpdatePropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TagRuleUpdatePropertiesInner model = - BinaryData - .fromString( - "{\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"ljkyqxjvuuj\",\"value\":\"idokgjlj\",\"action\":\"Include\"},{\"name\":\"vcltbgsncgh\",\"value\":\"esz\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"vgxbfs\",\"value\":\"nehmpvecx\",\"action\":\"Exclude\"},{\"name\":\"bfqkkr\",\"value\":\"pukgriwflzlfb\",\"action\":\"Include\"},{\"name\":\"zycispn\",\"value\":\"ahmgkbrp\",\"action\":\"Include\"}],\"userEmail\":\"ibnuqqkpik\"}}") - .toObject(TagRuleUpdatePropertiesInner.class); + TagRuleUpdatePropertiesInner model = BinaryData.fromString( + "{\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"bmpukgriwflz\",\"value\":\"bxzpuzycisp\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"rp\",\"value\":\"dhibnuq\",\"action\":\"Include\"},{\"name\":\"kadrgvt\",\"value\":\"gnbuy\",\"action\":\"Exclude\"},{\"name\":\"gg\",\"value\":\"bfs\",\"action\":\"Include\"},{\"name\":\"utrc\",\"value\":\"na\",\"action\":\"Exclude\"}],\"userEmail\":\"jrunmpxtt\"}}") + .toObject(TagRuleUpdatePropertiesInner.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("ljkyqxjvuuj", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("idokgjlj", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals("bmpukgriwflz", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("bxzpuzycisp", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("vgxbfs", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("nehmpvecx", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ibnuqqkpik", model.metricRules().userEmail()); + Assertions.assertEquals("rp", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("dhibnuq", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("jrunmpxtt", model.metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagRuleUpdatePropertiesInner model = - new TagRuleUpdatePropertiesInner() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("ljkyqxjvuuj") - .withValue("idokgjlj") - .withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("vcltbgsncgh") - .withValue("esz") - .withAction(TagAction.EXCLUDE)))) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("vgxbfs") - .withValue("nehmpvecx") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("bfqkkr") - .withValue("pukgriwflzlfb") - .withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("zycispn") - .withValue("ahmgkbrp") - .withAction(TagAction.INCLUDE))) - .withUserEmail("ibnuqqkpik")); + TagRuleUpdatePropertiesInner model + = new TagRuleUpdatePropertiesInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag().withName("bmpukgriwflz") + .withValue("bxzpuzycisp").withAction(TagAction.EXCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("rp").withValue("dhibnuq").withAction(TagAction.INCLUDE), + new FilteringTag().withName("kadrgvt").withValue("gnbuy").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("gg").withValue("bfs").withAction(TagAction.INCLUDE), + new FilteringTag().withName("utrc").withValue("na").withAction(TagAction.EXCLUDE))) + .withUserEmail("jrunmpxtt")); model = BinaryData.fromObject(model).toObject(TagRuleUpdatePropertiesInner.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("ljkyqxjvuuj", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("idokgjlj", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals("bmpukgriwflz", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("bxzpuzycisp", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("vgxbfs", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("nehmpvecx", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ibnuqqkpik", model.metricRules().userEmail()); + Assertions.assertEquals("rp", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("dhibnuq", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("jrunmpxtt", model.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java index b8e2ab00d537b..77faf87ec3a0f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java @@ -13,11 +13,13 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; +import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; import com.azure.resourcemanager.newrelicobservability.models.LogRules; import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.TagAction; import com.azure.resourcemanager.newrelicobservability.models.TagRule; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -37,57 +39,49 @@ public void testCreateOrUpdate() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[],\"userEmail\":\"ynl\"}},\"id\":\"huopxodlqiynto\",\"name\":\"zihleosjswsr\",\"type\":\"slyzrpzbchckqq\"}"; + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"jmoadsuv\",\"value\":\"m\",\"action\":\"Include\"},{\"name\":\"jsjqbjhhyx\",\"value\":\"wlycoduhpkxkg\",\"action\":\"Include\"},{\"name\":\"eqnajxqugjhkycu\",\"value\":\"ddg\",\"action\":\"Include\"},{\"name\":\"wqm\",\"value\":\"alkrmn\",\"action\":\"Include\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"udfnbyxba\",\"value\":\"bjyvay\",\"action\":\"Exclude\"}],\"userEmail\":\"rzrtuzqogsex\"}},\"id\":\"vfdnwnwmewzsyyce\",\"name\":\"zsoibjudpfrxtr\",\"type\":\"hzv\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - TagRule response = - manager - .tagRules() - .define("jxywsuws") - .withExistingMonitor("pkkpw", "reqnovvqfov") - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList())) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.ENABLED) - .withFilteringTags(Arrays.asList()) - .withUserEmail("aeneqnzarrwl")) - .create(); + TagRule response = manager.tagRules().define("hfjx").withExistingMonitor("himdbl", "gwimfn") + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("kzikfjawneaivxwc").withValue("lpcirelsf") + .withAction(TagAction.EXCLUDE), + new FilteringTag().withName("wabfatkl").withValue("xbjhwuaanozjosph") + .withAction(TagAction.INCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) + .withFilteringTags( + Arrays.asList(new FilteringTag().withName("ag").withValue("vimjwos").withAction(TagAction.INCLUDE))) + .withUserEmail("tcs")) + .create(); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, response.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, response.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, response.logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, response.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, response.logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, response.metricRules().sendMetrics()); - Assertions.assertEquals("ynl", response.metricRules().userEmail()); + Assertions.assertEquals("jmoadsuv", response.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("m", response.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, response.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, response.metricRules().sendMetrics()); + Assertions.assertEquals("udfnbyxba", response.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("bjyvay", response.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, response.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("rzrtuzqogsex", response.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java index 2146f36e0ff9e..427d9d8d2c9df 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java @@ -32,30 +32,20 @@ public void testDelete() throws Exception { Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.tagRules().delete("hykojoxafnndlpic", "koymkcd", "h", com.azure.core.util.Context.NONE); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.tagRules().delete("g", "xrtfudxep", "gyqagvrvmnpkuk", com.azure.core.util.Context.NONE); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java index 3690bb768f43e..1a74254a0b155 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java @@ -16,6 +16,7 @@ import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.TagAction; import com.azure.resourcemanager.newrelicobservability.models.TagRule; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -34,45 +35,37 @@ public void testGetWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"provisioningState\":\"Deleting\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[],\"userEmail\":\"bpokulpiujwaasip\"}},\"id\":\"iobyu\",\"name\":\"erpqlpqwcciuqg\",\"type\":\"dbutauvfbtkuwhh\"}"; + String responseStr + = "{\"properties\":{\"provisioningState\":\"Canceled\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"zqioxiysuii\",\"value\":\"nkedyatrwyhqmib\",\"action\":\"Include\"},{\"name\":\"itsmypyyn\",\"value\":\"dpumnzgmw\",\"action\":\"Exclude\"},{\"name\":\"biknsorgjhxbld\",\"value\":\"wwrlkdmtncv\",\"action\":\"Exclude\"},{\"name\":\"llxdyhgs\",\"value\":\"cogjltdtbn\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"vcikhnvpamqgx\",\"value\":\"u\",\"action\":\"Include\"},{\"name\":\"ywggx\",\"value\":\"lla\",\"action\":\"Include\"},{\"name\":\"wuipiccjzkzivg\",\"value\":\"c\",\"action\":\"Include\"}],\"userEmail\":\"hyrnxxmu\"}},\"id\":\"dndrdvstkwqqtche\",\"name\":\"lmfmtdaay\",\"type\":\"dvwvgpio\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - TagRule response = - manager - .tagRules() - .getWithResponse("yvoqa", "piexpbtgiw", "wo", com.azure.core.util.Context.NONE) - .getValue(); + TagRule response = manager.tagRules() + .getWithResponse("synljphuopxodl", "iyntorzihle", "sjswsrms", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals(SendAadLogsStatus.ENABLED, response.logRules().sendAadLogs()); + Assertions.assertEquals(SendAadLogsStatus.DISABLED, response.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, response.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.ENABLED, response.logRules().sendActivityLogs()); + Assertions.assertEquals(SendActivityLogsStatus.DISABLED, response.logRules().sendActivityLogs()); + Assertions.assertEquals("zqioxiysuii", response.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("nkedyatrwyhqmib", response.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, response.logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.DISABLED, response.metricRules().sendMetrics()); - Assertions.assertEquals("bpokulpiujwaasip", response.metricRules().userEmail()); + Assertions.assertEquals("vcikhnvpamqgx", response.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("u", response.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, response.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("hyrnxxmu", response.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java index ae48a178d864e..c573380a87ffb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java @@ -17,6 +17,7 @@ import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.newrelicobservability.models.TagAction; import com.azure.resourcemanager.newrelicobservability.models.TagRule; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -35,45 +36,42 @@ public void testListByNewRelicMonitorResource() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[],\"userEmail\":\"brh\"}},\"id\":\"xsdqrhzoymibmrqy\",\"name\":\"bahwfl\",\"type\":\"szdtmhrkwof\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"lpichk\",\"value\":\"mkcdyhbpkkpwdre\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"ljxywsu\",\"value\":\"yrs\",\"action\":\"Exclude\"},{\"name\":\"tgadgvraeaen\",\"value\":\"nzar\",\"action\":\"Exclude\"},{\"name\":\"uu\",\"value\":\"fqka\",\"action\":\"Include\"}],\"userEmail\":\"ipfpubji\"}},\"id\":\"wifto\",\"name\":\"qkvpuvksgplsakn\",\"type\":\"n\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager.tagRules().listByNewRelicMonitorResource("helxprglya", "dd", com.azure.core.util.Context.NONE); + PagedIterable response = manager.tagRules().listByNewRelicMonitorResource("iuqgbdbutauv", "btkuwhh", + com.azure.core.util.Context.NONE); - Assertions.assertEquals(SendAadLogsStatus.ENABLED, response.iterator().next().logRules().sendAadLogs()); - Assertions - .assertEquals( - SendSubscriptionLogsStatus.DISABLED, response.iterator().next().logRules().sendSubscriptionLogs()); - Assertions - .assertEquals(SendActivityLogsStatus.DISABLED, response.iterator().next().logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, response.iterator().next().metricRules().sendMetrics()); - Assertions.assertEquals("brh", response.iterator().next().metricRules().userEmail()); + Assertions.assertEquals(SendAadLogsStatus.DISABLED, response.iterator().next().logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, + response.iterator().next().logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, + response.iterator().next().logRules().sendActivityLogs()); + Assertions.assertEquals("lpichk", response.iterator().next().logRules().filteringTags().get(0).name()); + Assertions.assertEquals("mkcdyhbpkkpwdre", + response.iterator().next().logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, + response.iterator().next().logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, response.iterator().next().metricRules().sendMetrics()); + Assertions.assertEquals("ljxywsu", response.iterator().next().metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("yrs", response.iterator().next().metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, + response.iterator().next().metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("ipfpubji", response.iterator().next().metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java index 13428ef958d10..8add577f3dac0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java @@ -10,11 +10,9 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserAssignedIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"b179bc5a-ba24-44a5-98e8-6105794eb3a6\",\"clientId\":\"e9347589-9d4e-419f-a817-e67cd01fd86d\"}") - .toObject(UserAssignedIdentity.class); + UserAssignedIdentity model = BinaryData.fromString( + "{\"principalId\":\"8a6e797b-d54f-4f62-b647-5febff1104b3\",\"clientId\":\"02d7ff7b-5b05-448c-bc76-2918b6a0e6a4\"}") + .toObject(UserAssignedIdentity.class); } @org.junit.jupiter.api.Test diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java index 616acfe584a52..c47281c464c49 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java @@ -11,32 +11,25 @@ public final class UserInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserInfo model = - BinaryData - .fromString( - "{\"firstName\":\"fvzwdzuhty\",\"lastName\":\"isdkfthwxmnteiw\",\"emailAddress\":\"pvkmijcmmxdcuf\",\"phoneNumber\":\"srp\",\"country\":\"zidnsezcxtbzsgfy\"}") - .toObject(UserInfo.class); - Assertions.assertEquals("fvzwdzuhty", model.firstName()); - Assertions.assertEquals("isdkfthwxmnteiw", model.lastName()); - Assertions.assertEquals("pvkmijcmmxdcuf", model.emailAddress()); - Assertions.assertEquals("srp", model.phoneNumber()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.country()); + UserInfo model = BinaryData.fromString( + "{\"firstName\":\"cciqihnhungbwjz\",\"lastName\":\"fygxgispemvtzfk\",\"emailAddress\":\"ubljofxqe\",\"phoneNumber\":\"jaeq\",\"country\":\"qjbasvms\"}") + .toObject(UserInfo.class); + Assertions.assertEquals("cciqihnhungbwjz", model.firstName()); + Assertions.assertEquals("fygxgispemvtzfk", model.lastName()); + Assertions.assertEquals("ubljofxqe", model.emailAddress()); + Assertions.assertEquals("jaeq", model.phoneNumber()); + Assertions.assertEquals("qjbasvms", model.country()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserInfo model = - new UserInfo() - .withFirstName("fvzwdzuhty") - .withLastName("isdkfthwxmnteiw") - .withEmailAddress("pvkmijcmmxdcuf") - .withPhoneNumber("srp") - .withCountry("zidnsezcxtbzsgfy"); + UserInfo model = new UserInfo().withFirstName("cciqihnhungbwjz").withLastName("fygxgispemvtzfk") + .withEmailAddress("ubljofxqe").withPhoneNumber("jaeq").withCountry("qjbasvms"); model = BinaryData.fromObject(model).toObject(UserInfo.class); - Assertions.assertEquals("fvzwdzuhty", model.firstName()); - Assertions.assertEquals("isdkfthwxmnteiw", model.lastName()); - Assertions.assertEquals("pvkmijcmmxdcuf", model.emailAddress()); - Assertions.assertEquals("srp", model.phoneNumber()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.country()); + Assertions.assertEquals("cciqihnhungbwjz", model.firstName()); + Assertions.assertEquals("fygxgispemvtzfk", model.lastName()); + Assertions.assertEquals("ubljofxqe", model.emailAddress()); + Assertions.assertEquals("jaeq", model.phoneNumber()); + Assertions.assertEquals("qjbasvms", model.country()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java index c3077072d3127..03f5b171bd3e4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java @@ -13,33 +13,25 @@ public final class VMHostsListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - VMHostsListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"vmId\":\"ounqecano\",\"agentVersion\":\"upfh\",\"agentStatus\":\"ltrpmopj\"}],\"nextLink\":\"matuok\"}") - .toObject(VMHostsListResponse.class); - Assertions.assertEquals("ounqecano", model.value().get(0).vmId()); - Assertions.assertEquals("upfh", model.value().get(0).agentVersion()); - Assertions.assertEquals("ltrpmopj", model.value().get(0).agentStatus()); - Assertions.assertEquals("matuok", model.nextLink()); + VMHostsListResponse model = BinaryData.fromString( + "{\"value\":[{\"vmId\":\"gxlefgugnxkrxd\",\"agentVersion\":\"i\",\"agentStatus\":\"thz\"}],\"nextLink\":\"qdrabhjybigehoqf\"}") + .toObject(VMHostsListResponse.class); + Assertions.assertEquals("gxlefgugnxkrxd", model.value().get(0).vmId()); + Assertions.assertEquals("i", model.value().get(0).agentVersion()); + Assertions.assertEquals("thz", model.value().get(0).agentStatus()); + Assertions.assertEquals("qdrabhjybigehoqf", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VMHostsListResponse model = - new VMHostsListResponse() - .withValue( - Arrays - .asList( - new VMInfoInner() - .withVmId("ounqecano") - .withAgentVersion("upfh") - .withAgentStatus("ltrpmopj"))) - .withNextLink("matuok"); + VMHostsListResponse model = new VMHostsListResponse() + .withValue(Arrays + .asList(new VMInfoInner().withVmId("gxlefgugnxkrxd").withAgentVersion("i").withAgentStatus("thz"))) + .withNextLink("qdrabhjybigehoqf"); model = BinaryData.fromObject(model).toObject(VMHostsListResponse.class); - Assertions.assertEquals("ounqecano", model.value().get(0).vmId()); - Assertions.assertEquals("upfh", model.value().get(0).agentVersion()); - Assertions.assertEquals("ltrpmopj", model.value().get(0).agentStatus()); - Assertions.assertEquals("matuok", model.nextLink()); + Assertions.assertEquals("gxlefgugnxkrxd", model.value().get(0).vmId()); + Assertions.assertEquals("i", model.value().get(0).agentVersion()); + Assertions.assertEquals("thz", model.value().get(0).agentStatus()); + Assertions.assertEquals("qdrabhjybigehoqf", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java index 8679fe6298854..8fc9411a20b82 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java @@ -11,21 +11,21 @@ public final class VMInfoInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - VMInfoInner model = - BinaryData - .fromString("{\"vmId\":\"fu\",\"agentVersion\":\"aodsfcpkv\",\"agentStatus\":\"dpuozmyz\"}") - .toObject(VMInfoInner.class); - Assertions.assertEquals("fu", model.vmId()); - Assertions.assertEquals("aodsfcpkv", model.agentVersion()); - Assertions.assertEquals("dpuozmyz", model.agentStatus()); + VMInfoInner model = BinaryData + .fromString("{\"vmId\":\"wska\",\"agentVersion\":\"ktzlcuiywg\",\"agentStatus\":\"wgndrvynhzgpp\"}") + .toObject(VMInfoInner.class); + Assertions.assertEquals("wska", model.vmId()); + Assertions.assertEquals("ktzlcuiywg", model.agentVersion()); + Assertions.assertEquals("wgndrvynhzgpp", model.agentStatus()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VMInfoInner model = new VMInfoInner().withVmId("fu").withAgentVersion("aodsfcpkv").withAgentStatus("dpuozmyz"); + VMInfoInner model + = new VMInfoInner().withVmId("wska").withAgentVersion("ktzlcuiywg").withAgentStatus("wgndrvynhzgpp"); model = BinaryData.fromObject(model).toObject(VMInfoInner.class); - Assertions.assertEquals("fu", model.vmId()); - Assertions.assertEquals("aodsfcpkv", model.agentVersion()); - Assertions.assertEquals("dpuozmyz", model.agentStatus()); + Assertions.assertEquals("wska", model.vmId()); + Assertions.assertEquals("ktzlcuiywg", model.agentVersion()); + Assertions.assertEquals("wgndrvynhzgpp", model.agentStatus()); } }